xiongzhu 1 år sedan
förälder
incheckning
51c62f4f12

+ 7 - 0
app/src/main/assets/pif1.json

@@ -0,0 +1,7 @@
+{
+  "FINGERPRINT": "google/oriole_beta/oriole:15/BP11.241121.010/12780007:user/release-keys",
+  "MANUFACTURER": "Google",
+  "MODEL": "Pixel 6",
+  "SECURITY_PATCH": "2024-12-05",
+  "DEVICE_INITIAL_SDK_INT": 33
+}

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

@@ -43,11 +43,7 @@ class ScreenInspector(val context: AccessibilityService) {
             result.sendBtn = node
         }
 
-        if (text.contains("RCS 聊天")
-            || text.contains("聊天对话")
-            || text.contains("RCS chat")
-            || text.contains("Chat with")
-        ) {
+        if (text.contains("RCS 聊天") || text.contains("RCS chat")) {
             result.isRcsCapable = true
         }
 
@@ -89,6 +85,10 @@ class ScreenInspector(val context: AccessibilityService) {
             }
         }
 
+        if (text.contains("Send Message") || desc.contains("发送信息")) {
+            result.isRcsCapable = true
+        }
+
         if (text.contains("end-to-end encrypted")
             || desc.contains("Send encrypted message")
             || text.contains("已经过端到端加密")

+ 13 - 0
app/src/main/java/com/example/modifier/utils/Package.kt

@@ -1,5 +1,7 @@
 package com.example.modifier.utils
 
+import androidx.core.content.ContextCompat
+import com.example.modifier.Utils
 import com.example.modifier.constants.CMD_HOME
 import com.example.modifier.constants.CMD_MESSAGING_APP
 import com.example.modifier.constants.CMD_START_PLAY_STORE
@@ -10,7 +12,13 @@ import com.example.modifier.extension.clear
 import com.example.modifier.extension.kill
 import com.example.modifier.extension.resume
 import com.example.modifier.extension.suspend
+import com.example.modifier.http.api.SysConfigApi
+import com.example.modifier.http.ktorClient
+import com.example.modifier.http.response.SysConfigResponse
+import io.ktor.client.call.body
+import io.ktor.client.plugins.resources.get
 import kotlinx.coroutines.delay
+import java.io.File
 
 suspend fun suspendPackage(vararg packages: String) {
     packages.forEach {
@@ -88,9 +96,14 @@ suspend fun clear(gsf: Boolean, gms: Boolean, sms: Boolean) {
 }
 
 suspend fun resetAll() {
+    val context = getContext()
+    val dir = ContextCompat.getExternalCacheDirs(context)[0]
+    val pifPath = File(dir, "pif1.json").path
+    Utils.copyAsset(context.assets, "pif1.json", pifPath)
     try {
         clearConv()
         shellRun(
+            "cp $pifPath /data/adb/pif.json",
             PACKAGE_MESSAGING.suspend(),
             PACKAGE_MESSAGING.kill(),
             PACKAGE_MESSAGING.clear(),