|
|
@@ -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
|