xiongzhu 10 månader sedan
förälder
incheckning
594db32161

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


+ 3 - 1
app/src/main/java/com/example/modifier/model/SpoofedSimInfo.kt

@@ -17,6 +17,8 @@ data class SpoofedSimInfo(
     var carrierId: String,
     var carrierName: String,
     var serialNo: String,
-    val mac: String,
+    val wifiMac: String,
     val bssid: String,
+    val btMac: String,
+    val ethMac: String,
 )

+ 9 - 7
app/src/main/java/com/example/modifier/repo/BackupRepository.kt

@@ -47,7 +47,7 @@ class BackupRepository(
     suspend fun backup(type: String, sendCount: Int, stock: Int = 0): BackupItem? {
         if (!ROOT_ACCESS) return null
         AppStateRepo.instance.updateRuntimeFlags(reqState = ReqState.BACKUP)
-        val spoofedSimInfoRepo = SpoofedSimInfoRepo.instance
+        val spoofedInfoRepo = SpoofedInfoRepo.instance
         clearConv()
         delay(3000)
 //        ModifierService.instance!!.toggleRcsSwitch(false)
@@ -89,7 +89,7 @@ class BackupRepository(
 
         shellRun(*cmds.toTypedArray())
 
-        val spoofedSimInfo = spoofedSimInfoRepo.spoofedSimInfo.value
+        val spoofedSimInfo = spoofedInfoRepo.spoofedSimInfo.value
         val backup = BackupItem(
             createdAt = Date().time,
             numberId = spoofedSimInfo.numberId,
@@ -124,7 +124,7 @@ class BackupRepository(
 
     @SuppressLint("SdCardPath")
     suspend fun restore(backup: BackupItem): Boolean {
-        val spoofedSimInfoRepo = SpoofedSimInfoRepo.instance
+        val spoofedInfoRepo = SpoofedInfoRepo.instance
         val simInfo = SpoofedSimInfo(
             numberId = backup.numberId,
             number = backup.number,
@@ -139,10 +139,12 @@ class BackupRepository(
             carrierId = backup.carrierId,
             carrierName = backup.carrierName,
             serialNo = genSerialNo(),
-            mac = genMacAddress(),
-            bssid = genMacAddress()
+            wifiMac = genMacAddress(),
+            bssid = genMacAddress(),
+            btMac = genMacAddress(),
+            ethMac = genMacAddress()
         )
-        spoofedSimInfoRepo.updateSpoofedSimInfo(spoofedSimInfo = simInfo, suspend = false)
+        spoofedInfoRepo.updateSpoofedSimInfo(spoofedSimInfo = simInfo, suspend = false)
         val packages = mutableListOf(
             PACKAGE_MESSAGING,
             PACKAGE_GMS,
@@ -258,7 +260,7 @@ class BackupRepository(
 
         if (success) {
             Log.i(TAG, "restore: success")
-            spoofedSimInfoRepo.updateAvailable(available = true)
+            spoofedInfoRepo.updateAvailable(available = true)
             if (backup.stock == 1) {
                 backup.stock = 2
                 dao.update(backup)

+ 2 - 5
app/src/main/java/com/example/modifier/repo/SimInfoProvider.kt

@@ -6,11 +6,8 @@ import android.content.Context
 import android.database.Cursor
 import android.database.MatrixCursor
 import android.net.Uri
-import androidx.datastore.preferences.core.stringPreferencesKey
 import androidx.datastore.preferences.preferencesDataStore
 import com.example.modifier.BuildConfig
-import kotlinx.coroutines.flow.first
-import kotlinx.coroutines.flow.firstOrNull
 import kotlinx.coroutines.runBlocking
 
 class SimInfoProvider : ContentProvider() {
@@ -54,7 +51,7 @@ class SimInfoProvider : ContentProvider() {
             )
         );
         runBlocking {
-            val simInfo = SpoofedSimInfoRepo.instance.spoofedSimInfo.value
+            val simInfo = SpoofedInfoRepo.instance.spoofedSimInfo.value
             if (simInfo != null) {
                 matrixCursor.addRow(
                     arrayOf(
@@ -69,7 +66,7 @@ class SimInfoProvider : ContentProvider() {
                         simInfo.carrierName,
                         "upi-carrier-id-with-mo-sms-relax",
                         simInfo.serialNo,
-                        simInfo.mac,
+                        simInfo.wifiMac,
                         simInfo.bssid
                     )
                 )

+ 34 - 48
app/src/main/java/com/example/modifier/repo/SpoofedSimInfoRepo.kt → app/src/main/java/com/example/modifier/repo/SpoofedInfoRepo.kt

@@ -1,18 +1,10 @@
 package com.example.modifier.repo
 
-import android.Manifest
 import android.annotation.SuppressLint
-import android.content.ContentProvider
-import android.content.ContentValues
 import android.content.Context
-import android.database.Cursor
-import android.database.MatrixCursor
-import android.net.Uri
 import android.os.Build
-import android.os.Environment
 import android.telephony.SubscriptionManager
 import android.telephony.TelephonyManager
-import android.util.Base64
 import android.util.Log
 import androidx.datastore.preferences.core.booleanPreferencesKey
 import androidx.datastore.preferences.core.edit
@@ -35,10 +27,8 @@ import com.example.modifier.utils.genIMSI
 import com.example.modifier.utils.genMacAddress
 import com.example.modifier.utils.genSerialNo
 import com.example.modifier.utils.getContext
-import com.example.modifier.utils.hasPermission
 import com.example.modifier.utils.isOldVersion
 import com.example.modifier.utils.shellRun
-import com.google.gson.Gson
 import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.delay
@@ -50,16 +40,14 @@ import kotlinx.serialization.json.Json
 import org.apache.commons.io.FileUtils
 import org.json.JSONObject
 import java.io.File
-import java.net.Socket
-import java.nio.file.Files
 
 val Context.simInfoDataStore by preferencesDataStore(name = "${BuildConfig.APPLICATION_ID}.simInfo")
 
-class SpoofedSimInfoRepo private constructor(private val context: Context) {
+class SpoofedInfoRepo private constructor(private val context: Context) {
 
     companion object {
         private const val TAG = "$baseTag/SpoofedSimInfoRepository"
-        val instance by lazy(LazyThreadSafetyMode.SYNCHRONIZED) { SpoofedSimInfoRepo(getContext()) }
+        val instance by lazy(LazyThreadSafetyMode.SYNCHRONIZED) { SpoofedInfoRepo(getContext()) }
     }
 
     public object PreferencesKeys {
@@ -76,8 +64,10 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
         val CARRIER_ID = stringPreferencesKey("carrier_id")
         val CARRIER_NAME = stringPreferencesKey("carrier_name")
         val SERIAL_NO = stringPreferencesKey("serial_no")
-        val MAC = stringPreferencesKey("mac")
+        val WIFI_MAC = stringPreferencesKey("wifi_mac")
         val BSSID = stringPreferencesKey("bssid")
+        val BT_MAC = stringPreferencesKey("bt_mac")
+        val ETH_MAC = stringPreferencesKey("eth_mac")
     }
 
     private val simInfoFlow = context.simInfoDataStore.data.map {
@@ -94,8 +84,10 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
         val carrierId = it[PreferencesKeys.CARRIER_ID] ?: ""
         val carrierName = it[PreferencesKeys.CARRIER_NAME] ?: ""
         val serialNo = it[PreferencesKeys.SERIAL_NO] ?: ""
-        val mac = it[PreferencesKeys.MAC] ?: ""
+        val wifiMac = it[PreferencesKeys.WIFI_MAC] ?: ""
         val bssid = it[PreferencesKeys.BSSID] ?: ""
+        val btMac = it[PreferencesKeys.BT_MAC] ?: ""
+        val ethMac = it[PreferencesKeys.ETH_MAC] ?: ""
         SpoofedSimInfo(
             numberId = numberId,
             number = number,
@@ -110,8 +102,10 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
             carrierId = carrierId,
             carrierName = carrierName,
             serialNo = serialNo,
-            mac = mac,
-            bssid = bssid
+            wifiMac = wifiMac,
+            bssid = bssid,
+            btMac = btMac,
+            ethMac = ethMac
         )
     }
 
@@ -130,8 +124,10 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
             carrierId = "",
             carrierName = "",
             serialNo = "",
-            mac = "",
+            wifiMac = "",
             bssid = "",
+            btMac = "",
+            ethMac = ""
         )
     )
 
@@ -163,36 +159,24 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
             it[PreferencesKeys.CARRIER_ID] = spoofedSimInfo.carrierId
             it[PreferencesKeys.CARRIER_NAME] = spoofedSimInfo.carrierName
             it[PreferencesKeys.SERIAL_NO] = spoofedSimInfo.serialNo
-            it[PreferencesKeys.MAC] = spoofedSimInfo.mac
+            it[PreferencesKeys.WIFI_MAC] = spoofedSimInfo.wifiMac
             it[PreferencesKeys.BSSID] = spoofedSimInfo.bssid
+            it[PreferencesKeys.BT_MAC] = spoofedSimInfo.btMac
+            it[PreferencesKeys.ETH_MAC] = spoofedSimInfo.ethMac
         }
         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
+                    "temp", ".json", getContext().externalCacheDir
+                )
+                FileUtils.writeStringToFile(
+                    jsonFile,
+                    Json.encodeToString(spoofedSimInfo),
+                    Charsets.UTF_8
                 )
-                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"
+                    "cat ${jsonFile.absolutePath} > /data/user_de/0/com.android.phone/files/config.json",
+                    "cat ${jsonFile.absolutePath} > /data/system/config.json",
                 )
                 jsonFile.delete()
             }.onFailure {
@@ -205,8 +189,6 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
                 )
             }
             val context = getContext()
-            val subscriptionManager: SubscriptionManager =
-                context.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE) as SubscriptionManager
 
             runCatching {
                 val plmn = spoofedSimInfo.mcc + spoofedSimInfo.mnc
@@ -347,8 +329,10 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
                             carrierId = "1779",
                             carrierName = "Cricket Wireless",
                             serialNo = genSerialNo(),
-                            mac = genMacAddress(),
-                            bssid = genMacAddress()
+                            wifiMac = genMacAddress(),
+                            bssid = genMacAddress(),
+                            btMac = genMacAddress(),
+                            ethMac = genMacAddress()
                         ),
                         suspend = false
                     )
@@ -377,8 +361,10 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
                             carrierId = "1",
                             carrierName = "T-Mobile",
                             serialNo = genSerialNo(),
-                            mac = genMacAddress(),
-                            bssid = genMacAddress()
+                            wifiMac = genMacAddress(),
+                            bssid = genMacAddress(),
+                            btMac = genMacAddress(),
+                            ethMac = genMacAddress()
                         )
                     )
                 }

+ 4 - 11
app/src/main/java/com/example/modifier/service/ModifierService.kt

@@ -3,13 +3,8 @@ package com.example.modifier.service
 import android.accessibilityservice.AccessibilityService
 import android.annotation.SuppressLint
 import android.content.Context
-import android.content.Intent
 import android.graphics.PixelFormat
-import android.net.Uri
 import android.os.Build
-import android.provider.Settings
-import android.text.SpannableString
-import android.text.SpannableStringBuilder
 import android.util.DisplayMetrics
 import android.util.Log
 import android.view.Gravity
@@ -21,7 +16,6 @@ import android.view.View.OnTouchListener
 import android.view.View.VISIBLE
 import android.view.WindowManager
 import android.view.accessibility.AccessibilityEvent
-import android.view.accessibility.AccessibilityNodeInfo
 import android.widget.CompoundButton
 import android.widget.FrameLayout
 import androidx.annotation.MenuRes
@@ -39,7 +33,7 @@ import com.example.modifier.repo.AppPrefsRepo
 import com.example.modifier.repo.AppStateRepo
 import com.example.modifier.repo.BackupRepository
 import com.example.modifier.repo.GmsgStateRepo
-import com.example.modifier.repo.SpoofedSimInfoRepo
+import com.example.modifier.repo.SpoofedInfoRepo
 import com.example.modifier.utils.ROOT_ACCESS
 import com.example.modifier.utils.checkPif
 import com.example.modifier.utils.clearConv
@@ -49,7 +43,6 @@ import com.example.modifier.utils.killPhoneProcess
 import com.example.modifier.utils.optimize
 import com.example.modifier.utils.restartSelf
 import com.example.modifier.utils.setBatteryLevel
-import com.example.modifier.utils.smsIntent
 import com.example.modifier.utils.syncTime
 import com.google.android.material.color.DynamicColors
 import kotlinx.coroutines.CoroutineScope
@@ -85,7 +78,7 @@ class ModifierService : AccessibilityService() {
     private val gmsgStateRepo = GmsgStateRepo.instance
     private val screenInspector by lazy { ScreenInspector(this) }
     private val screenController by lazy { ScreenController(this, screenInspector) }
-    private val spoofedSimInfoRepo = SpoofedSimInfoRepo.instance
+    private val spoofedInfoRepo = SpoofedInfoRepo.instance
     private val backupRepository by lazy { BackupRepository(this, backupItemDao) }
     private lateinit var socketClient: SocketClient
     lateinit var taskRunner: TaskRunner
@@ -118,7 +111,7 @@ class ModifierService : AccessibilityService() {
                 screenController,
                 appStateRepo,
                 appPrefsRepo,
-                spoofedSimInfoRepo,
+                spoofedInfoRepo,
                 gmsgStateRepo,
                 backupRepository,
             )
@@ -207,7 +200,7 @@ class ModifierService : AccessibilityService() {
                 }
             }
             launch {
-                spoofedSimInfoRepo.spoofedSimInfo.collect {
+                spoofedInfoRepo.spoofedSimInfo.collect {
                     withContext(Dispatchers.Main) {
                         binding.tvCountry.text = it.country
                     }

+ 2 - 3
app/src/main/java/com/example/modifier/service/SocketClient.kt

@@ -19,7 +19,7 @@ import com.example.modifier.model.TaskExecutionResult
 import com.example.modifier.model.UpdateDeviceAction
 import com.example.modifier.repo.AppPrefsRepo
 import com.example.modifier.repo.AppStateRepo
-import com.example.modifier.repo.SpoofedSimInfoRepo
+import com.example.modifier.repo.SpoofedInfoRepo
 import com.example.modifier.serializer.Json
 import com.example.modifier.utils.checkPif
 import com.example.modifier.utils.getIPAddress
@@ -31,7 +31,6 @@ import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.delay
 import kotlinx.coroutines.launch
 import kotlinx.serialization.encodeToString
-import org.json.JSONException
 import org.json.JSONObject
 import java.util.Timer
 import kotlin.concurrent.schedule
@@ -291,7 +290,7 @@ class SocketClient(
             val dataObj = JSONObject()
             dataObj.put("canSend", AppStateRepo.instance.appState.value.send)
             dataObj.put("busy", AppStateRepo.instance.appState.value.busy)
-            dataObj.put("currentCountry", SpoofedSimInfoRepo.instance.spoofedSimInfo.value.country)
+            dataObj.put("currentCountry", SpoofedInfoRepo.instance.spoofedSimInfo.value.country)
             dataObj.put("ip", getIPAddress().joinToString(","))
             dataObj.put(
                 "requesting",

+ 22 - 23
app/src/main/java/com/example/modifier/service/TaskRunner.kt

@@ -10,7 +10,6 @@ import coil3.ImageLoader
 import coil3.request.crossfade
 import com.example.modifier.baseTag
 import com.example.modifier.TraverseResult
-import com.example.modifier.Utils
 import com.example.modifier.constants.CMD_BACK
 import com.example.modifier.constants.CMD_CONVERSATION_LIST_ACTIVITY
 import com.example.modifier.constants.CMD_MESSAGING_APP
@@ -40,13 +39,11 @@ import com.example.modifier.repo.AppPrefsRepo
 import com.example.modifier.repo.AppStateRepo
 import com.example.modifier.repo.BackupRepository
 import com.example.modifier.repo.GmsgStateRepo
-import com.example.modifier.repo.SpoofedSimInfoRepo
+import com.example.modifier.repo.SpoofedInfoRepo
 import com.example.modifier.utils.clearConv
 import com.example.modifier.utils.genICCID
-import com.example.modifier.utils.genIMEI
 import com.example.modifier.utils.genIMSI
 import com.example.modifier.utils.genMacAddress
-import com.example.modifier.utils.genSerialNo
 import com.example.modifier.utils.getContext
 import com.example.modifier.utils.isOldVersion
 import com.example.modifier.utils.resetAll
@@ -88,7 +85,7 @@ class TaskRunner(
     val screenController: ScreenController,
     private val appStateRepo: AppStateRepo,
     private val appPrefsRepo: AppPrefsRepo,
-    private val spoofedSimInfoRepo: SpoofedSimInfoRepo,
+    private val spoofedInfoRepo: SpoofedInfoRepo,
     val gmsgStateRepo: GmsgStateRepo,
     private val backupRepository: BackupRepository
 ) {
@@ -197,11 +194,11 @@ class TaskRunner(
             currentTaskId = taskAction.data.taskId
             requestMode = if (taskAction.data.config.useBackup) 2 else 1
 
-            if (!spoofedSimInfoRepo.spoofedSimInfo.value.available ||
+            if (!spoofedInfoRepo.spoofedSimInfo.value.available ||
                 (taskAction.data.config.checkConnection && appStateRepo.appState.value.executedNum == 0)
             ) {
                 appStateRepo.updateRuntimeFlags(checkingConnection = true)
-                if (!spoofedSimInfoRepo.spoofedSimInfo.value.available || !checkRcsA10y()) {
+                if (!spoofedInfoRepo.spoofedSimInfo.value.available || !checkRcsA10y()) {
                     onError(Exception("RCS not available"))
                     requestNumberOnTask()
                     appStateRepo.updateRuntimeFlags(checkingConnection = false)
@@ -216,7 +213,7 @@ class TaskRunner(
                 val taskItem = taskAction.data.tasks[i]
                 val result = TaskExecutionResult(
                     id = taskItem.id,
-                    numberId = spoofedSimInfoRepo.spoofedSimInfo.value.numberId
+                    numberId = spoofedInfoRepo.spoofedSimInfo.value.numberId
                 )
                 results.add(result)
                 try {
@@ -269,7 +266,7 @@ class TaskRunner(
                     delay(100)
                     appStateRepo.updateRuntimeFlags(reqState = ReqState.RESET)
                     gmsgStateRepo.updateRcsState(RcsConfigureState.NOT_CONFIGURED)
-                    spoofedSimInfoRepo.mock()
+                    spoofedInfoRepo.mock()
                     resetAll()
                     var switchAppear = gmsgStateRepo.waitForRcsState(
                         arrayOf(RcsConfigureState.WAITING_FOR_TOS),
@@ -342,7 +339,7 @@ class TaskRunner(
                     delay(100)
                     appStateRepo.updateRuntimeFlags(reqState = ReqState.RESET)
                     gmsgStateRepo.updateRcsState(RcsConfigureState.NOT_CONFIGURED)
-                    spoofedSimInfoRepo.mock()
+                    spoofedInfoRepo.mock()
                     resetAll()
                     var switchAppear = gmsgStateRepo.waitForRcsState(
                         arrayOf(RcsConfigureState.WAITING_FOR_DEFAULT_ON),
@@ -413,7 +410,7 @@ class TaskRunner(
 
         appStateRepo.updateRuntimeFlags(reqState = ReqState.OTP_1)
 
-        spoofedSimInfoRepo.updateSpoofedSimInfo(
+        spoofedInfoRepo.updateSpoofedSimInfo(
             SpoofedSimInfo(
                 numberId = rcsNumber.id,
                 number = rcsNumber.number,
@@ -421,15 +418,17 @@ class TaskRunner(
                 mnc = rcsNumber.mnc,
                 iccid = genICCID(rcsNumber.mnc, rcsNumber.areaCode),
                 imsi = genIMSI(rcsNumber.mcc + rcsNumber.mnc),
-                imei = spoofedSimInfoRepo.spoofedSimInfo.value.imei,
+                imei = spoofedInfoRepo.spoofedSimInfo.value.imei,
                 country = rcsNumber.country,
                 areaCode = rcsNumber.areaCode,
                 available = false,
                 carrierId = rcsNumber.carrierId,
                 carrierName = rcsNumber.carrierName,
-                serialNo = spoofedSimInfoRepo.spoofedSimInfo.value.serialNo,
-                mac = genMacAddress(),
-                bssid = genMacAddress()
+                serialNo = spoofedInfoRepo.spoofedSimInfo.value.serialNo,
+                wifiMac = genMacAddress(),
+                bssid = genMacAddress(),
+                btMac = genMacAddress(),
+                ethMac = genMacAddress(),
             )
         )
 
@@ -541,7 +540,7 @@ class TaskRunner(
         }
         appStateRepo.updateRuntimeFlags(reqState = ReqState.CLEAN)
         clearConv()
-        if (spoofedSimInfoRepo.spoofedSimInfo.value.available) {
+        if (spoofedInfoRepo.spoofedSimInfo.value.available) {
             backupRepository.backup(
                 type = "auto",
                 sendCount = appStateRepo.appState.value.successNum
@@ -555,7 +554,7 @@ class TaskRunner(
                 try {
                     if (requestMode == 2 && !noBackup) {
                         val backup = backupRepository.findBackupForRestore(
-                            spoofedSimInfoRepo.spoofedSimInfo.value.number
+                            spoofedInfoRepo.spoofedSimInfo.value.number
                         )
                         if (backup != null) {
                             AppStateRepo.instance.updateRuntimeFlags(reqState = ReqState.RESTORE)
@@ -568,7 +567,7 @@ class TaskRunner(
                     }
 
                     needRest = needRest || appStateRepo.appState.value.requestedNum >= 3
-                            || spoofedSimInfoRepo.spoofedSimInfo.value.available
+                            || spoofedInfoRepo.spoofedSimInfo.value.available
                     if (needRest && !appPrefsRepo.appPrefs.value.preventReset) {
                         reset()
                         needRest = false
@@ -588,7 +587,7 @@ class TaskRunner(
             false
         }
         if (requestSuccess == true) {
-            spoofedSimInfoRepo.updateAvailable(available = true)
+            spoofedInfoRepo.updateAvailable(available = true)
             appStateRepo.resetSuccessNum()
             appStateRepo.resetExecutedNum()
             Log.i(TAG, "requestNumber success")
@@ -665,7 +664,7 @@ class TaskRunner(
             false
         }
         if (!availability) {
-            RcsNumberApi.notifyWasted(spoofedSimInfoRepo.spoofedSimInfo.value.numberId)
+            RcsNumberApi.notifyWasted(spoofedInfoRepo.spoofedSimInfo.value.numberId)
         }
         return availability
     }
@@ -768,7 +767,7 @@ class TaskRunner(
         storeNumberJob = CoroutineScope(coroutineContext).launch {
             try {
                 appStateRepo.updateRuntimeFlags(storing = true)
-                if (spoofedSimInfoRepo.spoofedSimInfo.value.available && appStateRepo.appState.value.successNum <= 5) {
+                if (spoofedInfoRepo.spoofedSimInfo.value.available && appStateRepo.appState.value.successNum <= 5) {
                     screenController.toggleRcsSwitch(false)
                     backupRepository.backup(
                         type = "auto",
@@ -791,11 +790,11 @@ class TaskRunner(
                             reset()
                         }
                         requestNumberAtomic(store = true)
-                        spoofedSimInfoRepo.updateAvailable(available = true)
+                        spoofedInfoRepo.updateAvailable(available = true)
                         screenController.toggleRcsSwitch(false)
                         backupRepository.backup(type = "auto", sendCount = 0, stock = 1)
                         RcsNumberApi.updateStockFlag(
-                            id = spoofedSimInfoRepo.spoofedSimInfo.value.numberId,
+                            id = spoofedInfoRepo.spoofedSimInfo.value.numberId,
                             flag = 1
                         )
                         success = true

+ 21 - 33
app/src/main/java/com/example/modifier/ui/settings/SettingsFragment.kt

@@ -5,11 +5,6 @@ import android.annotation.SuppressLint
 import android.content.Context
 import android.content.DialogInterface
 import android.content.pm.PackageManager
-import android.net.ConnectivityManager
-import android.net.Network
-import android.net.NetworkCapabilities
-import android.net.NetworkRequest
-import android.net.wifi.WifiInfo
 import android.net.wifi.WifiManager
 import android.net.wifi.WifiManager.ScanResultsCallback
 import android.os.Bundle
@@ -41,9 +36,10 @@ import com.example.modifier.http.request.RcsNumberRequest
 import com.example.modifier.http.response.RcsNumberResponse
 import com.example.modifier.model.SpoofedSimInfo
 import com.example.modifier.repo.AppPrefsRepo
-import com.example.modifier.repo.SpoofedSimInfoRepo
+import com.example.modifier.repo.SpoofedInfoRepo
 import com.example.modifier.utils.genICCID
 import com.example.modifier.utils.genIMEI
+import com.example.modifier.utils.genIMSI
 import com.example.modifier.utils.genMacAddress
 import com.example.modifier.utils.genSerialNo
 import com.google.android.material.dialog.MaterialAlertDialogBuilder
@@ -75,7 +71,7 @@ class SettingsFragment : Fragment() {
     private lateinit var binding: FragmentSettingsBinding
     private lateinit var requestPermissionLauncher: ActivityResultLauncher<Array<String>>
     private val appPrefsRepo = AppPrefsRepo.instance
-    private val spoofedSimInfoRepo = SpoofedSimInfoRepo.instance
+    private val spoofedInfoRepo = SpoofedInfoRepo.instance
 
     init {
         Log.i("SettingsFragment", "SettingsFragment")
@@ -194,35 +190,25 @@ class SettingsFragment : Fragment() {
                         }
                         Log.i(TAG, "response: ${response.bodyAsText()}")
                         val res = response.body<RcsNumberResponse>()
-                        val number = res.number
-                        val mcc = res.mcc
-                        val mnc = res.mnc
-                        val country = res.country
-                        val areaCode = res.areaCode
-                        val iccid = genICCID(mnc, areaCode)
-                        val imsi =
-                            mcc + mnc + RandomStringUtils.randomNumeric(15 - mcc.length - mnc.length)
-                        val imei = genIMEI()
-                        val serialNo = genSerialNo()
-                        val mac = genMacAddress()
-                        val bssid = genMacAddress()
-                        spoofedSimInfoRepo.updateSpoofedSimInfo(
+                        spoofedInfoRepo.updateSpoofedSimInfo(
                             SpoofedSimInfo(
                                 numberId = res.id,
-                                number = number,
-                                mcc = mcc,
-                                mnc = mnc,
-                                iccid = iccid,
-                                imsi = imsi,
-                                imei = imei,
-                                country = country,
-                                areaCode = areaCode,
+                                number = res.number,
+                                mcc = res.mcc,
+                                mnc = res.mnc,
+                                iccid = genICCID(res.mnc, res.areaCode),
+                                imsi = genIMSI(res.mcc + res.mnc),
+                                imei = genIMEI(),
+                                country = res.country,
+                                areaCode = res.areaCode,
                                 available = false,
                                 carrierId = res.carrierId,
                                 carrierName = res.carrierName,
-                                serialNo = serialNo,
-                                mac = mac,
-                                bssid = bssid
+                                serialNo = genSerialNo(),
+                                wifiMac = genMacAddress(),
+                                bssid = genMacAddress(),
+                                btMac = genMacAddress(),
+                                ethMac = genMacAddress()
                             )
                         )
                     }
@@ -376,7 +362,7 @@ class SettingsFragment : Fragment() {
                 }
             }
             launch {
-                spoofedSimInfoRepo.spoofedSimInfo.collect {
+                spoofedInfoRepo.spoofedSimInfo.collect {
                     binding.etNumber.setText(it.number)
                     binding.etMcc.setText(it.mcc)
                     binding.etMnc.setText(it.mnc)
@@ -399,7 +385,7 @@ class SettingsFragment : Fragment() {
         binding.btnSave.isEnabled = false
         lifecycleScope.launch {
             withContext(Dispatchers.IO) {
-                spoofedSimInfoRepo.updateSpoofedSimInfo(
+                spoofedInfoRepo.updateSpoofedSimInfo(
                     spoofedSimInfo = SpoofedSimInfo(
                         0,
                         binding.etNumber.text.toString(),
@@ -415,6 +401,8 @@ class SettingsFragment : Fragment() {
                         binding.etCarrierName.text.toString(),
                         binding.etSerial.text.toString(),
                         genMacAddress(),
+                        genMacAddress(),
+                        genMacAddress(),
                         genMacAddress()
                     ),
                     suspend = true

+ 3 - 11
app/src/main/java/com/example/modifier/ui/utils/UtilsFragment.kt

@@ -10,14 +10,11 @@ import android.view.View
 import android.view.ViewGroup
 import android.widget.Toast
 import androidx.appcompat.app.AlertDialog
-import androidx.core.content.ContextCompat
 import androidx.core.content.FileProvider.getUriForFile
 import androidx.fragment.app.Fragment
 import androidx.lifecycle.lifecycleScope
 import coil3.ImageLoader
-import coil3.request.ImageRequest
 import coil3.request.crossfade
-import coil3.toBitmap
 import com.example.modifier.BuildConfig
 import com.example.modifier.Frida
 import com.example.modifier.R
@@ -26,7 +23,6 @@ import com.example.modifier.baseTag
 import com.example.modifier.constants.PACKAGE_GMS
 import com.example.modifier.constants.PACKAGE_GSF
 import com.example.modifier.constants.PACKAGE_MESSAGING
-import com.example.modifier.data.AppPreferences
 import com.example.modifier.databinding.DialogUpdateBinding
 import com.example.modifier.databinding.FragmentUtilsBinding
 import com.example.modifier.extension.kill
@@ -34,11 +30,8 @@ import com.example.modifier.http.ktorClient
 import com.example.modifier.http.api.SysConfigApi
 import com.example.modifier.http.downloadImage
 import com.example.modifier.http.response.SysConfigResponse
-import com.example.modifier.repo.AppPrefsRepo
 import com.example.modifier.repo.AppStateRepo
-import com.example.modifier.repo.SpoofedSimInfoRepo
-import com.example.modifier.service.TaskRunner
-import com.example.modifier.service.TaskRunner.Companion
+import com.example.modifier.repo.SpoofedInfoRepo
 import com.example.modifier.utils.clear
 import com.example.modifier.utils.clearConv
 import com.example.modifier.utils.killPhoneProcess
@@ -58,7 +51,6 @@ import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.Job
 import kotlinx.coroutines.delay
-import kotlinx.coroutines.flow.StateFlow
 import kotlinx.coroutines.launch
 import kotlinx.coroutines.withContext
 import org.apache.commons.lang3.RandomStringUtils
@@ -71,7 +63,7 @@ class UtilsFragment : Fragment() {
 
     private lateinit var binding: FragmentUtilsBinding
     private val appStateRepo = AppStateRepo.instance
-    private val spoofedSimInfoRepo = SpoofedSimInfoRepo.instance
+    private val spoofedInfoRepo = SpoofedInfoRepo.instance
     private val imageLoader by lazy {
         ImageLoader.Builder(requireContext())
             .crossfade(true)
@@ -100,7 +92,7 @@ class UtilsFragment : Fragment() {
                 val otp = binding.etOtp.text.toString()
                 withContext(Dispatchers.IO) {
                     injectOTP(otp)
-                    spoofedSimInfoRepo.updateAvailable(available = true)
+                    spoofedInfoRepo.updateAvailable(available = true)
                     appStateRepo.resetSuccessNum()
                     appStateRepo.resetExecutedNum()
                 }

+ 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 && false) {
+    if (ROOT_ACCESS) {
         val intent = Intent()
         intent.setAction("com.example.modifier.sms")
         intent.putExtra("sender", "3538")