xiongzhu 10 maanden geleden
bovenliggende
commit
f3b9f8d37d

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

@@ -16,4 +16,7 @@ data class SpoofedSimInfo(
     var available: Boolean,
     var carrierId: String,
     var carrierName: String,
+    var serialNo: String,
+    val mac: String,
+    val bssid: String,
 )

+ 6 - 1
app/src/main/java/com/example/modifier/repo/BackupRepository.kt

@@ -23,6 +23,8 @@ import com.example.modifier.model.SpoofedSimInfo
 import com.example.modifier.service.ModifierService
 import com.example.modifier.utils.ROOT_ACCESS
 import com.example.modifier.utils.clearConv
+import com.example.modifier.utils.genMacAddress
+import com.example.modifier.utils.genSerialNo
 import com.example.modifier.utils.getContext
 import com.example.modifier.utils.shellRun
 import kotlinx.coroutines.CoroutineScope
@@ -135,7 +137,10 @@ class BackupRepository(
             imsi = backup.imsi,
             available = false,
             carrierId = backup.carrierId,
-            carrierName = backup.carrierName
+            carrierName = backup.carrierName,
+            serialNo = genSerialNo(),
+            mac = genMacAddress(),
+            bssid = genMacAddress()
         )
         spoofedSimInfoRepo.updateSpoofedSimInfo(spoofedSimInfo = simInfo, suspend = false)
         val packages = mutableListOf(

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

@@ -47,7 +47,10 @@ class SimInfoProvider : ContentProvider() {
                 "country",
                 "carrier_id",
                 "carrier_name",
-                "upi_policy"
+                "upi_policy",
+                "serial_no",
+                "mac",
+                "bssid"
             )
         );
         runBlocking {
@@ -64,7 +67,10 @@ class SimInfoProvider : ContentProvider() {
                         simInfo.country,
                         simInfo.carrierId,
                         simInfo.carrierName,
-                        "upi-carrier-id-with-mo-sms-relax"
+                        "upi-carrier-id-with-mo-sms-relax",
+                        simInfo.serialNo,
+                        simInfo.mac,
+                        simInfo.bssid
                     )
                 )
             }

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

@@ -31,6 +31,8 @@ import com.example.modifier.utils.SimEncoder
 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.hasPermission
 import com.example.modifier.utils.isOldVersion
@@ -65,6 +67,9 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
         val AVAILABLE = booleanPreferencesKey("available")
         val CARRIER_ID = stringPreferencesKey("carrier_id")
         val CARRIER_NAME = stringPreferencesKey("carrier_name")
+        val SERIAL_NO = stringPreferencesKey("serial_no")
+        val MAC = stringPreferencesKey("mac")
+        val BSSID = stringPreferencesKey("bssid")
     }
 
     private val simInfoFlow = context.simInfoDataStore.data.map {
@@ -80,6 +85,9 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
         val available = it[PreferencesKeys.AVAILABLE] ?: false
         val carrierId = it[PreferencesKeys.CARRIER_ID] ?: ""
         val carrierName = it[PreferencesKeys.CARRIER_NAME] ?: ""
+        val serialNo = it[PreferencesKeys.SERIAL_NO] ?: ""
+        val mac = it[PreferencesKeys.MAC] ?: ""
+        val bssid = it[PreferencesKeys.BSSID] ?: ""
         SpoofedSimInfo(
             numberId = numberId,
             number = number,
@@ -92,7 +100,10 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
             areaCode = areaCode,
             available = available,
             carrierId = carrierId,
-            carrierName = carrierName
+            carrierName = carrierName,
+            serialNo = serialNo,
+            mac = mac,
+            bssid = bssid
         )
     }
 
@@ -109,7 +120,10 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
             areaCode = "",
             available = false,
             carrierId = "",
-            carrierName = ""
+            carrierName = "",
+            serialNo = "",
+            mac = "",
+            bssid = "",
         )
     )
 
@@ -140,6 +154,9 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
             it[PreferencesKeys.AVAILABLE] = spoofedSimInfo.available
             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.BSSID] = spoofedSimInfo.bssid
         }
         try {
             if (ROOT_ACCESS) {
@@ -286,6 +303,9 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
                 put("country", spoofedSimInfo.country)
                 put("carrier_id", spoofedSimInfo.carrierId)
                 put("carrier_name", spoofedSimInfo.carrierName)
+                put("serial_no", spoofedSimInfo.serialNo)
+                put("mac", spoofedSimInfo.mac)
+                put("bssid", spoofedSimInfo.bssid)
             }
             val base64 = Base64.encode(jsonObject.toString().toByteArray(), Base64.DEFAULT)
                 .toString(Charsets.UTF_8)
@@ -326,7 +346,10 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
                             areaCode = "1",
                             available = false,
                             carrierId = "1779",
-                            carrierName = "Cricket Wireless"
+                            carrierName = "Cricket Wireless",
+                            serialNo = genSerialNo(),
+                            mac = genMacAddress(),
+                            bssid = genMacAddress()
                         ),
                         suspend = false
                     )
@@ -353,7 +376,10 @@ class SpoofedSimInfoRepo private constructor(private val context: Context) {
                             areaCode = "1",
                             available = false,
                             carrierId = "1",
-                            carrierName = "T-Mobile"
+                            carrierName = "T-Mobile",
+                            serialNo = genSerialNo(),
+                            mac = genMacAddress(),
+                            bssid = genMacAddress()
                         )
                     )
                 }

+ 5 - 0
app/src/main/java/com/example/modifier/service/TaskRunner.kt

@@ -44,6 +44,8 @@ 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
@@ -424,6 +426,9 @@ class TaskRunner(
                 available = false,
                 carrierId = rcsNumber.carrierId,
                 carrierName = rcsNumber.carrierName,
+                serialNo = genSerialNo(),
+                mac = genMacAddress(),
+                bssid = genMacAddress()
             )
         )
 

+ 16 - 2
app/src/main/java/com/example/modifier/ui/settings/SettingsFragment.kt

@@ -44,6 +44,8 @@ import com.example.modifier.repo.AppPrefsRepo
 import com.example.modifier.repo.SpoofedSimInfoRepo
 import com.example.modifier.utils.genICCID
 import com.example.modifier.utils.genIMEI
+import com.example.modifier.utils.genMacAddress
+import com.example.modifier.utils.genSerialNo
 import com.google.android.material.dialog.MaterialAlertDialogBuilder
 import io.ktor.client.call.body
 import io.ktor.client.plugins.resources.put
@@ -128,6 +130,9 @@ class SettingsFragment : Fragment() {
             binding.tlImei.setEndIconOnClickListener {
                 binding.etImei.setText(genIMEI())
             }
+            binding.tlSerial.setEndIconOnClickListener {
+                binding.etSerial.setText(genSerialNo())
+            }
             binding.btnSave.setOnClickListener {
                 onSave()
             }
@@ -198,6 +203,9 @@ class SettingsFragment : Fragment() {
                         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(
                             SpoofedSimInfo(
                                 numberId = res.id,
@@ -211,7 +219,10 @@ class SettingsFragment : Fragment() {
                                 areaCode = areaCode,
                                 available = false,
                                 carrierId = res.carrierId,
-                                carrierName = res.carrierName
+                                carrierName = res.carrierName,
+                                serialNo = serialNo,
+                                mac = mac,
+                                bssid = bssid
                             )
                         )
                     }
@@ -400,7 +411,10 @@ class SettingsFragment : Fragment() {
                         binding.etAreaCode.text.toString(),
                         false,
                         binding.etCarrierId.text.toString(),
-                        binding.etCarrierName.text.toString()
+                        binding.etCarrierName.text.toString(),
+                        binding.etSerial.text.toString(),
+                        genMacAddress(),
+                        genMacAddress()
                     ),
                     suspend = true
                 )

+ 0 - 3
app/src/main/java/com/example/modifier/utils/ADB.kt

@@ -89,9 +89,6 @@ class ADB {
                 }
                 process.outputStream.bufferedWriter().use { writer ->
                     commands.forEach { command ->
-                        writer.write("echo '>$command'")
-                        writer.newLine()
-                        writer.flush()
                         writer.write(command)
                         writer.newLine()
                         writer.flush()

+ 7 - 6
app/src/main/java/com/example/modifier/utils/Package.kt

@@ -62,19 +62,20 @@ suspend fun resetAll() {
             "sleep 10",
             PACKAGE_GMS.clear(),
             "sleep 2",
+//            "pm revoke com.google.android.gms android.permission.ACCESS_FINE_LOCATION",
+//            "pm revoke com.google.android.gms android.permission.ACCESS_COARSE_LOCATION",
+//            "pm revoke com.google.android.gms android.permission.NEARBY_WIFI_DEVICES",
+//            "pm revoke com.google.android.gms android.permission.BLUETOOTH_CONNECT",
+//            "pm revoke com.google.android.gms android.permission.BLUETOOTH_SCAN",
+//            "pm revoke com.google.android.gms android.permission.BLUETOOTH_ADVERTISE",
+//            "pm revoke com.google.android.gms android.permission.UWB_RANGING",
 //            "pm revoke com.google.android.gms android.permission.GET_ACCOUNTS",
 //            "pm revoke com.google.android.gms android.permission.SYSTEM_ALERT_WINDOW",
 //            "pm revoke com.google.android.gms android.permission.POST_NOTIFICATIONS",
-//            "pm revoke com.google.android.gms android.permission.READ_CONTACTS",
 //            "pm revoke com.google.android.gms android.permission.CAMERA",
 //            "pm revoke com.google.android.gms android.permission.RECEIVE_MMS",
 //            "pm revoke com.google.android.gms android.permission.GET_APP_OPS_STATS",
 //            "pm revoke com.google.android.gms android.permission.PROCESS_OUTGOING_CALLS",
-//            "pm revoke com.google.android.gms android.permission.BLUETOOTH_CONNECT",
-//            "pm revoke com.google.android.gms android.permission.BLUETOOTH_SCAN",
-//            "pm revoke com.google.android.gms android.permission.BLUETOOTH_ADVERTISE",
-//            "pm revoke com.google.android.gms android.permission.NEARBY_WIFI_DEVICES",
-//            "pm revoke com.google.android.gms android.permission.UWB_RANGING",
 //            "pm revoke com.google.android.gms android.permission.READ_CALL_LOG",
 //            "pm revoke com.google.android.gms android.permission.WRITE_CONTACTS",
 //            "pm revoke com.google.android.gms android.permission.CALL_PHONE",

+ 11 - 0
app/src/main/java/com/example/modifier/utils/SimInfo.kt

@@ -36,6 +36,17 @@ fun genIMEI(): String {
     return imei
 }
 
+fun genSerialNo(): String {
+    return RandomStringUtils.randomAlphanumeric(14).uppercase()
+}
+
+fun genMacAddress(): String {
+    val macAddress = List(4) {
+        "%02x".format((0..255).random())
+    }.joinToString(":")
+    return "00:16:$macAddress"
+}
+
 fun generateIMEI1(): String {
     val str = intArrayOf(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
     var sum = 0

+ 17 - 0
app/src/main/res/layout/fragment_settings.xml

@@ -269,6 +269,23 @@
                                 android:lines="1" />
                         </com.google.android.material.textfield.TextInputLayout>
 
+                        <com.google.android.material.textfield.TextInputLayout
+                            android:id="@+id/tl_serial"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="16dp"
+                            android:hint="SerialNo"
+                            app:endIconDrawable="@drawable/ic_refresh"
+                            app:endIconMode="custom">
+
+                            <com.google.android.material.textfield.TextInputEditText
+                                android:id="@+id/et_serial"
+                                android:layout_width="match_parent"
+                                android:layout_height="wrap_content"
+                                android:inputType="number"
+                                android:lines="1" />
+                        </com.google.android.material.textfield.TextInputLayout>
+
 
                         <LinearLayout
                             android:layout_width="wrap_content"