xiongzhu 10 сар өмнө
parent
commit
47b8803379

+ 4 - 3
app/src/main/java/com/example/modifier/repo/SpoofedInfoRepo.kt

@@ -251,17 +251,18 @@ class SpoofedInfoRepo private constructor(private val context: Context) {
                 apduChannel1.writeMSISDN_USIM(spoofedSimInfo.number)
                 apduChannel.close()
 
-                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
-                    telephonyManager.rebootModem()
-                } else {
+                runCatching {
                     val mClass = Class.forName("android.telephony.TelephonyManager")
                     val rebootRadio = mClass.getDeclaredMethod("rebootRadio")
                     rebootRadio.isAccessible = true
                     rebootRadio.invoke(telephonyManager)
                     Log.i(TAG, "rebootRadio: success")
                     delay(5000)
+                }.onFailure {
+                    Log.e(TAG, "Error rebootRadio: ${it.message}", it)
                 }
 
+
                 val subscriptionManager =
                     context.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE) as SubscriptionManager