xiongzhu 10 месяцев назад
Родитель
Сommit
8a38105438

+ 4 - 4
app/src/main/java/com/example/modifier/Frida.kt

@@ -16,7 +16,7 @@ import java.util.Base64
 
 class Frida {
 
-    companion object {
+    companion object { 
         var p: Process? = null
         var script: File? = null
 
@@ -30,7 +30,7 @@ class Frida {
                 script = null
             }
 
-            val context = getContext()
+            val context = getContext() 
             val dataDir = ContextCompat.getDataDir(context)
             Utils.copyAssetFolder(context.assets, "bin", File(dataDir, "bin").path)
             val binPath = File(dataDir, "bin/frida-inject-16.3.3-android-arm64").path
@@ -83,7 +83,7 @@ class Frida {
                     }
                 }
             }
-        }
+        } 
 
         fun stop() {
             if (p != null) {
@@ -91,7 +91,7 @@ class Frida {
                 p!!.errorStream.close()
                 p!!.destroy()
                 p = null
-            }
+            } 
             if (script != null) {
                 script!!.delete()
                 script = null

+ 1 - 1
app/src/main/java/com/example/modifier/MainActivity2.kt

@@ -9,7 +9,7 @@ import androidx.core.view.WindowInsetsCompat
 class MainActivity2 : AppCompatActivity() {
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
-        enableEdgeToEdge()
+         enableEdgeToEdge()
         setContentView(R.layout.activity_main2)
         ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
             val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())

+ 8 - 3
app/src/main/java/com/example/modifier/model/TaskAction.kt

@@ -23,10 +23,15 @@ class TaskData(val config: TaskConfig, val taskId: Int, val tasks: Array<TaskIte
 
 @Serializable
 class TaskConfig(
-    val rcsWait: Long,
-    val rcsInterval: Long,
+    val singleQty: Int,
+    val singleTimeout: Long,
+    val singleDelay: Long,
+    val groupMode: Boolean,
+    val groupQty: Int,
+    val groupTimeout: Long,
+    val groupDelay: Long,
+    val groupSize: Int,
     val cleanCount: Int,
-    val requestNumberInterval: Long,
     val checkConnection: Boolean,
     val useBackup: Boolean,
     val e2ee: Int = 0,

+ 1 - 1
app/src/main/java/com/example/modifier/service/ModifierService.kt

@@ -276,7 +276,7 @@ class ModifierService : AccessibilityService() {
         layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT
         layoutParams.x = 0
         layoutParams.y = 800
-        layoutParams.gravity = Gravity.START or Gravity.TOP
+        layoutParams.gravity = Gravity.START or Gravity.TOP 
 
         uiContext = DynamicColors.wrapContextIfAvailable(applicationContext, R.style.AppTheme)
         val inflater = LayoutInflater.from(uiContext)

+ 4 - 5
app/src/main/java/com/example/modifier/service/TaskRunner.kt

@@ -124,7 +124,7 @@ class TaskRunner(
             delay(1000)
             var success = false
             var traverseResult = TraverseResult()
-            withTimeoutOrNull(taskConfig.rcsWait) {
+            withTimeoutOrNull(taskConfig.singleTimeout) {
                 repeat(999) {
                     traverseResult = TraverseResult()
                     screenInspector.traverseNode(traverseResult)
@@ -155,9 +155,9 @@ class TaskRunner(
                     Log.i(TAG, "Clicking send button")
 
                     val dt = System.currentTimeMillis() - lastSend
-                    if (taskConfig.rcsInterval > 0 && dt < taskConfig.rcsInterval) {
+                    if (taskConfig.singleDelay > 0 && dt < taskConfig.singleDelay) {
                         Log.i(TAG, "Waiting for RCS interval")
-                        delay(taskConfig.rcsInterval - dt)
+                        delay(taskConfig.singleDelay - dt)
                     }
                     traverseResult.sendBtn!!.performAction(AccessibilityNodeInfo.ACTION_CLICK)
                     lastSend = System.currentTimeMillis()
@@ -234,7 +234,7 @@ class TaskRunner(
             shellRun(CMD_BACK)
             delay(5000)
             onSuccess(results)
-            if (taskConfig.requestNumberInterval in 1..appStateRepo.appState.value.successNum) {
+            if (taskConfig.singleQty in 1..appStateRepo.appState.value.successNum) {
                 delay(3000)
                 requestNumberOnTask()
             } else if (taskConfig.cleanCount in 1..appStateRepo.appState.value.executedNum && !appPrefsRepo.appPrefs.value.preventClean) {
@@ -445,7 +445,6 @@ class TaskRunner(
                 gmsAid = genAndroidId(),
                 rootAid = genAndroidId(),
             )
-
         )
         val tosAgreeJob = CoroutineScope(coroutineContext).launch {
             run tos@{