xiongzhu 10 сар өмнө
parent
commit
8e540e09a0

BIN
app/src/main/assets/cleanSms.apk


+ 18 - 45
app/src/main/java/com/example/modifier/repo/SpoofedSimInfoRepo.kt

@@ -198,43 +198,17 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
             }.onFailure {
                 Log.e(TAG, "Error updateSpoofedSimInfo: ${it.message}", it)
             }
-            if (ROOT_ACCESS && false) {
-                if (suspend == true) {
-                    shellRun(
-                        PACKAGE_GMS.kill(),
-                        PACKAGE_MESSAGING.kill(),
-                    )
-                }
-                val context = getContext()
-                val subscriptionManager: SubscriptionManager =
-                    context.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE) as SubscriptionManager
-
-                if (hasPermission(Manifest.permission.READ_PHONE_STATE)) {
-                    val simCount = subscriptionManager.activeSubscriptionInfoCountMax
-                    for (i in 0 until simCount) {
-                        val info = subscriptionManager.getActiveSubscriptionInfoForSimSlotIndex(i)
-                        if (info != null) {
-                            val mcc = info.mccString
-                            val mnc = info.mncString
-                            Log.i(TAG, "mccmnc spoofed: $mcc$mnc")
-                        }
-                    }
-                }
-                if (suspend == true) {
-                    shellRun(
-                        PACKAGE_GMS.kill(),
-                        PACKAGE_MESSAGING.kill()
-                    )
-                }
-
-            } else {
-                if (suspend == true) {
-                    shellRun(
-                        PACKAGE_GMS.kill(),
-                        PACKAGE_MESSAGING.kill()
-                    )
-                }
+            if (suspend == true) {
+                shellRun(
+                    PACKAGE_GMS.kill(),
+                    PACKAGE_MESSAGING.kill(),
+                )
+            }
+            val context = getContext()
+            val subscriptionManager: SubscriptionManager =
+                context.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE) as SubscriptionManager
 
+            runCatching {
                 val plmn = spoofedSimInfo.mcc + spoofedSimInfo.mnc
                 val plmnHex = SimEncoder.encPLMN(spoofedSimInfo.mcc + spoofedSimInfo.mnc)
                 val plmnwactHex = SimEncoder.encPLMNwAcT("$plmn:4000,$plmn:8000,$plmn:0080")
@@ -321,17 +295,16 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
                         delay(2000)
                     }
                 }
-
-                if (suspend == true) {
-                    shellRun(
-                        PACKAGE_GMS.kill(),
-                        "sleep 3",
-                        PACKAGE_MESSAGING.kill(),
-                        "sleep 3"
-                    )
-                }
             }
 
+            if (suspend == true) {
+                shellRun(
+                    PACKAGE_GMS.kill(),
+                    "sleep 3",
+                    PACKAGE_MESSAGING.kill(),
+                    "sleep 3"
+                )
+            }
 
 //            val base64 = Base64.encode(jsonObject.toString().toByteArray(), Base64.DEFAULT)
 //                .toString(Charsets.UTF_8)