xiongzhu 10 месяцев назад
Родитель
Сommit
2016ff3545
1 измененных файлов с 13 добавлено и 0 удалено
  1. 13 0
      app/src/main/java/com/example/modifier/repo/SpoofedSimInfoRepo.kt

+ 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.MutableStateFlow
 import kotlinx.coroutines.flow.map
 import kotlinx.coroutines.flow.map
 import kotlinx.coroutines.launch
 import kotlinx.coroutines.launch
+import kotlinx.serialization.encodeToString
+import kotlinx.serialization.json.Json
 import org.json.JSONObject
 import org.json.JSONObject
+import java.net.Socket
 
 
 val Context.simInfoDataStore by preferencesDataStore(name = "${BuildConfig.APPLICATION_ID}.simInfo")
 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
             it[PreferencesKeys.BSSID] = spoofedSimInfo.bssid
         }
         }
         try {
         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 (ROOT_ACCESS) {
                 if (suspend == true) {
                 if (suspend == true) {
                     shellRun(
                     shellRun(