|
|
@@ -1,7 +1,6 @@
|
|
|
package com.example.modifier.service
|
|
|
|
|
|
import android.content.Context
|
|
|
-import android.os.Build
|
|
|
import android.os.Environment
|
|
|
import android.util.Log
|
|
|
import android.view.accessibility.AccessibilityNodeInfo
|
|
|
@@ -14,7 +13,6 @@ import com.example.modifier.constants.CMD_BACK
|
|
|
import com.example.modifier.constants.CMD_CONVERSATION_LIST_ACTIVITY
|
|
|
import com.example.modifier.constants.CMD_MESSAGING_APP
|
|
|
import com.example.modifier.constants.CMD_RCS_SETTINGS_ACTIVITY
|
|
|
-import com.example.modifier.constants.PACKAGE_CLEAN_SMS
|
|
|
import com.example.modifier.constants.PACKAGE_GMS
|
|
|
import com.example.modifier.constants.PACKAGE_MESSAGING
|
|
|
import com.example.modifier.enums.RcsConfigureState
|
|
|
@@ -31,7 +29,6 @@ import com.example.modifier.http.ktorClient
|
|
|
import com.example.modifier.http.response.SysConfigResponse
|
|
|
import com.example.modifier.model.InstallApkAction
|
|
|
import com.example.modifier.model.RunScriptAction
|
|
|
-import com.example.modifier.model.SpoofedInfo
|
|
|
import com.example.modifier.model.TaskAction
|
|
|
import com.example.modifier.model.TaskConfig
|
|
|
import com.example.modifier.model.TaskExecutionResult
|
|
|
@@ -47,7 +44,6 @@ import com.example.modifier.utils.genICCID
|
|
|
import com.example.modifier.utils.genIMEI
|
|
|
import com.example.modifier.utils.genIMSI
|
|
|
import com.example.modifier.utils.genMacAddress
|
|
|
-import com.example.modifier.utils.genSerialNo
|
|
|
import com.example.modifier.utils.getContext
|
|
|
import com.example.modifier.utils.isOldVersion
|
|
|
import com.example.modifier.utils.resetAll
|
|
|
@@ -173,7 +169,7 @@ class TaskRunner(
|
|
|
)
|
|
|
Log.i(
|
|
|
TAG,
|
|
|
- "executedNum: ${appStateRepo.appState.value.executedNum}, successNum: ${appStateRepo.appState.value.successNum}"
|
|
|
+ "executedNum: ${appStateRepo.appState.value.singleExecuted}, successNum: ${appStateRepo.appState.value.singleSuccess}"
|
|
|
)
|
|
|
delay(2000)
|
|
|
return success
|
|
|
@@ -183,6 +179,22 @@ class TaskRunner(
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
+ suspend fun groupSend(
|
|
|
+ to: Array<String>,
|
|
|
+ body: String?,
|
|
|
+ img: String?,
|
|
|
+ taskConfig: TaskConfig
|
|
|
+ ): Boolean {
|
|
|
+ if (img?.isNotBlank() == true) return false
|
|
|
+ if (!screenController.createGroup(to)) {
|
|
|
+ appStateRepo.incrementGroupExecutedNum(1, false)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ val res = TraverseResult()
|
|
|
+
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
suspend fun runTask(
|
|
|
taskAction: TaskAction,
|
|
|
onSuccess: (List<TaskExecutionResult>) -> Unit,
|
|
|
@@ -199,7 +211,7 @@ class TaskRunner(
|
|
|
requestMode = if (taskAction.data.config.useBackup) 2 else 1
|
|
|
|
|
|
if (!spoofedInfoRepo.spoofedInfo.value.available ||
|
|
|
- (taskAction.data.config.checkConnection && appStateRepo.appState.value.executedNum == 0)
|
|
|
+ (taskAction.data.config.checkConnection && appStateRepo.appState.value.singleExecuted == 0)
|
|
|
) {
|
|
|
appStateRepo.updateRuntimeFlags(checkingConnection = true)
|
|
|
if (!spoofedInfoRepo.spoofedInfo.value.available || !checkRcsA10y()) {
|
|
|
@@ -234,10 +246,10 @@ class TaskRunner(
|
|
|
shellRun(CMD_BACK)
|
|
|
delay(5000)
|
|
|
onSuccess(results)
|
|
|
- if (taskConfig.singleQty in 1..appStateRepo.appState.value.successNum) {
|
|
|
+ if (taskConfig.singleQty in 1..appStateRepo.appState.value.singleSuccess) {
|
|
|
delay(3000)
|
|
|
requestNumberOnTask()
|
|
|
- } else if (taskConfig.cleanCount in 1..appStateRepo.appState.value.executedNum && !appPrefsRepo.appPrefs.value.preventClean) {
|
|
|
+ } else if (taskConfig.cleanCount in 1..appStateRepo.appState.value.singleExecuted && !appPrefsRepo.appPrefs.value.preventClean) {
|
|
|
delay(3000)
|
|
|
clearConv();
|
|
|
shellRun(CMD_MESSAGING_APP)
|
|
|
@@ -555,7 +567,7 @@ class TaskRunner(
|
|
|
if (spoofedInfoRepo.spoofedInfo.value.available) {
|
|
|
backupRepository.backup(
|
|
|
type = "auto",
|
|
|
- sendCount = appStateRepo.appState.value.successNum
|
|
|
+ sendCount = appStateRepo.appState.value.singleSuccess
|
|
|
)
|
|
|
}
|
|
|
|
|
|
@@ -782,11 +794,11 @@ class TaskRunner(
|
|
|
storeNumberJob = CoroutineScope(coroutineContext).launch {
|
|
|
try {
|
|
|
appStateRepo.updateRuntimeFlags(storing = true)
|
|
|
- if (spoofedInfoRepo.spoofedInfo.value.available && appStateRepo.appState.value.successNum <= 5) {
|
|
|
+ if (spoofedInfoRepo.spoofedInfo.value.available && appStateRepo.appState.value.singleSuccess <= 5) {
|
|
|
screenController.toggleRcsSwitch(false)
|
|
|
backupRepository.backup(
|
|
|
type = "auto",
|
|
|
- sendCount = appStateRepo.appState.value.successNum,
|
|
|
+ sendCount = appStateRepo.appState.value.singleSuccess,
|
|
|
stock = 1
|
|
|
)
|
|
|
screenController.toggleRcsSwitch(true)
|