|
@@ -2,6 +2,7 @@ package com.example.modifier.repo
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint
|
|
import android.annotation.SuppressLint
|
|
|
import android.content.Context
|
|
import android.content.Context
|
|
|
|
|
+import android.os.Build
|
|
|
import android.telephony.SubscriptionManager
|
|
import android.telephony.SubscriptionManager
|
|
|
import android.telephony.TelephonyManager
|
|
import android.telephony.TelephonyManager
|
|
|
import android.util.Log
|
|
import android.util.Log
|
|
@@ -12,11 +13,14 @@ import androidx.datastore.preferences.core.stringPreferencesKey
|
|
|
import androidx.datastore.preferences.preferencesDataStore
|
|
import androidx.datastore.preferences.preferencesDataStore
|
|
|
import com.example.modifier.BuildConfig
|
|
import com.example.modifier.BuildConfig
|
|
|
import com.example.modifier.baseTag
|
|
import com.example.modifier.baseTag
|
|
|
|
|
+import com.example.modifier.constants.PACKAGE_CLEAN_SMS
|
|
|
import com.example.modifier.constants.PACKAGE_GMS
|
|
import com.example.modifier.constants.PACKAGE_GMS
|
|
|
import com.example.modifier.constants.PACKAGE_MESSAGING
|
|
import com.example.modifier.constants.PACKAGE_MESSAGING
|
|
|
import com.example.modifier.constants.PACKAGE_PLAY
|
|
import com.example.modifier.constants.PACKAGE_PLAY
|
|
|
import com.example.modifier.constants.SIMView
|
|
import com.example.modifier.constants.SIMView
|
|
|
import com.example.modifier.extension.kill
|
|
import com.example.modifier.extension.kill
|
|
|
|
|
+import com.example.modifier.extension.resume
|
|
|
|
|
+import com.example.modifier.extension.suspend
|
|
|
import com.example.modifier.model.SpoofedInfo
|
|
import com.example.modifier.model.SpoofedInfo
|
|
|
import com.example.modifier.utils.ApduChannel
|
|
import com.example.modifier.utils.ApduChannel
|
|
|
import com.example.modifier.utils.SimEncoder
|
|
import com.example.modifier.utils.SimEncoder
|
|
@@ -195,7 +199,11 @@ class SpoofedInfoRepo private constructor(private val context: Context) {
|
|
|
}
|
|
}
|
|
|
if (suspend == true) {
|
|
if (suspend == true) {
|
|
|
shellRun(
|
|
shellRun(
|
|
|
|
|
+ PACKAGE_MESSAGING.suspend(),
|
|
|
|
|
+ PACKAGE_PLAY.suspend(),
|
|
|
|
|
+ PACKAGE_GMS.suspend(),
|
|
|
PACKAGE_GMS.kill(),
|
|
PACKAGE_GMS.kill(),
|
|
|
|
|
+ PACKAGE_PLAY.kill(),
|
|
|
PACKAGE_MESSAGING.kill(),
|
|
PACKAGE_MESSAGING.kill(),
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
@@ -269,12 +277,10 @@ class SpoofedInfoRepo private constructor(private val context: Context) {
|
|
|
rebootRadio.isAccessible = true
|
|
rebootRadio.isAccessible = true
|
|
|
rebootRadio.invoke(telephonyManager)
|
|
rebootRadio.invoke(telephonyManager)
|
|
|
Log.i(TAG, "rebootRadio: success")
|
|
Log.i(TAG, "rebootRadio: success")
|
|
|
- delay(5000)
|
|
|
|
|
}.onFailure {
|
|
}.onFailure {
|
|
|
Log.e(TAG, "Error rebootRadio: ${it.message}", it)
|
|
Log.e(TAG, "Error rebootRadio: ${it.message}", it)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
val subscriptionManager =
|
|
val subscriptionManager =
|
|
|
context.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE) as SubscriptionManager
|
|
context.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE) as SubscriptionManager
|
|
|
|
|
|
|
@@ -287,36 +293,32 @@ class SpoofedInfoRepo private constructor(private val context: Context) {
|
|
|
Log.i(TAG, "iccid:${it.iccId} target:${spoofedInfo.iccid}")
|
|
Log.i(TAG, "iccid:${it.iccId} target:${spoofedInfo.iccid}")
|
|
|
if (it.iccId == spoofedInfo.iccid) {
|
|
if (it.iccId == spoofedInfo.iccid) {
|
|
|
Log.i(TAG, "rebootModem: success")
|
|
Log.i(TAG, "rebootModem: success")
|
|
|
|
|
+ if (Build.DEVICE == "redfin") {
|
|
|
|
|
+ delay(10000)
|
|
|
|
|
+ }
|
|
|
return@rebootModem
|
|
return@rebootModem
|
|
|
|
|
+ } else {
|
|
|
|
|
+ delay(2000)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}.onFailure {
|
|
}.onFailure {
|
|
|
Log.e(TAG, "Error reading ICCID: ${it.message}", it)
|
|
Log.e(TAG, "Error reading ICCID: ${it.message}", it)
|
|
|
}
|
|
}
|
|
|
- delay(2000)
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (suspend == true) {
|
|
if (suspend == true) {
|
|
|
shellRun(
|
|
shellRun(
|
|
|
|
|
+ PACKAGE_GMS.resume(),
|
|
|
|
|
+ PACKAGE_PLAY.resume(),
|
|
|
|
|
+ PACKAGE_MESSAGING.resume(),
|
|
|
PACKAGE_PLAY.kill(),
|
|
PACKAGE_PLAY.kill(),
|
|
|
- "sleep 3",
|
|
|
|
|
PACKAGE_GMS.kill(),
|
|
PACKAGE_GMS.kill(),
|
|
|
- "sleep 3",
|
|
|
|
|
PACKAGE_MESSAGING.kill(),
|
|
PACKAGE_MESSAGING.kill(),
|
|
|
- "sleep 3",
|
|
|
|
|
- PACKAGE_GMS.kill(),
|
|
|
|
|
- "sleep 3",
|
|
|
|
|
- PACKAGE_MESSAGING.kill(),
|
|
|
|
|
- "sleep 3"
|
|
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// val base64 = Base64.encode(jsonObject.toString().toByteArray(), Base64.DEFAULT)
|
|
|
|
|
-// .toString(Charsets.UTF_8)
|
|
|
|
|
-// shellRun("echo '$base64' > /sdcard/Android/data/com.android.phone/files/config/config.json")
|
|
|
|
|
-
|
|
|
|
|
} catch (e: Exception) {
|
|
} catch (e: Exception) {
|
|
|
Log.e(TAG, "Error updateSpoofedSimInfo: ${e.message}", e)
|
|
Log.e(TAG, "Error updateSpoofedSimInfo: ${e.message}", e)
|
|
|
}
|
|
}
|