xiongzhu 10 miesięcy temu
rodzic
commit
2016ff3545

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

@@ -43,7 +43,10 @@ import kotlinx.coroutines.delay
 import kotlinx.coroutines.flow.MutableStateFlow
 import kotlinx.coroutines.flow.map
 import kotlinx.coroutines.launch
+import kotlinx.serialization.encodeToString
+import kotlinx.serialization.json.Json
 import org.json.JSONObject
+import java.net.Socket
 
 val Context.simInfoDataStore by preferencesDataStore(name = "${BuildConfig.APPLICATION_ID}.simInfo")
 
@@ -159,6 +162,16 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
             it[PreferencesKeys.BSSID] = spoofedSimInfo.bssid
         }
         try {
+            runCatching {
+                val client = Socket("127.0.0.1", 23946)
+                client.outputStream.write(Json.encodeToString(spoofedSimInfo).toByteArray())
+                client.close()
+            }
+            runCatching {
+                val client = Socket("127.0.0.1", 23947)
+                client.outputStream.write(Json.encodeToString(spoofedSimInfo).toByteArray())
+                client.close()
+            }
             if (ROOT_ACCESS) {
                 if (suspend == true) {
                     shellRun(