|
@@ -5,10 +5,8 @@ import android.accessibilityservice.AccessibilityServiceInfo
|
|
|
import android.annotation.SuppressLint
|
|
import android.annotation.SuppressLint
|
|
|
import android.content.ComponentName
|
|
import android.content.ComponentName
|
|
|
import android.content.Context
|
|
import android.content.Context
|
|
|
-import android.content.Intent
|
|
|
|
|
import android.graphics.PixelFormat
|
|
import android.graphics.PixelFormat
|
|
|
import android.graphics.Rect
|
|
import android.graphics.Rect
|
|
|
-import android.net.Uri
|
|
|
|
|
import android.os.Build
|
|
import android.os.Build
|
|
|
import android.os.Handler
|
|
import android.os.Handler
|
|
|
import android.os.Looper
|
|
import android.os.Looper
|
|
@@ -35,10 +33,7 @@ import androidx.lifecycle.liveData
|
|
|
import com.example.modifier.BuildConfig
|
|
import com.example.modifier.BuildConfig
|
|
|
import com.example.modifier.Global
|
|
import com.example.modifier.Global
|
|
|
import com.example.modifier.Global.backup
|
|
import com.example.modifier.Global.backup
|
|
|
-import com.example.modifier.Global.changeClashProfile
|
|
|
|
|
-import com.example.modifier.Global.resetAll
|
|
|
|
|
import com.example.modifier.Global.restartModifier
|
|
import com.example.modifier.Global.restartModifier
|
|
|
-import com.example.modifier.Global.stopClash
|
|
|
|
|
import com.example.modifier.R
|
|
import com.example.modifier.R
|
|
|
import com.example.modifier.TraverseResult
|
|
import com.example.modifier.TraverseResult
|
|
|
import com.example.modifier.Utils
|
|
import com.example.modifier.Utils
|
|
@@ -58,7 +53,7 @@ import com.example.modifier.databinding.FloatingWindowBinding
|
|
|
import com.example.modifier.enums.RcsConfigureState
|
|
import com.example.modifier.enums.RcsConfigureState
|
|
|
import com.example.modifier.enums.RcsConnectionStatus
|
|
import com.example.modifier.enums.RcsConnectionStatus
|
|
|
import com.example.modifier.extension.kill
|
|
import com.example.modifier.extension.kill
|
|
|
-import com.example.modifier.hasRootAccess
|
|
|
|
|
|
|
+import com.example.modifier.utils.hasRootAccess
|
|
|
import com.example.modifier.http.ktorClient
|
|
import com.example.modifier.http.ktorClient
|
|
|
import com.example.modifier.http.api.DeviceApi
|
|
import com.example.modifier.http.api.DeviceApi
|
|
|
import com.example.modifier.http.api.RcsNumberApi
|
|
import com.example.modifier.http.api.RcsNumberApi
|
|
@@ -72,9 +67,20 @@ import com.example.modifier.model.SocketCallback
|
|
|
import com.example.modifier.model.TaskAction
|
|
import com.example.modifier.model.TaskAction
|
|
|
import com.example.modifier.model.TaskConfig
|
|
import com.example.modifier.model.TaskConfig
|
|
|
import com.example.modifier.model.TaskExecutionResult
|
|
import com.example.modifier.model.TaskExecutionResult
|
|
|
-import com.example.modifier.model.TelephonyConfig
|
|
|
|
|
|
|
+import com.example.modifier.model.SimInfo
|
|
|
import com.example.modifier.serializer.Json
|
|
import com.example.modifier.serializer.Json
|
|
|
-import com.example.modifier.shellRun
|
|
|
|
|
|
|
+import com.example.modifier.utils.changeClashProfile
|
|
|
|
|
+import com.example.modifier.utils.clearConv
|
|
|
|
|
+import com.example.modifier.utils.isClashInstalled
|
|
|
|
|
+import com.example.modifier.utils.isOldVersion
|
|
|
|
|
+import com.example.modifier.utils.isRebooted
|
|
|
|
|
+import com.example.modifier.utils.optimize
|
|
|
|
|
+import com.example.modifier.utils.resetAll
|
|
|
|
|
+import com.example.modifier.utils.shellRun
|
|
|
|
|
+import com.example.modifier.utils.smsIntent
|
|
|
|
|
+import com.example.modifier.utils.stopClash
|
|
|
|
|
+import com.example.modifier.utils.syncTime
|
|
|
|
|
+import com.example.modifier.utils.uniqueId
|
|
|
import com.google.android.material.color.DynamicColors
|
|
import com.google.android.material.color.DynamicColors
|
|
|
import io.ktor.client.HttpClient
|
|
import io.ktor.client.HttpClient
|
|
|
import io.ktor.client.call.body
|
|
import io.ktor.client.call.body
|
|
@@ -115,6 +121,7 @@ import java.time.LocalDateTime
|
|
|
import java.time.temporal.ChronoUnit
|
|
import java.time.temporal.ChronoUnit
|
|
|
import java.util.Optional
|
|
import java.util.Optional
|
|
|
import java.util.Timer
|
|
import java.util.Timer
|
|
|
|
|
+import java.util.TimerTask
|
|
|
import java.util.concurrent.atomic.AtomicReference
|
|
import java.util.concurrent.atomic.AtomicReference
|
|
|
import kotlin.coroutines.resume
|
|
import kotlin.coroutines.resume
|
|
|
import kotlin.math.max
|
|
import kotlin.math.max
|
|
@@ -127,8 +134,6 @@ import kotlin.time.Duration.Companion.seconds
|
|
|
@SuppressLint("SetTextI18n")
|
|
@SuppressLint("SetTextI18n")
|
|
|
class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
companion object {
|
|
companion object {
|
|
|
- private const val TAG = "ModifierService1"
|
|
|
|
|
-
|
|
|
|
|
const val NAME: String = BuildConfig.APPLICATION_ID + ".service.ModifierService"
|
|
const val NAME: String = BuildConfig.APPLICATION_ID + ".service.ModifierService"
|
|
|
|
|
|
|
|
@JvmStatic
|
|
@JvmStatic
|
|
@@ -226,23 +231,23 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
mSocket.disconnect()
|
|
mSocket.disconnect()
|
|
|
}
|
|
}
|
|
|
mSocketOpts.query =
|
|
mSocketOpts.query =
|
|
|
- "model=${Build.MODEL}&name=${appPreferences.value.name}&id=${Utils.getUniqueID()}&version=${BuildConfig.VERSION_CODE}"
|
|
|
|
|
|
|
+ "model=${Build.MODEL}&name=${appPreferences.value.name}&id=${uniqueId}&version=${BuildConfig.VERSION_CODE}"
|
|
|
mSocketOpts.transports = arrayOf("websocket")
|
|
mSocketOpts.transports = arrayOf("websocket")
|
|
|
- Log.i(TAG, "Connection query: ${mSocketOpts.query}")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "Connection query: ${mSocketOpts.query}")
|
|
|
mSocket = IO.socket(appPreferences.value.server, mSocketOpts)
|
|
mSocket = IO.socket(appPreferences.value.server, mSocketOpts)
|
|
|
mSocket.on("message", this@ModifierService)
|
|
mSocket.on("message", this@ModifierService)
|
|
|
mSocket.on(Socket.EVENT_CONNECT) {
|
|
mSocket.on(Socket.EVENT_CONNECT) {
|
|
|
- Log.i(TAG, "Connected to server")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "Connected to server")
|
|
|
CoroutineScope(Dispatchers.IO).launch {
|
|
CoroutineScope(Dispatchers.IO).launch {
|
|
|
delay(500)
|
|
delay(500)
|
|
|
reportDeviceStatues()
|
|
reportDeviceStatues()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
mSocket.on(Socket.EVENT_DISCONNECT) {
|
|
mSocket.on(Socket.EVENT_DISCONNECT) {
|
|
|
- Log.i(TAG, "Disconnected from server")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "Disconnected from server")
|
|
|
}
|
|
}
|
|
|
mSocket.on(Socket.EVENT_CONNECT_ERROR) { args ->
|
|
mSocket.on(Socket.EVENT_CONNECT_ERROR) { args ->
|
|
|
- Log.i(TAG, "Connection error: " + args[0])
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "Connection error: " + args[0])
|
|
|
if (args[0] is Exception) {
|
|
if (args[0] is Exception) {
|
|
|
val e = args[0] as Exception
|
|
val e = args[0] as Exception
|
|
|
e.printStackTrace()
|
|
e.printStackTrace()
|
|
@@ -256,7 +261,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
|
|
|
|
|
override fun onCreate() {
|
|
override fun onCreate() {
|
|
|
super.onCreate()
|
|
super.onCreate()
|
|
|
- Log.i(TAG, "Starting ModifierService")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "Starting ModifierService")
|
|
|
CoroutineScope(Dispatchers.IO).launch {
|
|
CoroutineScope(Dispatchers.IO).launch {
|
|
|
appState = appStateRepository.getAppState()
|
|
appState = appStateRepository.getAppState()
|
|
|
appPreferences = appPreferencesRepository.getAppPreferences()
|
|
appPreferences = appPreferencesRepository.getAppPreferences()
|
|
@@ -273,12 +278,13 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
if (!hasRoot) {
|
|
if (!hasRoot) {
|
|
|
System.exit(0)
|
|
System.exit(0)
|
|
|
}
|
|
}
|
|
|
- if (Global.rebooted()) {
|
|
|
|
|
|
|
+ if (isRebooted()) {
|
|
|
delay(2.minutes)
|
|
delay(2.minutes)
|
|
|
} else {
|
|
} else {
|
|
|
delay(5000)
|
|
delay(5000)
|
|
|
}
|
|
}
|
|
|
- Global.setupSystem()
|
|
|
|
|
|
|
+ optimize()
|
|
|
|
|
+ syncTime()
|
|
|
if (Build.MODEL.startsWith("SM-F707") || Build.MODEL.startsWith("SM-F711")) {
|
|
if (Build.MODEL.startsWith("SM-F707") || Build.MODEL.startsWith("SM-F711")) {
|
|
|
Global.killPhoneProcess(force = false)
|
|
Global.killPhoneProcess(force = false)
|
|
|
}
|
|
}
|
|
@@ -286,17 +292,22 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
|
|
|
|
|
connect()
|
|
connect()
|
|
|
val timer = Timer()
|
|
val timer = Timer()
|
|
|
- timer.schedule(object : java.util.TimerTask() {
|
|
|
|
|
|
|
+ timer.schedule(object : TimerTask() {
|
|
|
override fun run() {
|
|
override fun run() {
|
|
|
reportDeviceStatues()
|
|
reportDeviceStatues()
|
|
|
}
|
|
}
|
|
|
- }, 0, 3000)
|
|
|
|
|
|
|
+ }, 0, 3.seconds.inWholeMilliseconds)
|
|
|
|
|
+ timer.schedule(object : TimerTask() {
|
|
|
|
|
+ override fun run() {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 0, 30.minutes.inWholeMilliseconds)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
override fun onAccessibilityEvent(event: AccessibilityEvent) {
|
|
override fun onAccessibilityEvent(event: AccessibilityEvent) {
|
|
|
Log.d(
|
|
Log.d(
|
|
|
- TAG,
|
|
|
|
|
|
|
+ com.example.modifier.TAG,
|
|
|
"eventType: ${event.eventType}, packageName: ${event.packageName}, className: ${event.className}"
|
|
"eventType: ${event.eventType}, packageName: ${event.packageName}, className: ${event.className}"
|
|
|
)
|
|
)
|
|
|
if (event.eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
|
|
if (event.eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
|
|
@@ -308,7 +319,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
try {
|
|
try {
|
|
|
packageManager.getActivityInfo(componentName, 0)
|
|
packageManager.getActivityInfo(componentName, 0)
|
|
|
currentActivity = componentName.flattenToShortString()
|
|
currentActivity = componentName.flattenToShortString()
|
|
|
- Log.d(TAG, "Activity: $currentActivity")
|
|
|
|
|
|
|
+ Log.d(com.example.modifier.TAG, "Activity: $currentActivity")
|
|
|
} catch (_: Exception) {
|
|
} catch (_: Exception) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -321,7 +332,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
|
|
|
|
|
override fun call(vararg args: Any) {
|
|
override fun call(vararg args: Any) {
|
|
|
if (args.isNotEmpty()) {
|
|
if (args.isNotEmpty()) {
|
|
|
- Log.i(TAG, "Received message: " + args[0])
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "Received message: " + args[0])
|
|
|
if (args[0] is JSONObject) {
|
|
if (args[0] is JSONObject) {
|
|
|
val json = args[0] as JSONObject
|
|
val json = args[0] as JSONObject
|
|
|
val action = json.optString("action")
|
|
val action = json.optString("action")
|
|
@@ -389,7 +400,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- Log.i(TAG, "Apk file saved to ${file.path}")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "Apk file saved to ${file.path}")
|
|
|
shellRun("pm install -d -r ${file.path}")
|
|
shellRun("pm install -d -r ${file.path}")
|
|
|
mSocket.emit(
|
|
mSocket.emit(
|
|
|
"callback",
|
|
"callback",
|
|
@@ -480,7 +491,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
fail.add(taskItem.id)
|
|
fail.add(taskItem.id)
|
|
|
}
|
|
}
|
|
|
} catch (e: Exception) {
|
|
} catch (e: Exception) {
|
|
|
- Log.e(TAG, "runTaskError: ${e.message}", e)
|
|
|
|
|
|
|
+ Log.e(com.example.modifier.TAG, "runTaskError: ${e.message}", e)
|
|
|
fail.add(taskItem.id)
|
|
fail.add(taskItem.id)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -500,9 +511,9 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
if (taskConfig.requestNumberInterval in 1..appState.value.successNum) {
|
|
if (taskConfig.requestNumberInterval in 1..appState.value.successNum) {
|
|
|
delay(3000)
|
|
delay(3000)
|
|
|
requestNumber()
|
|
requestNumber()
|
|
|
- } else if (taskConfig.cleanCount in 1..appState.value.executedNum) {
|
|
|
|
|
|
|
+ } else if (taskConfig.cleanCount in 1..appState.value.executedNum && !appPreferences.value.preventClean) {
|
|
|
delay(3000)
|
|
delay(3000)
|
|
|
- Global.clearConv();
|
|
|
|
|
|
|
+ clearConv();
|
|
|
shellRun(CMD_MESSAGING_APP)
|
|
shellRun(CMD_MESSAGING_APP)
|
|
|
delay(3000)
|
|
delay(3000)
|
|
|
appStateRepository.resetExecutedNum()
|
|
appStateRepository.resetExecutedNum()
|
|
@@ -511,7 +522,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
}
|
|
}
|
|
|
appStateRepository.updateRuntimeFlags(running = false)
|
|
appStateRepository.updateRuntimeFlags(running = false)
|
|
|
} catch (e: Exception) {
|
|
} catch (e: Exception) {
|
|
|
- Log.e(TAG, "runTaskError: ${e.message}", e)
|
|
|
|
|
|
|
+ Log.e(com.example.modifier.TAG, "runTaskError: ${e.message}", e)
|
|
|
mSocket.emit(
|
|
mSocket.emit(
|
|
|
"callback",
|
|
"callback",
|
|
|
JSONObject(
|
|
JSONObject(
|
|
@@ -528,25 +539,18 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private fun smsIntent(to: String, body: String): Intent {
|
|
|
|
|
- val intent = Intent(Intent.ACTION_SENDTO)
|
|
|
|
|
- intent.data = Uri.parse("sms:$to")
|
|
|
|
|
- intent.putExtra("sms_body", body)
|
|
|
|
|
- intent.putExtra("exit_on_sent", true)
|
|
|
|
|
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
|
|
|
- intent.setPackage("com.google.android.apps.messaging")
|
|
|
|
|
- return intent
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
private suspend fun send(
|
|
private suspend fun send(
|
|
|
to: String,
|
|
to: String,
|
|
|
body: String,
|
|
body: String,
|
|
|
taskConfig: TaskConfig
|
|
taskConfig: TaskConfig
|
|
|
): Boolean {
|
|
): Boolean {
|
|
|
- Log.i(TAG, "Sending SMS to $to: $body")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "Sending SMS to $to: $body")
|
|
|
startActivity(smsIntent(to, body))
|
|
startActivity(smsIntent(to, body))
|
|
|
try {
|
|
try {
|
|
|
- Log.i(TAG, "Command executed successfully, waiting for app to open...")
|
|
|
|
|
|
|
+ Log.i(
|
|
|
|
|
+ com.example.modifier.TAG,
|
|
|
|
|
+ "Command executed successfully, waiting for app to open..."
|
|
|
|
|
+ )
|
|
|
delay(1000)
|
|
delay(1000)
|
|
|
var success = false
|
|
var success = false
|
|
|
var traverseResult = TraverseResult()
|
|
var traverseResult = TraverseResult()
|
|
@@ -571,13 +575,13 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
}
|
|
}
|
|
|
if (traverseResult.isRcsCapable) {
|
|
if (traverseResult.isRcsCapable) {
|
|
|
if (traverseResult.sendBtn == null) {
|
|
if (traverseResult.sendBtn == null) {
|
|
|
- Log.i(TAG, "Send button not found")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "Send button not found")
|
|
|
} else {
|
|
} else {
|
|
|
- Log.i(TAG, "Clicking send button")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "Clicking send button")
|
|
|
|
|
|
|
|
val dt = System.currentTimeMillis() - lastSend
|
|
val dt = System.currentTimeMillis() - lastSend
|
|
|
if (taskConfig.rcsInterval > 0 && dt < taskConfig.rcsInterval) {
|
|
if (taskConfig.rcsInterval > 0 && dt < taskConfig.rcsInterval) {
|
|
|
- Log.i(TAG, "Waiting for RCS interval")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "Waiting for RCS interval")
|
|
|
delay(taskConfig.rcsInterval - dt)
|
|
delay(taskConfig.rcsInterval - dt)
|
|
|
}
|
|
}
|
|
|
traverseResult.sendBtn!!.performAction(AccessibilityNodeInfo.ACTION_CLICK)
|
|
traverseResult.sendBtn!!.performAction(AccessibilityNodeInfo.ACTION_CLICK)
|
|
@@ -585,11 +589,11 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
success = true
|
|
success = true
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- Log.i(TAG, "RCS not detected")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "RCS not detected")
|
|
|
}
|
|
}
|
|
|
appStateRepository.incrementExecutedNum(success)
|
|
appStateRepository.incrementExecutedNum(success)
|
|
|
Log.i(
|
|
Log.i(
|
|
|
- TAG,
|
|
|
|
|
|
|
+ com.example.modifier.TAG,
|
|
|
"executedNum: ${appState.value.executedNum}, successNum: ${appState.value.successNum}"
|
|
"executedNum: ${appState.value.executedNum}, successNum: ${appState.value.successNum}"
|
|
|
)
|
|
)
|
|
|
delay(1000)
|
|
delay(1000)
|
|
@@ -628,7 +632,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
.orElse(null)
|
|
.orElse(null)
|
|
|
val id = node.viewIdResourceName
|
|
val id = node.viewIdResourceName
|
|
|
|
|
|
|
|
- Log.d(TAG, "Node: class=$className, text=$text, name=$name, id=$id")
|
|
|
|
|
|
|
+ Log.d(com.example.modifier.TAG, "Node: class=$className, text=$text, name=$name, id=$id")
|
|
|
|
|
|
|
|
if ("Compose:Draft:Send" == name) {
|
|
if ("Compose:Draft:Send" == name) {
|
|
|
result.sendBtn = node
|
|
result.sendBtn = node
|
|
@@ -735,7 +739,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
binding.root.post {
|
|
binding.root.post {
|
|
|
maxX = width - binding.root.measuredWidth
|
|
maxX = width - binding.root.measuredWidth
|
|
|
maxY = height - binding.root.measuredHeight
|
|
maxY = height - binding.root.measuredHeight
|
|
|
- Log.i(TAG, "measured: $maxX, $maxY")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "measured: $maxX, $maxY")
|
|
|
layoutParams.x = maxX
|
|
layoutParams.x = maxX
|
|
|
windowManager.updateViewLayout(mLayout, layoutParams)
|
|
windowManager.updateViewLayout(mLayout, layoutParams)
|
|
|
}
|
|
}
|
|
@@ -847,7 +851,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
R.id.clear_conv -> {
|
|
R.id.clear_conv -> {
|
|
|
- Global.clearConv()
|
|
|
|
|
|
|
+ clearConv()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
R.id.store_numbers -> {
|
|
R.id.store_numbers -> {
|
|
@@ -892,7 +896,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
val dataObj = JSONObject()
|
|
val dataObj = JSONObject()
|
|
|
dataObj.put("canSend", appState.value.send)
|
|
dataObj.put("canSend", appState.value.send)
|
|
|
dataObj.put("busy", appState.value.busy)
|
|
dataObj.put("busy", appState.value.busy)
|
|
|
- dataObj.put("currentCountry", Global.telephonyConfig.country)
|
|
|
|
|
|
|
+ dataObj.put("currentCountry", Global.simInfo.country)
|
|
|
data.put("data", dataObj)
|
|
data.put("data", dataObj)
|
|
|
mSocket.emit("message", data)
|
|
mSocket.emit("message", data)
|
|
|
} catch (e: JSONException) {
|
|
} catch (e: JSONException) {
|
|
@@ -921,7 +925,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
|
|
|
|
|
continuation.invokeOnCancellation {
|
|
continuation.invokeOnCancellation {
|
|
|
handler.post {
|
|
handler.post {
|
|
|
- Log.i(TAG, "removeObserver")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "removeObserver")
|
|
|
rcsConfigureState.removeObserver(observer)
|
|
rcsConfigureState.removeObserver(observer)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -999,19 +1003,8 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
return success
|
|
return success
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private fun isOldVersion(): Boolean {
|
|
|
|
|
- val info = packageManager.getPackageInfo("com.google.android.apps.messaging", 0)
|
|
|
|
|
- var oldVersion = false
|
|
|
|
|
- if (info != null) {
|
|
|
|
|
- if (info.versionCode < 170545910) {
|
|
|
|
|
- oldVersion = true
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return oldVersion
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
private suspend fun reset() {
|
|
private suspend fun reset() {
|
|
|
- if (isOldVersion()) {
|
|
|
|
|
|
|
+ if (isOldVersion(this)) {
|
|
|
withTimeout(1.hours) {
|
|
withTimeout(1.hours) {
|
|
|
while (true) {
|
|
while (true) {
|
|
|
delay(100)
|
|
delay(100)
|
|
@@ -1039,16 +1032,19 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
it == RcsConfigureState.WAITING_FOR_TOS
|
|
it == RcsConfigureState.WAITING_FOR_TOS
|
|
|
}
|
|
}
|
|
|
if (switchAppear != true) {
|
|
if (switchAppear != true) {
|
|
|
- Log.e(TAG, "RCS not entered default on state, retrying...")
|
|
|
|
|
|
|
+ Log.e(
|
|
|
|
|
+ com.example.modifier.TAG,
|
|
|
|
|
+ "RCS not entered default on state, retrying..."
|
|
|
|
|
+ )
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (!toggleRcsSwitch(false)) {
|
|
if (!toggleRcsSwitch(false)) {
|
|
|
- Log.e(TAG, "RCS switch not turned off, retrying...")
|
|
|
|
|
|
|
+ Log.e(com.example.modifier.TAG, "RCS switch not turned off, retrying...")
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
if (!toggleRcsSwitch(true)) {
|
|
if (!toggleRcsSwitch(true)) {
|
|
|
- Log.e(TAG, "RCS switch not turned on, retrying...")
|
|
|
|
|
|
|
+ Log.e(com.example.modifier.TAG, "RCS switch not turned on, retrying...")
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
var resetSuccess = waitForRcsState(
|
|
var resetSuccess = waitForRcsState(
|
|
@@ -1066,7 +1062,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
), 1.minutes
|
|
), 1.minutes
|
|
|
).let { it == RcsConfigureState.READY }
|
|
).let { it == RcsConfigureState.READY }
|
|
|
}
|
|
}
|
|
|
- Log.i(TAG, "waitForRcsState: $resetSuccess")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "waitForRcsState: $resetSuccess")
|
|
|
appStateRepository.resetRequestedNum()
|
|
appStateRepository.resetRequestedNum()
|
|
|
if (resetSuccess) {
|
|
if (resetSuccess) {
|
|
|
delay(3000)
|
|
delay(3000)
|
|
@@ -1102,13 +1098,16 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
it == RcsConfigureState.WAITING_FOR_DEFAULT_ON
|
|
it == RcsConfigureState.WAITING_FOR_DEFAULT_ON
|
|
|
}
|
|
}
|
|
|
if (switchAppear != true) {
|
|
if (switchAppear != true) {
|
|
|
- Log.e(TAG, "RCS not entered default on state, retrying...")
|
|
|
|
|
|
|
+ Log.e(
|
|
|
|
|
+ com.example.modifier.TAG,
|
|
|
|
|
+ "RCS not entered default on state, retrying..."
|
|
|
|
|
+ )
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
val switchOn = toggleRcsSwitch(true)
|
|
val switchOn = toggleRcsSwitch(true)
|
|
|
if (!switchOn) {
|
|
if (!switchOn) {
|
|
|
- Log.e(TAG, "RCS switch not turned on, retrying...")
|
|
|
|
|
|
|
+ Log.e(com.example.modifier.TAG, "RCS switch not turned on, retrying...")
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
var resetSuccess = waitForRcsState(
|
|
var resetSuccess = waitForRcsState(
|
|
@@ -1126,7 +1125,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
), 1.minutes
|
|
), 1.minutes
|
|
|
).let { it == RcsConfigureState.READY }
|
|
).let { it == RcsConfigureState.READY }
|
|
|
}
|
|
}
|
|
|
- Log.i(TAG, "waitForRcsState: $resetSuccess")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "waitForRcsState: $resetSuccess")
|
|
|
appStateRepository.resetRequestedNum()
|
|
appStateRepository.resetRequestedNum()
|
|
|
if (resetSuccess) {
|
|
if (resetSuccess) {
|
|
|
delay(3000)
|
|
delay(3000)
|
|
@@ -1153,7 +1152,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
|
|
|
|
|
appStateRepository.updateRuntimeFlags(requesting = true)
|
|
appStateRepository.updateRuntimeFlags(requesting = true)
|
|
|
|
|
|
|
|
- if (Global.telephonyConfig.available == true) {
|
|
|
|
|
|
|
+ if (Global.simInfo.available == true) {
|
|
|
backup(
|
|
backup(
|
|
|
backupItemDao = backupItemDao,
|
|
backupItemDao = backupItemDao,
|
|
|
type = "auto",
|
|
type = "auto",
|
|
@@ -1161,7 +1160,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
fresh = fresh
|
|
fresh = fresh
|
|
|
)
|
|
)
|
|
|
} else {
|
|
} else {
|
|
|
- Global.clearConv();
|
|
|
|
|
|
|
+ clearConv();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
appStateRepository.incrementRequestedNum()
|
|
appStateRepository.incrementRequestedNum()
|
|
@@ -1174,9 +1173,9 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
needRest = needRest || retry > 2 || appState.value.requestedNum > 5
|
|
needRest = needRest || retry > 2 || appState.value.requestedNum > 5
|
|
|
try {
|
|
try {
|
|
|
val device =
|
|
val device =
|
|
|
- ktorClient(appPreferences.value.server).get(DeviceApi.Id(id = Utils.getUniqueID()))
|
|
|
|
|
|
|
+ ktorClient(appPreferences.value.server).get(DeviceApi.Id(id = uniqueId))
|
|
|
.body<DeviceResponse>()
|
|
.body<DeviceResponse>()
|
|
|
- if (Global.isClashInstalled(applicationContext)) {
|
|
|
|
|
|
|
+ if (isClashInstalled(applicationContext)) {
|
|
|
|
|
|
|
|
val prefs = getSharedPreferences("settings", Context.MODE_PRIVATE)
|
|
val prefs = getSharedPreferences("settings", Context.MODE_PRIVATE)
|
|
|
if (TextUtils.isEmpty(device.clashProfile)) {
|
|
if (TextUtils.isEmpty(device.clashProfile)) {
|
|
@@ -1203,7 +1202,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
|
|
|
|
|
if (requestMode == 2 && !noBackup) {
|
|
if (requestMode == 2 && !noBackup) {
|
|
|
val backup = backupItemDao.findBackupForRestore(
|
|
val backup = backupItemDao.findBackupForRestore(
|
|
|
- Global.telephonyConfig.number,
|
|
|
|
|
|
|
+ Global.simInfo.number,
|
|
|
System.currentTimeMillis() - 2 * 24 * 60 * 60 * 1000
|
|
System.currentTimeMillis() - 2 * 24 * 60 * 60 * 1000
|
|
|
)
|
|
)
|
|
|
if (backup != null) {
|
|
if (backup != null) {
|
|
@@ -1229,7 +1228,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
val req = RcsNumberRequest(
|
|
val req = RcsNumberRequest(
|
|
|
- deviceId = Utils.getUniqueID(),
|
|
|
|
|
|
|
+ deviceId = uniqueId,
|
|
|
taskId = currentTaskId
|
|
taskId = currentTaskId
|
|
|
)
|
|
)
|
|
|
if (!TextUtils.isEmpty(device.pinCountry)) {
|
|
if (!TextUtils.isEmpty(device.pinCountry)) {
|
|
@@ -1246,14 +1245,14 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
var rcsNumber = response.body<RcsNumberResponse>()
|
|
var rcsNumber = response.body<RcsNumberResponse>()
|
|
|
- Log.i(TAG, "requestNumber response: $rcsNumber")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "requestNumber response: $rcsNumber")
|
|
|
|
|
|
|
|
withContext(Dispatchers.Main) {
|
|
withContext(Dispatchers.Main) {
|
|
|
binding.tvLog.text = "Requesting success, waiting for logs..."
|
|
binding.tvLog.text = "Requesting success, waiting for logs..."
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Global.save(
|
|
Global.save(
|
|
|
- TelephonyConfig(
|
|
|
|
|
|
|
+ SimInfo(
|
|
|
rcsNumber.number,
|
|
rcsNumber.number,
|
|
|
rcsNumber.mcc,
|
|
rcsNumber.mcc,
|
|
|
rcsNumber.mnc,
|
|
rcsNumber.mnc,
|
|
@@ -1276,7 +1275,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (rcsNumber.expiryTime.isBefore(LocalDateTime.now())) {
|
|
if (rcsNumber.expiryTime.isBefore(LocalDateTime.now())) {
|
|
|
- Log.e(TAG, "RCS number expired, retrying...")
|
|
|
|
|
|
|
+ Log.e(com.example.modifier.TAG, "RCS number expired, retrying...")
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
var sendOtpTimeout = ChronoUnit.SECONDS.between(
|
|
var sendOtpTimeout = ChronoUnit.SECONDS.between(
|
|
@@ -1284,7 +1283,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
rcsNumber.expiryTime
|
|
rcsNumber.expiryTime
|
|
|
).seconds
|
|
).seconds
|
|
|
if (sendOtpTimeout < 60.seconds) {
|
|
if (sendOtpTimeout < 60.seconds) {
|
|
|
- Log.e(TAG, "OTP timeout too short, retrying...")
|
|
|
|
|
|
|
+ Log.e(com.example.modifier.TAG, "OTP timeout too short, retrying...")
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
if (sendOtpTimeout > 2.minutes) {
|
|
if (sendOtpTimeout > 2.minutes) {
|
|
@@ -1299,10 +1298,16 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
needRest = true
|
|
needRest = true
|
|
|
}
|
|
}
|
|
|
if (RcsConfigureState.REPLAY_REQUEST == rcsConfigureState.value) {
|
|
if (RcsConfigureState.REPLAY_REQUEST == rcsConfigureState.value) {
|
|
|
- Log.e(TAG, "REPLAY_REQUEST detected, may reset after 3 retry ($retry)")
|
|
|
|
|
|
|
+ Log.e(
|
|
|
|
|
+ com.example.modifier.TAG,
|
|
|
|
|
+ "REPLAY_REQUEST detected, may reset after 3 retry ($retry)"
|
|
|
|
|
+ )
|
|
|
retry++
|
|
retry++
|
|
|
}
|
|
}
|
|
|
- Log.e(TAG, "RCS not entered waiting for OTP state, retrying...")
|
|
|
|
|
|
|
+ Log.e(
|
|
|
|
|
+ com.example.modifier.TAG,
|
|
|
|
|
+ "RCS not entered waiting for OTP state, retrying..."
|
|
|
|
|
+ )
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1317,12 +1322,12 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
} catch (e: Exception) {
|
|
} catch (e: Exception) {
|
|
|
- Log.e(TAG, "Send OtpState Error: ${e.message}", e)
|
|
|
|
|
|
|
+ Log.e(com.example.modifier.TAG, "Send OtpState Error: ${e.message}", e)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (rcsNumber.expiryTime.isBefore(LocalDateTime.now())) {
|
|
if (rcsNumber.expiryTime.isBefore(LocalDateTime.now())) {
|
|
|
- Log.e(TAG, "RCS number expired, retrying...")
|
|
|
|
|
|
|
+ Log.e(com.example.modifier.TAG, "RCS number expired, retrying...")
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1332,19 +1337,22 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
rcsNumber =
|
|
rcsNumber =
|
|
|
ktorClient(appPreferences.value.server).get(RcsNumberApi.Id(id = rcsNumber.id))
|
|
ktorClient(appPreferences.value.server).get(RcsNumberApi.Id(id = rcsNumber.id))
|
|
|
.body<RcsNumberResponse>()
|
|
.body<RcsNumberResponse>()
|
|
|
- Log.i(TAG, "wait for otp response: $rcsNumber")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "wait for otp response: $rcsNumber")
|
|
|
if (rcsNumber.status == RcsNumberResponse.STATUS_SUCCESS || rcsNumber.status == RcsNumberResponse.STATUS_EXPIRED) {
|
|
if (rcsNumber.status == RcsNumberResponse.STATUS_SUCCESS || rcsNumber.status == RcsNumberResponse.STATUS_EXPIRED) {
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
|
} catch (exception: Exception) {
|
|
} catch (exception: Exception) {
|
|
|
- Log.e(TAG, "wait for otp Error: ${exception.stackTrace}")
|
|
|
|
|
|
|
+ Log.e(
|
|
|
|
|
+ com.example.modifier.TAG,
|
|
|
|
|
+ "wait for otp Error: ${exception.stackTrace}"
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
delay(2.seconds)
|
|
delay(2.seconds)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (rcsNumber.status != RcsNumberResponse.STATUS_SUCCESS) {
|
|
if (rcsNumber.status != RcsNumberResponse.STATUS_SUCCESS) {
|
|
|
- Log.e(TAG, "OTP not received, retrying...")
|
|
|
|
|
|
|
+ Log.e(com.example.modifier.TAG, "OTP not received, retrying...")
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1353,7 +1361,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
.find(rcsNumber.message!!)
|
|
.find(rcsNumber.message!!)
|
|
|
if (match != null) {
|
|
if (match != null) {
|
|
|
val otp = match.groupValues[1]
|
|
val otp = match.groupValues[1]
|
|
|
- Log.i(TAG, "OTP: $otp")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "OTP: $otp")
|
|
|
val sender = "3538"
|
|
val sender = "3538"
|
|
|
val msg = "Your Messenger verification code is G-$otp"
|
|
val msg = "Your Messenger verification code is G-$otp"
|
|
|
|
|
|
|
@@ -1380,14 +1388,17 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
else -> {
|
|
else -> {
|
|
|
- Log.e(TAG, "verifyOtp fail, retrying...")
|
|
|
|
|
|
|
+ Log.e(
|
|
|
|
|
+ com.example.modifier.TAG,
|
|
|
|
|
+ "verifyOtp fail, retrying..."
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
false
|
|
false
|
|
|
}
|
|
}
|
|
|
if (!configured) {
|
|
if (!configured) {
|
|
|
- Log.e(TAG, "RCS not configured, retrying...")
|
|
|
|
|
|
|
+ Log.e(com.example.modifier.TAG, "RCS not configured, retrying...")
|
|
|
continue
|
|
continue
|
|
|
} else {
|
|
} else {
|
|
|
launch {
|
|
launch {
|
|
@@ -1402,7 +1413,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
)
|
|
)
|
|
|
} catch (e: Exception) {
|
|
} catch (e: Exception) {
|
|
|
Log.e(
|
|
Log.e(
|
|
|
- TAG,
|
|
|
|
|
|
|
+ com.example.modifier.TAG,
|
|
|
"Send ConfiguredState Error: ${e.message}",
|
|
"Send ConfiguredState Error: ${e.message}",
|
|
|
e
|
|
e
|
|
|
)
|
|
)
|
|
@@ -1413,21 +1424,21 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} catch (e: Exception) {
|
|
} catch (e: Exception) {
|
|
|
- Log.e(TAG, "requestNumberError: ${e.message}", e)
|
|
|
|
|
|
|
+ Log.e(com.example.modifier.TAG, "requestNumberError: ${e.message}", e)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (requestSuccess) {
|
|
if (requestSuccess) {
|
|
|
- Global.telephonyConfig.available = true
|
|
|
|
|
|
|
+ Global.simInfo.available = true
|
|
|
Global.save()
|
|
Global.save()
|
|
|
appStateRepository.resetSuccessNum()
|
|
appStateRepository.resetSuccessNum()
|
|
|
appStateRepository.resetExecutedNum()
|
|
appStateRepository.resetExecutedNum()
|
|
|
- Log.i(TAG, "requestNumber success")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "requestNumber success")
|
|
|
delay(5000)
|
|
delay(5000)
|
|
|
shellRun(PACKAGE_MESSAGING.kill(), "sleep 1", CMD_MESSAGING_APP)
|
|
shellRun(PACKAGE_MESSAGING.kill(), "sleep 1", CMD_MESSAGING_APP)
|
|
|
delay(2000)
|
|
delay(2000)
|
|
|
} else {
|
|
} else {
|
|
|
- Log.e(TAG, "requestNumber failed")
|
|
|
|
|
|
|
+ Log.e(com.example.modifier.TAG, "requestNumber failed")
|
|
|
appStateRepository.updateSend(false)
|
|
appStateRepository.updateSend(false)
|
|
|
withContext(Dispatchers.Main) {
|
|
withContext(Dispatchers.Main) {
|
|
|
binding.swSend.isChecked = false
|
|
binding.swSend.isChecked = false
|
|
@@ -1440,7 +1451,7 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
|
|
|
|
|
private suspend fun checkRcsConnectivity(): Boolean = run checkRcsConnection@{
|
|
private suspend fun checkRcsConnectivity(): Boolean = run checkRcsConnection@{
|
|
|
repeat(3) {
|
|
repeat(3) {
|
|
|
- Log.i(TAG, "Checking RCS status...")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "Checking RCS status...")
|
|
|
shellRun(
|
|
shellRun(
|
|
|
CMD_CONVERSATION_LIST_ACTIVITY,
|
|
CMD_CONVERSATION_LIST_ACTIVITY,
|
|
|
CMD_RCS_SETTINGS_ACTIVITY,
|
|
CMD_RCS_SETTINGS_ACTIVITY,
|
|
@@ -1449,11 +1460,11 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
val res = TraverseResult()
|
|
val res = TraverseResult()
|
|
|
traverseNode(rootInActiveWindow, res)
|
|
traverseNode(rootInActiveWindow, res)
|
|
|
if (res.rcsConnectionStatus == RcsConnectionStatus.CONNECTED) {
|
|
if (res.rcsConnectionStatus == RcsConnectionStatus.CONNECTED) {
|
|
|
- Log.i(TAG, "RCS is connected")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "RCS is connected")
|
|
|
shellRun(CMD_BACK)
|
|
shellRun(CMD_BACK)
|
|
|
return@checkRcsConnection true
|
|
return@checkRcsConnection true
|
|
|
} else {
|
|
} else {
|
|
|
- Log.i(TAG, "RCS not connected, retrying...")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "RCS not connected, retrying...")
|
|
|
}
|
|
}
|
|
|
shellRun(CMD_BACK, "sleep ${it * 2}")
|
|
shellRun(CMD_BACK, "sleep ${it * 2}")
|
|
|
}
|
|
}
|
|
@@ -1479,17 +1490,21 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
.body<SysConfigResponse>()
|
|
.body<SysConfigResponse>()
|
|
|
- Log.i(TAG, "sysConfig response: $config")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "sysConfig response: $config")
|
|
|
checkRcsAvailabilityNumbers.addAll(
|
|
checkRcsAvailabilityNumbers.addAll(
|
|
|
config.value.split(",").map { it.trim() })
|
|
config.value.split(",").map { it.trim() })
|
|
|
|
|
|
|
|
} catch (exception: Exception) {
|
|
} catch (exception: Exception) {
|
|
|
- Log.e(TAG, "sysConfig Error: ${exception.message}", exception)
|
|
|
|
|
|
|
+ Log.e(
|
|
|
|
|
+ com.example.modifier.TAG,
|
|
|
|
|
+ "sysConfig Error: ${exception.message}",
|
|
|
|
|
+ exception
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (checkRcsAvailabilityNumbers.isEmpty()) {
|
|
if (checkRcsAvailabilityNumbers.isEmpty()) {
|
|
|
- Log.e(TAG, "checkRcsAvailabilityNumbers is empty")
|
|
|
|
|
|
|
+ Log.e(com.example.modifier.TAG, "checkRcsAvailabilityNumbers is empty")
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1503,13 +1518,16 @@ class ModifierService : AccessibilityService(), Emitter.Listener {
|
|
|
if (traverseResult.isRcsCapable) {
|
|
if (traverseResult.isRcsCapable) {
|
|
|
return@withTimeoutOrNull true
|
|
return@withTimeoutOrNull true
|
|
|
} else {
|
|
} else {
|
|
|
- Log.i(TAG, "checkRcsAvailability: RCS not detected")
|
|
|
|
|
|
|
+ Log.i(
|
|
|
|
|
+ com.example.modifier.TAG,
|
|
|
|
|
+ "checkRcsAvailability: RCS not detected"
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
delay(200)
|
|
delay(200)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (s == true) {
|
|
if (s == true) {
|
|
|
- Log.i(TAG, "checkRcsAvailability: $it success")
|
|
|
|
|
|
|
+ Log.i(com.example.modifier.TAG, "checkRcsAvailability: $it success")
|
|
|
delay(1000)
|
|
delay(1000)
|
|
|
return@checkAvailability true
|
|
return@checkAvailability true
|
|
|
}
|
|
}
|