|
|
@@ -3,10 +3,12 @@ package com.example.modifier.service
|
|
|
import android.content.Context
|
|
|
import android.util.Log
|
|
|
import android.view.accessibility.AccessibilityNodeInfo
|
|
|
+import androidx.core.content.ContextCompat
|
|
|
import coil3.ImageLoader
|
|
|
import coil3.request.crossfade
|
|
|
import com.example.modifier.baseTag
|
|
|
import com.example.modifier.TraverseResult
|
|
|
+import com.example.modifier.Utils
|
|
|
import com.example.modifier.constants.CMD_BACK
|
|
|
import com.example.modifier.constants.CMD_CONVERSATION_LIST_ACTIVITY
|
|
|
import com.example.modifier.constants.CMD_MESSAGING_APP
|
|
|
@@ -41,6 +43,7 @@ import com.example.modifier.utils.clearConv
|
|
|
import com.example.modifier.utils.genICCID
|
|
|
import com.example.modifier.utils.genIMEI
|
|
|
import com.example.modifier.utils.genIMSI
|
|
|
+import com.example.modifier.utils.getContext
|
|
|
import com.example.modifier.utils.isOldVersion
|
|
|
import com.example.modifier.utils.resetAll
|
|
|
import com.example.modifier.utils.shellRun
|
|
|
@@ -219,7 +222,7 @@ class TaskRunner(
|
|
|
}
|
|
|
}
|
|
|
shellRun(CMD_BACK)
|
|
|
- delay(10000)
|
|
|
+ delay(5000)
|
|
|
onSuccess(results)
|
|
|
if (taskConfig.requestNumberInterval in 1..appStateRepo.appState.value.successNum) {
|
|
|
delay(3000)
|
|
|
@@ -250,6 +253,11 @@ class TaskRunner(
|
|
|
}
|
|
|
|
|
|
suspend fun reset() {
|
|
|
+ val context = getContext()
|
|
|
+ val dir = ContextCompat.getExternalCacheDirs(context)[0]
|
|
|
+ val pifPath = File(dir, "pif1.json").path
|
|
|
+ Utils.copyAsset(context.assets, "pif1.json", pifPath)
|
|
|
+ shellRun("cp $pifPath /data/adb/pif.json")
|
|
|
if (isOldVersion(context)) {
|
|
|
withTimeout(1.hours) {
|
|
|
while (true) {
|
|
|
@@ -371,6 +379,7 @@ class TaskRunner(
|
|
|
}
|
|
|
}
|
|
|
appStateRepo.updateRuntimeFlags(reqState = ReqState.NONE)
|
|
|
+ shellRun("rm /data/adb/pif.json")
|
|
|
}
|
|
|
|
|
|
private suspend fun requestNumberAtomic(store: Boolean? = false) {
|
|
|
@@ -490,11 +499,8 @@ class TaskRunner(
|
|
|
} else {
|
|
|
RcsNumberApi.notifyConfigured(rcsNumber.id)
|
|
|
delay(4000)
|
|
|
- var (pid, _) = shellRun("pidof com.google.android.gms.unstable")
|
|
|
- pid = pid.trim()
|
|
|
- Log.e(TAG, "kill gms.unstable $pid")
|
|
|
shellRun(
|
|
|
- "kill -9 $pid",
|
|
|
+ PACKAGE_GMS.kill(),
|
|
|
"sleep 2",
|
|
|
PACKAGE_MESSAGING.kill(),
|
|
|
"sleep 1",
|