xiongzhu 10 mesi fa
parent
commit
077a09e894

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

@@ -167,6 +167,37 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
             it[PreferencesKeys.BSSID] = spoofedSimInfo.bssid
         }
         try {
+            val jsonObject = JSONObject().apply {
+                put("mcc", spoofedSimInfo.mcc)
+                put("mnc", spoofedSimInfo.mnc)
+                put("iccid", spoofedSimInfo.iccid)
+                put("imsi", spoofedSimInfo.imsi)
+                put("imei", spoofedSimInfo.imei)
+                put("number", spoofedSimInfo.number)
+                put("country", spoofedSimInfo.country)
+                put("carrierId", spoofedSimInfo.carrierId)
+                put("carrierName", spoofedSimInfo.carrierName)
+                put("serialNo", spoofedSimInfo.serialNo)
+                put("mac", spoofedSimInfo.mac)
+                put("bssid", spoofedSimInfo.bssid)
+            }
+            runCatching {
+                val jsonFile = File.createTempFile(
+                    "temp",
+                    ".json",
+                    getContext().externalCacheDir
+                )
+                FileUtils.writeStringToFile(jsonFile, jsonObject.toString(), Charsets.UTF_8)
+                shellRun(
+                    "cp ${jsonFile.absolutePath} /sdcard/Android/data/com.android.phone/files/config/config.json",
+                    "chown radio /sdcard/Android/data/com.android.phone/files/config/config.json",
+                    "cp ${jsonFile.absolutePath} /data/system/config.json",
+                    "chown system /data/system/config.json"
+                )
+                jsonFile.delete()
+            }.onFailure {
+                Log.e(TAG, "Error updateSpoofedSimInfo: ${it.message}", it)
+            }
             if (ROOT_ACCESS && false) {
                 if (suspend == true) {
                     shellRun(
@@ -301,38 +332,7 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
                 }
             }
 
-            val jsonObject = JSONObject().apply {
-                put("mcc", spoofedSimInfo.mcc)
-                put("mnc", spoofedSimInfo.mnc)
-                put("iccid", spoofedSimInfo.iccid)
-                put("imsi", spoofedSimInfo.imsi)
-                put("imei", spoofedSimInfo.imei)
-                put("number", spoofedSimInfo.number)
-                put("country", spoofedSimInfo.country)
-                put("carrierId", spoofedSimInfo.carrierId)
-                put("carrierName", spoofedSimInfo.carrierName)
-                put("serialNo", spoofedSimInfo.serialNo)
-                put("mac", spoofedSimInfo.mac)
-                put("bssid", spoofedSimInfo.bssid)
-            }
 
-            runCatching {
-                val jsonFile = File.createTempFile(
-                    "temp",
-                    ".json",
-                    getContext().externalCacheDir
-                )
-                FileUtils.writeStringToFile(jsonFile, jsonObject.toString(), Charsets.UTF_8)
-                shellRun(
-                    "cp ${jsonFile.absolutePath} /sdcard/Android/data/com.android.phone/files/config/config.json",
-                    "chown radio /sdcard/Android/data/com.android.phone/files/config/config.json",
-                    "cp ${jsonFile.absolutePath} /data/system/config.json",
-                    "chown system /data/system/config.json"
-                )
-                jsonFile.delete()
-            }.onFailure {
-                Log.e(TAG, "Error updateSpoofedSimInfo: ${it.message}", it)
-            }
 //            val base64 = Base64.encode(jsonObject.toString().toByteArray(), Base64.DEFAULT)
 //                .toString(Charsets.UTF_8)
 //            shellRun("echo '$base64' > /sdcard/Android/data/com.android.phone/files/config/config.json")

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

@@ -25,7 +25,7 @@ import java.io.File
 import java.io.FileOutputStream
 
 fun injectOTP(otp: String) {
-    if (ROOT_ACCESS) {
+    if (ROOT_ACCESS && false) {
         val intent = Intent()
         intent.setAction("com.example.modifier.sms")
         intent.putExtra("sender", "3538")