x1ongzhu vor 1 Jahr
Ursprung
Commit
4f80dc9238
6 geänderte Dateien mit 182 neuen und 1315 gelöschten Zeilen
  1. 15 33
      injects/all.js
  2. 41 65
      receivesms.js
  3. 5 737
      scripts/spoof_gms.js
  4. 97 0
      scripts/spoof_phone.js
  5. 23 479
      scripts/spoof_sms.js
  6. 1 1
      twilio.js

+ 15 - 33
injects/all.js

@@ -10,6 +10,11 @@ import { setTimeout } from 'timers/promises'
 const filePath = url.fileURLToPath(import.meta.url)
 const __dirname = path.dirname(filePath)
 
+function loadSource(filePath) {
+    Log.s(`Loading ${filePath}`)
+    return fs.readFileSync(path.resolve(__dirname, filePath)).toString()
+}
+
 function pushFile(file, dest, force = false) {
     const fileName = path.basename(file)
     const srcPath = path.resolve(__dirname, file)
@@ -42,7 +47,6 @@ function pushFile(file, dest, force = false) {
 pushFile('../RcsHackTool.dex', '/sdcard/Download/')
 pushFile('../gson.dex', '/sdcard/Android/data/com.google.android.gms/')
 pushFile('../gson.dex', '/sdcard/Android/data/com.google.android.apps.messaging/')
-
 class Log {
     static TAG = ''
     static format(...msg) {
@@ -73,36 +77,6 @@ class Log {
     }
 }
 
-function replaceVars(source) {
-    const vars = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../vars.json')).toString())
-    return source
-        .replace('{{mcc}}', vars.mcc)
-        .replace('{{mnc}}', vars.mnc)
-        .replace('{{simOperator}}', vars.simOperator)
-        .replace('{{networkOperator}}', vars.networkOperator)
-        .replace('{{simSerialNumber}}', vars.simSerialNumber)
-        .replace('{{iccId}}', vars.iccId)
-        .replace('{{number}}', vars.number)
-        .replace('{{imei}}', vars.imei)
-        .replace('{{imsi}}', vars.imsi)
-        .replace('{{countryIso}}', vars.countryIso)
-        .replace('{{subId}}', vars.subId)
-        .replace('{{androidId}}', vars.androidId)
-        .replace('{{serialNumber}}', vars.serialNumber)
-}
-
-function loadSource(filePath) {
-    Log.s(`Loading ${filePath}`)
-    return replaceVars(fs.readFileSync(path.resolve(__dirname, filePath)).toString())
-}
-
-const source = loadSource('../scripts/spoof_sms.js')
-const source_gms = loadSource('../scripts/spoof_gms.js')
-const source_ssl = loadSource('../scripts/ssl_bypass.js')
-
-fs.writeFileSync('scripts/_spoof.js', source)
-fs.writeFileSync('scripts/_spoof_gms.js', source_gms)
-
 let device = null
 let tracers = []
 
@@ -134,6 +108,15 @@ async function main() {
     // Log.i("[*] Spawned com.google.android.apps.messaging: " + pid)
     // const tracer = await Tracer.open(pid)
     // tracers.push(tracer)
+    const processes = await device.enumerateProcesses()
+    for (const process of processes) {
+        if (process.name.startsWith('com.android.phone')) {
+            console.log('[*] Attaching to', process.pid, process.name)
+            const session = await device.attach(process.pid)
+            const script = await session.createScript(loadSource('../scripts/spoof_phone.js'))
+            await script.load()
+        }
+    }
 }
 
 async function onSpawnAdded(spawn) {
@@ -142,8 +125,7 @@ async function onSpawnAdded(spawn) {
             Log.i('[*] Tracing', spawn.pid, spawn.identifier)
             const tracer = await Tracer.open(spawn.pid, '../scripts/spoof_sms.js')
             tracers.push(tracer)
-        }
-        if (spawn.identifier.startsWith('com.google.android.gms')) {
+        } else if (spawn.identifier.startsWith('com.google.android.gms')) {
             Log.i('[*] Tracing', spawn.pid, spawn.identifier)
             const tracer = await Tracer.open(spawn.pid, '../scripts/spoof_gms.js')
             tracers.push(tracer)

+ 41 - 65
receivesms.js

@@ -1,74 +1,50 @@
-import axios from "axios"
-import { createHash } from "crypto"
-const id = "account_Rcsgogogo"
-const key = "76a44e4d-b960-412d-8624-b66881ad61d6"
-function getSignature(id, nonce, ts) {
-    const data = `${id}_${nonce}_${ts}_${key}`
-    return createHash("sha256").update(data).digest("hex")
-}
-let timer = null
-let exipreTime = null
-async function getPhone() {
-    const nonce = Math.random().toString(36).substring(7)
-    const ts = new Date().getTime()
-    const signature = getSignature(id, nonce, ts)
-    const { data } = await axios.post(
-        `http://api.code-sms.net:54722/sms/openApi/phone`,
-        {
-            country: "USA",
-            appId: 25
-        },
-        {
-            headers: {
-                gatewayId: id,
-                nonce,
-                timestamp: ts,
-                signature
+import axios from 'axios'
+
+axios.defaults.baseURL = 'http://api.mwze167.com/registerApi/'
+
+const uid = '1715242407'
+const sign = 'da1a847ef8f0df331884ce45d97e7e42'
+const pid = '133'
+const cuy = 'US'
+
+const receiveSms = async () => {
+    try {
+        const res = await axios.post('getMobile', null, {
+            params: {
+                uid,
+                sign,
+                pid,
+                cuy,
+                size: 1,
+                ctype: 2
             }
+        })
+        console.log(res.data)
+        return res.data
+    } catch (error) {
+        if (error.response) {
+            console.error(error.code, error.response.status, error.response.data)
+        } else {
+            console.error(error.message, error.code)
         }
-    )
-    console.log(data)
-    if (data.uid) {
-        exipreTime = new Date(data.expireTimeSec * 1000)
-        console.log(`获取到号码: ${data.phone}, 有效期: ${exipreTime}`)
-        timer = setInterval(() => {
-            getSms(data.phone, data.uid)
-        }, 1500)
-    } else {
     }
 }
 
-async function getSms(phone, uid) {
+const getSms = async (orderId) => {
     try {
-        if (new Date() > exipreTime) {
-            clearInterval(timer)
-            console.log("号码已过期")
-            return
-        }
-        const nonce = Math.random().toString(36).substring(7)
-        const ts = new Date().getTime()
-        const signature = getSignature(id, nonce, ts)
-        const { data } = await axios.post(
-            `http://api.code-sms.net:54722/sms/openApi/code`,
-            {
-                uid
-            },
-            {
-                headers: {
-                    gatewayId: id,
-                    nonce,
-                    timestamp: ts,
-                    signature
-                }
+        const res = await axios.post('getMsg', null, {
+            params: {
+                uid,
+                sign,
+                orderId
             }
-        )
-        if (data.smsCode) {
-            console.log(`获取到验证码: ${data.smsCode}`)
-            clearInterval(timer)
-        } else {
-            console.log(`等待验证码中: ${phone}`)
-        }
-    } catch (error) {}
+        })
+        console.log(res.data)
+        return res.data
+    } catch (error) {
+        console.error(error.response.data)
+    }
 }
 
-await getPhone()
+// await receiveSms()
+await getSms('1238195524472983552')

+ 5 - 737
scripts/spoof_gms.js

@@ -1,41 +1,7 @@
-const mcc = '{{mcc}}'
-const mnc = '{{mnc}}'
-const simOperator = '{{simOperator}}'
-const networkOperator = '{{networkOperator}}'
-const simSerialNumber = '{{simSerialNumber}}'
-const iccId = '{{iccId}}'
-const number = '{{number}}'
-const imei = '{{imei}}'
-const imsi = '{{imsi}}'
-const countryIso = '{{countryIso}}'
-const subId = '{{subId}}'
-const androidId = '{{androidId}}'
-const serialNumber = '{{serialNumber}}'
-
 function trace(tag) {
     Log.e((tag || '') + Java.use('android.util.Log').getStackTraceString(Java.use('java.lang.Throwable').$new()))
 }
 
-function dump(obj) {
-    try {
-        const gson = Java.use('com.google.gson.Gson').$new()
-        const json = gson.toJson(obj)
-        return json
-    } catch (error) {
-        return ''
-    }
-}
-
-function dumpJson(obj) {
-    try {
-        const gson = Java.use('com.google.gson.Gson').$new()
-        const json = gson.toJson(obj)
-        return JSON.parse(json)
-    } catch (error) {
-        return ''
-    }
-}
-
 class Log {
     static TAG = '[GMS]'
     static Debug = false
@@ -67,311 +33,6 @@ class Log {
 }
 
 Java.perform(function () {
-    try {
-        const GsonClass = Java.openClassFile('/sdcard/Android/data/com.google.android.gms/gson.dex')
-        GsonClass.load()
-        Log.s('gson class loaded')
-    } catch (error) {
-        Log.e('load gson error', error)
-    }
-
-    const SmsManager = Java.use('android.telephony.SmsManager')
-    SmsManager.getSmsManagerForSubscriptionId.overload('int').implementation = function (i) {
-        const _smsManager = this.getSmsManagerForSubscriptionId(i)
-        Log.i(`SmsManager.getSmsManagerForSubscriptionId: ${i}`)
-        return _smsManager
-    }
-
-    SmsManager.getDefault.overload().implementation = function () {
-        const _smsManager = this.getDefault(i)
-        Log.i(`SmsManager.getDefault`)
-        return _smsManager
-    }
-
-    // SmsManager.getDefaultSmsSubscriptionId.overload().implementation =
-    //     function () {
-    //         const _subId = this.getDefaultSmsSubscriptionId()
-    //         Log.i(
-    //             `spoof SmsManager.getDefaultSmsSubscriptionId: ${_subId} -> ${subId}`
-    //         )
-    //         return parseInt(subId)
-    //     }
-
-    // SmsManager.getSubscriptionId.overload().implementation = function () {
-    //     const _subId = this.getSubscriptionId()
-    //     Log.i(`SmsManager.getSubscriptionId: ${_subId} -> ${subId}`)
-    //     return parseInt(subId)
-    // }
-    SmsManager.getCarrierConfigValues.overload().implementation = function () {
-        const _config = this.getCarrierConfigValues()
-        Log.i(`SmsManager.getCarrierConfigValues: ${_config}`)
-        return _config
-    }
-
-    const CarrierConfigManager = Java.use('android.telephony.CarrierConfigManager')
-    CarrierConfigManager.getConfigForSubId.overload('int').implementation = function (i) {
-        const _config = this.getConfigForSubId(i)
-        Log.i(`CarrierConfigManager.getConfigForSubId: ${i}`)
-        return _config
-    }
-
-    const SubscriptionManager = Java.use('android.telephony.SubscriptionManager')
-    SubscriptionManager.getActiveSubscriptionInfoCount.overload().implementation = function () {
-        const _count = this.getActiveSubscriptionInfoCount()
-        Log.i(`SubscriptionManager.getActiveSubscriptionInfoCount: ${_count}`)
-        return _count
-    }
-    // SubscriptionManager.getDefaultSubscriptionId.overload().implementation =
-    //     function () {
-    //         const _subId = this.getDefaultSubscriptionId()
-    //         Log.i(
-    //             `spoof SubscriptionManager.getDefaultSubscriptionId: ${_subId} -> ${subId}`
-    //         )
-    //         return parseInt(subId)
-    //     }
-    // SubscriptionManager.getDefaultSmsSubscriptionId.overload().implementation =
-    //     function () {
-    //         const _subId = this.getDefaultSmsSubscriptionId()
-    //         Log.i(
-    //             `spoof SubscriptionManager.getDefaultSmsSubscriptionId: ${_subId} -> ${subId}`
-    //         )
-    //         return parseInt(subId)
-    //     }
-    // SubscriptionManager.getDefaultVoiceSubscriptionId.overload().implementation =
-    //     function () {
-    //         const _subId = this.getDefaultVoiceSubscriptionId()
-    //         Log.i(
-    //             `spoof SubscriptionManager.getDefaultVoiceSubscriptionId: ${_subId} -> ${subId}`
-    //         )
-    //         return parseInt(subId)
-    //     }
-    // SubscriptionManager.getActiveDataSubscriptionId.overload().implementation =
-    //     function () {
-    //         const _subId = this.getActiveDataSubscriptionId()
-    //         Log.i(
-    //             `spoof SubscriptionManager.getActiveDataSubscriptionId: ${_subId} -> ${subId}`
-    //         )
-    //         return parseInt(subId)
-    //     }
-    // SubscriptionManager.getSlotIndex.overload("int").implementation = function (
-    //     i
-    // ) {
-    //     const _slotIndex = this.getSlotIndex(i)
-    //     Log.i(`spoof SubscriptionManager.getSlotIndex: ${_slotIndex} -> 0`)
-    //     return 0
-    // }
-    // SubscriptionManager.isUsableSubscriptionId.overload("int").implementation =
-    //     function (i) {
-    //         const _isUsable = this.isUsableSubscriptionId(i)
-    //         Log.i(`SubscriptionManager.isUsableSubscriptionId: ${_isUsable}`)
-    //         return _isUsable
-    //     }
-    // SubscriptionManager.isValidSubscriptionId.overload("int").implementation =
-    //     function (i) {
-    //         const _isValid = this.isValidSubscriptionId(i)
-    //         Log.i(
-    //             `spoof SubscriptionManager.isValidSubscriptionId(${i}): ${_isValid} -> true`
-    //         )
-    //         return true
-    //     }
-    SubscriptionManager.getPhoneNumber.overload('int').implementation = function (i) {
-        Log.i(`spoof SubscriptionManager.getPhoneNumber(${i}): -> ${number}`)
-        return number
-    }
-    SubscriptionManager.getPhoneNumber.overload('int', 'int').implementation = function (i, i2) {
-        Log.i(`spoof SubscriptionManager.getPhoneNumber(${i},${i2}): -> ${number}`)
-        return number
-    }
-    SubscriptionManager.getActiveSubscriptionInfoList.overload().implementation = function () {
-        const _list = this.getActiveSubscriptionInfoList()
-        Log.i(`SubscriptionManager.getActiveSubscriptionInfoList ${_list.size()}`)
-        return _list
-    }
-    // SubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex.overload(
-    //     "int"
-    // ).implementation = function (i) {
-    //     const _info = this.getActiveSubscriptionInfoForSimSlotIndex(i)
-    //     Log.i(
-    //         `SubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex(${i}): ${
-    //             _info ? "ok" : "null"
-    //         }`
-    //     )
-    //     return _info
-    // }
-    // SubscriptionManager.getActiveSubscriptionIdList.overload().implementation =
-    //     function () {
-    //         const _list = this.getActiveSubscriptionIdList()
-    //         Log.i(
-    //             `spoof SubscriptionManager.getActiveSubscriptionIdList ${_list} -> ${subId}`
-    //         )
-    //         return [parseInt(subId)]
-    //     }
-    // SubscriptionManager.getActiveSubscriptionInfo.overload(
-    //     "int"
-    // ).implementation = function (i) {
-    //     const _info = this.getActiveSubscriptionInfo(i)
-
-    //     const simCount = this.getActiveSubscriptionInfoCountMax()
-
-    //     let subInfo = null
-    //     try {
-    //         for (let i = 0; i < simCount; i++) {
-    //             subInfo = this.getActiveSubscriptionInfoForSimSlotIndex(i)
-    //             if (subInfo) {
-    //                 break
-    //             }
-    //         }
-    //         Log.i(`spoof SubscriptionManager.getActiveSubscriptionInfo(${i})`)
-    //     } catch (error) {
-    //         console.error(
-    //             `spoof error SubscriptionManager.getActiveSubscriptionInfo(${i})`
-    //         )
-    //         error.printStackTrace()
-    //     }
-    //     return subInfo
-    // }
-    // SubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex.overload(
-    //     "int"
-    // ).implementation = function (i) {
-    //     const _info = this.getActiveSubscriptionInfoForSimSlotIndex(i)
-    //     Log.i(
-    //         `SubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex: ${_info}`
-    //     )
-    //     return _info
-    // }
-    // SubscriptionManager.isActiveSubscriptionId.overload("int").implementation =
-    //     function (i) {
-    //         const _isActive = this.isActiveSubscriptionId(i)
-    //         Log.i(
-    //             `spoof SubscriptionManager.isActiveSubscriptionId(${i}): ${_isActive} -> true`
-    //         )
-    //         return true
-    //     }
-
-    const SubscriptionInfo = Java.use('android.telephony.SubscriptionInfo')
-    SubscriptionInfo.getMcc.overload().implementation = function () {
-        const _mcc = this.getMcc()
-        Log.i(`spoof SubscriptionInfo.getMcc: ${_mcc} -> ${mcc}`)
-        return parseInt(mcc)
-    }
-
-    SubscriptionInfo.getMnc.overload().implementation = function () {
-        const _mnc = this.getMnc()
-        Log.i(`spoof SubscriptionInfo.getMnc: ${_mnc} -> ${mnc}`)
-        return parseInt(mnc)
-    }
-
-    SubscriptionInfo.getMccString.overload().implementation = function () {
-        const _mccString = this.getMccString()
-        Log.i(`spoof SubscriptionInfo.getMccString: ${_mccString} -> ${mcc}`)
-        return mcc
-    }
-
-    SubscriptionInfo.getMncString.overload().implementation = function () {
-        const _mncString = this.getMncString()
-        Log.i(`spoof SubscriptionInfo.getMncString: ${_mncString} -> ${mnc}`)
-        return mnc
-    }
-
-    SubscriptionInfo.getNumber.overload().implementation = function () {
-        const _number = this.getNumber()
-        Log.i(`spoof SubscriptionInfo.getNumber: ${_number} -> ${number}`)
-        return number
-    }
-
-    SubscriptionInfo.getIccId.overload().implementation = function () {
-        const _iccId = this.getIccId()
-        Log.i(`spoof SubscriptionInfo.getIccId: ${_iccId} -> ${iccId}`)
-        return iccId
-    }
-
-    SubscriptionInfo.getCountryIso.overload().implementation = function () {
-        const _countryIso = this.getCountryIso()
-        Log.i(`spoof SubscriptionInfo.getCountryIso: ${_countryIso} -> ${countryIso}`)
-        return countryIso
-    }
-
-    // SubscriptionInfo.getSubscriptionId.overload().implementation = function () {
-    //     const _subId = this.getSubscriptionId()
-    //     if (!subId) {
-    //         Log.i(_subId)
-    //         return _subId
-    //     }
-    //     Log.i(`spoof SubscriptionInfo.getSubscriptionId: ${_subId} -> ${subId}`)
-    //     return parseInt(subId)
-    // }
-
-    const TelephonyManager = Java.use('android.telephony.TelephonyManager')
-    // TelephonyManager.createForSubscriptionId.overload("int").implementation =
-    //     function (i) {
-    //         Log.i(`spoof TelephonyManager.createForSubscriptionId: ${i}`)
-    //         return this
-    //     }
-
-    TelephonyManager.getLine1Number.overload().implementation = function () {
-        const _number = this.getLine1Number()
-        Log.i(`spoof TelephonyManager.getLine1Number: ${_number} -> ${number}`)
-        return number
-    }
-
-    TelephonyManager.getSimOperator.overload().implementation = function () {
-        const _simOperator = this.getSimOperator()
-        Log.i(`spoof TelephonyManager.getSimOperator: ${_simOperator} -> ${simOperator}`)
-        return simOperator
-    }
-
-    TelephonyManager.getNetworkOperator.overload().implementation = function () {
-        const _networkOperator = this.getNetworkOperator()
-        Log.i(`spoof TelephonyManager.getNetworkOperator: ${_networkOperator} -> ${networkOperator}`)
-        return networkOperator
-    }
-
-    TelephonyManager.getSimSerialNumber.overload().implementation = function () {
-        const _simSerialNumber = this.getSimSerialNumber()
-        Log.i(`spoof TelephonyManager.getSimSerialNumber: ${_simSerialNumber} -> ${simSerialNumber}`)
-        return simSerialNumber
-    }
-
-    TelephonyManager.getSubscriberId.overload().implementation = function () {
-        const _imsi = this.getSubscriberId()
-        Log.i(`spoof TelephonyManager.getSubscriberId: ${_imsi} -> ${imsi}`)
-        return imsi
-    }
-
-    TelephonyManager.getImei.overload().implementation = function () {
-        const _imei = this.getImei()
-        Log.i(`spoof TelephonyManager.getImei: ${_imei} -> ${imei}`)
-        return imei
-    }
-
-    TelephonyManager.getNetworkCountryIso.overload().implementation = function () {
-        const _countryIso = this.getNetworkCountryIso()
-        Log.i(`spoof TelephonyManager.getNetworkCountryIso: ${_countryIso} -> ${countryIso}`)
-        return countryIso
-    }
-
-    TelephonyManager.getSimCountryIso.overload().implementation = function () {
-        const _countryIso = this.getSimCountryIso()
-        Log.i(`spoof TelephonyManager.getSimCountryIso: ${_countryIso} -> ${countryIso}`)
-        return countryIso
-    }
-
-    // TelephonyManager.getSubscriptionId.overload().implementation = function () {
-    //     const _subId = this.getSubscriptionId()
-    //     if (!subId) {
-    //         Log.i(_subId)
-    //         return _subId
-    //     }
-    //     Log.i(`spoof TelephonyManager.getSubscriptionId: ${_subId} -> ${subId}`)
-    //     return parseInt(subId)
-    // }
-
-    TelephonyManager.getSimState.overload().implementation = function () {
-        const _simState = this.getSimState()
-        Log.i(`spoof TelephonyManager.getSimState: ${_simState} -> 5`)
-        return 5
-    }
-
     const PhoneNumberVerification = Java.use('com.google.android.gms.constellation.PhoneNumberVerification')
     PhoneNumberVerification.$init.overload(
         'java.lang.String',
@@ -409,6 +70,7 @@ Java.perform(function () {
     ).implementation = function (str, j, idTokenRequest, bundle, list, z, i, list2) {
         Log.e(`VerifyPhoneNumberRequest.$init(
             str=${str}, j=${j}, idTokenRequest=${idTokenRequest}, bundle=${bundle}, list=${list}, z=${z}, i=${i}, list2=${list2})`)
+        trace()
         // print bundle
         const keySet = bundle.keySet().toArray()
         for (let i = 0; i < keySet.length; i++) {
@@ -483,403 +145,9 @@ Java.perform(function () {
         return this.$init(i, str, str2)
     }
 
-    try {
-        const amac = Java.use('amac')
-        const amlo = Java.use('amlo')
-        const emiy = Java.use('emiy')
-        const emiz = Java.use('emiz')
-        const emis = Java.use('emis')
-        const fiwu = Java.use('fiwu')
-        const ambs = Java.use('ambs')
-        const emkm = Java.use('emkm')
-        const fivh = Java.use('fivh')
-        const fivk = Java.use('fivk')
-        const fivn = Java.use('fivn')
-        const emjr = Java.use('emjr')
-        const amag = Java.use('amag')
-        const ftha = Java.use('ftha')
-        const ftgy = Java.use('ftgy')
-        const fuem = Java.use('fuem')
-        const fiwt = Java.use('fiwt')
-        const TimeUnit = Java.use('java.util.concurrent.TimeUnit')
-        const ambi = Java.use('ambi')
-        const fivj = Java.use('fivj')
-        amac.o.overload('amlu', 'boolean', 'boolean', 'fiwt').implementation = function (amluVar, z, z2, fiwtVar) {
-            Log.e(` amac.o(amluVar=${dump(amluVar)}, z=${z}, z2=${z2}, fiwtVar=${dump(fiwtVar)})`)
-            try {
-                var z3
-                var z4
-                const eq = fiwtVar.eQ()
-                const arr0 = Java.array('java.lang.Object', [this.z(eq)])
-                this._a.value.d('SetConsentRequest: %s', arr0)
-
-                var amloVar = this._d.value
-                var emiyVar = Java.cast(emiz.h.value.eV(), emiy)
-
-                if (!emiyVar._b.value.fm()) {
-                    emiyVar.O()
-                }
-                var emizVar = Java.cast(emiyVar._b.value, emiz)
-                emizVar.b = emkm.a(10)
-                Log.i(emizVar, emizVar.b, emizVar.a)
-
-                emizVar.a = emizVar.a | 1
-                var eV = emis.d.value.eV()
-
-                if ((fiwtVar.a.value & 2) != 0) {
-                    var fivnVar = fiwtVar.e.value
-                    if (fivnVar == null) {
-                        fivnVar = fivn.c.value
-                    }
-                    var b = fivh.b(fivnVar.a.value)
-                    if (b == 0) {
-                        z3 = false
-                    } else if (b == 3) {
-                        z3 = true
-                    } else {
-                        z3 = false
-                    }
-                    if (!eV._b.value.fm()) {
-                        eV.O()
-                    }
-                    var fbzbVar = eV._b.value
-                    var emisVar = Java.cast(fbzbVar, emis)
-                    emisVar.a |= 1
-                    emisVar.b = z3
-                    var fivnVar2 = fiwtVar.e.value
-                    if (fivnVar2 == null) {
-                        fivnVar2 = fivn.c.value
-                    }
-                    var a2 = fivk.a(fivnVar2.b.value)
-                    if (a2 == 0) {
-                        z4 = false
-                    } else if (a2 == 3) {
-                        z4 = true
-                    } else {
-                        z4 = false
-                    }
-                    if (!fbzbVar.fm()) {
-                        eV.O()
-                    }
-                    var emisVar2 = Java.cast(eV._b.value, emis)
-                    emisVar2.a |= 2
-                    emisVar2.c = z4
-                }
-                if (!emiyVar._b.value.fm()) {
-                    emiyVar.O()
-                }
-                var emizVar2 = Java.cast(emiyVar._b.value, emiz)
-                var emisVar3 = Java.cast(eV.K(), emis)
-                emisVar3.getClass()
-                emizVar2.c = emisVar3
-                emizVar2.a |= 2
-                amloVar.A(amluVar, emjr.b(5), Java.cast(emiyVar.K(), emiz))
-
-                var v = this.v()
-                var akxiVar = this._c.value
-                var j = this._e.value
-                if (amag._a.value == null) {
-                    amag._a.value = ftha.b(
-                        ftgy._a.value,
-                        'google.internal.communications.phonedeviceverification.v1.PhoneDeviceVerification/SetConsent',
-                        fuem.a(fiwt.k.value),
-                        fuem.a(fiwu.a.value)
-                    )
-                }
-                // const vdg = v.d.value.g(
-                //     amag._a.value,
-                //     akxiVar,
-                //     fiwtVar,
-                //     Java.use('java.lang.Long').valueOf(j).longValue(),
-                //     TimeUnit.MILLISECONDS.value,
-                //     v.e.value
-                // )
-                // Log.i("aaaaa")
-                // const eqres = Java.cast(vdg, fiwu).eQ()
-                // Log.i("bbbbb")
-                // const res = this.z(eqres)
-                // Log.i("SetConsentResponse: ", res)
-                // const arr = Java.array("java.lang.Object", [res])
-                // this._a.value.d("SetConsentResponse: %s", arr)
-                var amloVar2 = this._d.value
-                var emiyVar2 = Java.cast(emiz.h.value.eV(), emiy)
-                if (!emiyVar2._b.value.fm()) {
-                    emiyVar2.O()
-                }
-                var emizVar3 = Java.cast(emiyVar2._b.value, emiz)
-
-                emizVar3.b = emkm.a(10)
-                emizVar3.a |= 1
-                amloVar2.A(amluVar, emjr.b(6), Java.cast(emiyVar2.K(), emiz))
-                var a3 = ambi.b().a(this._b.value.getApplicationContext())
-                a3.n(z)
-                a3.m(Java.use('java.lang.Boolean').valueOf(z2))
-                var b2 = fivj.b(fiwtVar.g.value)
-                if (b2 == 0) {
-                    b2 = 1
-                }
-                var a4 = fivj.a(b2)
-                var edit = Java.cast(a3, ambs)._c.value.edit()
-                edit.putInt('device_consent_version', a4)
-                edit.apply()
-                Log.i('oooooooooo')
-            } catch (e) {
-                Log.i('2222222', e)
-                trace()
-            }
-            // this.o(amluVar, z, z2, fiwtVar)
-        }
-    } catch (error) {}
-
-    const alyx = Java.use('alyx')
-    alyx.a.overload('fixf').implementation = function (fixf) {
-        const b = this.a(fixf)
-        const keySet = b.keySet().toArray()
-        for (let i = 0; i < keySet.length; i++) {
-            const key = keySet[i]
-            Log.w(`alyx.a::key: ${key}, value: ${b.get(key)}`)
-        }
-        return b
-    }
-    alyx.m.overload('amlu', 'java.util.List').implementation = function (amlu, list) {
-        const a = amlu._a.value // string
-        const f = amlu.f.value // string
-        const g = amlu.g.value // list
-        const h = amlu.h.value // list
-        const HashMap = Java.use('java.util.HashMap')
-        const d = Java.cast(amlu.d.value, HashMap) // map
-        const e = Java.cast(amlu.e.value, HashMap) // map
-
-        Log.e(
-            `alyx.m(${JSON.stringify({
-                a,
-                f,
-                g: g ? JSON.parse(dump(g)) : null,
-                h: h ? JSON.parse(dump(h)) : null,
-                d: d ? JSON.parse(dump(d)) : null,
-                e: e ? JSON.parse(dump(e)) : null
-            })})`
-        )
-
-        const res = this.m(amlu, list)
-        Log.e(`alyx.m res: ${dump(res)}`)
-        return res
-    }
-    alyx.r.overload('amlu', 'java.util.List', 'java.lang.String', 'java.lang.String').implementation = function (
-        amlu,
-        list,
-        str,
-        str2
-    ) {
-        Log.e(
-            `alyx.r(${JSON.stringify({
-                amlu: dumpJson(amlu),
-                list: dumpJson(list),
-                str,
-                str2
-            })})`
-        )
-        try {
-            const res = this.r(amlu, list, str, str2)
-            Log.e(`alyx.r res: ${res}`)
-            return res
-        } catch (error) {
-            Log.e(`alyx.r error: ${error}`)
-        }
-        return false
-    }
-
-    alyx.x.overload('amlu', 'java.util.List').implementation = function (amlu, list) {
-        const res = this.x(amlu, list)
-        Log.e(`alyx.x(
-                amlu=${dump(amlu)},
-                list=${dump(list)})
-                => ${dump(res)}`)
-        return res
-    }
-
-    //amlu amluVar, fixf fixfVar, ammt ammtVar
-    alyx.e.overload('amlu', 'fixf', 'ammt').implementation = function (amlu, fixf, ammt) {
-        const res = this.e(amlu, fixf, ammt)
-        Log.e(`alyx.e(
-                amlu=${dump(amlu)},
-                fixf=${dump(fixf)},
-                ammt=${dump(ammt)}) 
-                => ${dump(res)}`)
-        return res
-    }
-
-    // alyx.v.overload("amlu", "java.util.List").implementation = function (
-    //     amlu,
-    //     list
-    // ) {
-    //     const res = this.v(amlu, list)
-    //     Log.e(`alyx.v(
-    //         amlu=${dump(amlu)},
-    //         list=${dump(list)})
-    //         => ${dump(res)}`)
-    //     trace()
-    //     return res
-    // }
-
-    const ftit = Java.use('ftit')
-    const ftgv = Java.use('ftgv')
-    ftit.h.overload('ftgv').implementation = function (ftgvVar) {
-        try {
-            Log.e(`ftit.h(
-                    this=${dump(this)},
-                    ftgvVar=${dump(ftgvVar)})`)
-            return Java.use('ftiu').$new(this, ftgvVar)
-        } catch (e) {
-            e.printStackTrace()
-            Log.e(`ftit.h exception: ${e}`)
-        }
-    }
-
-    const Secure = Java.use('android.provider.Settings$Secure')
-    Secure.getString.overload('android.content.ContentResolver', 'java.lang.String').implementation = function (
-        contentResolver,
-        str
-    ) {
-        const _str = this.getString(contentResolver, str)
-        if (str === 'android_id') {
-            Log.w(`spoof Secure.getString(android_id): ${_str} -> ${androidId}`)
-            return androidId
-        }
-        return _str
-    }
-
-    const Build = Java.use('android.os.Build')
-    Build.getString.overload('java.lang.String').implementation = function (str) {
-        const _str = this.getString(str)
-        Log.w(`Build.getString(${str}): ${_str}`)
-        return _str
-    }
-
-    Build.getSerial.overload().implementation = function () {
-        const _serial = this.getSerial()
-        Log.w(`spoof Build.getSerial: ${_serial} -> ${serialNumber}`)
-        return serialNumber
-    }
-
-    const SystemProperties = Java.use('android.os.SystemProperties')
-    const props = []
-    SystemProperties.get.overload('java.lang.String').implementation = function (str) {
-        const _str = this.get(str)
-        Log.w(`SystemProperties.get(${str}): ${_str}`)
-        return _str
-    }
-    SystemProperties.get.overload('java.lang.String', 'java.lang.String').implementation = function (str, str2) {
-        const _str = this.get(str, str2)
-        if ('ro.boot.vr' === str) return _str
-
-        // if ('ro.vendor.build.fingerprint' === str) {
-        //     Log.w(`spoof SystemProperties.get(${str}, ${str2}): ${_str} -> fingerprint`)
-        //     return 'google/redfin/redfin:11/RQ3A.210905.001/7511028:user/release-keys'
-        // }
-        // if ('ro.kernel.qemu' === str) {
-        //     Log.w(`spoof SystemProperties.get(${str}, ${str2}): ${_str} -> 0`)
-        //     return '0'
-        // }
-        // if ('ro.product.device' === str) {
-        //     Log.w(`spoof SystemProperties.get(${str}, ${str2}): ${_str} -> redfin`)
-        //     return 'redfin'
-        // }
-        // if ('ro.board.platform' === str) {
-        //     Log.w(`spoof SystemProperties.get(${str}, ${str2}): ${_str} -> redfin`)
-        //     return 'redfin'
-        // }
-
-        Log.w(`SystemProperties.get(${str}, ${str2}): ${_str}`)
-        return _str
-    }
-    SystemProperties.getInt.overload('java.lang.String', 'int').implementation = function (str, i) {
-        const _i = this.getInt(str, i)
-        if ('ro.boot.flash.locked' === str) {
-            Log.w(`spoof SystemProperties.get(${str}, ${i}): ${_i} -> 1`)
-            return 1
-        }
-        Log.w(`SystemProperties.getInt(${str}, ${i}): ${_i}`)
-        return _i
-    }
-    SystemProperties.getLong.overload('java.lang.String', 'long').implementation = function (str, l) {
-        const _l = this.getLong(str, l)
-        Log.w(`SystemProperties.getLong(${str}, ${l}): ${_l}`)
-        return _l
-    }
-    SystemProperties.getBoolean.overload('java.lang.String', 'boolean').implementation = function (str, z) {
-        const _z = this.getBoolean(str, z)
-        Log.w(`SystemProperties.getBoolean(${str}, ${z}): ${_z}`)
-        return _z
-    }
-    // const OSBuild = Java.use('android.os.Build')
-    // OSBuild.PRODUCT.value = 'redfin'
-    // OSBuild.DEVICE.value = 'redfin'
-    // OSBuild.MANUFACTURER.value = 'Google'
-    // OSBuild.BOARD.value = 'redfin'
-    // OSBuild.BRAND.value = 'google'
-    // OSBuild.MODEL.value = 'Pixel 5'
-    // OSBuild.FINGERPRINT.value = 'google/redfin/redfin:11/RQ3A.210905.001/7511028:user/release-keys'
-    // OSBuild.TYPE.value = 'user'
-    // OSBuild.TAGS.value = 'release-keys'
-
-    const alzg = Java.use('alzg')
-    alzg.d.overload(
-        // boolean, map
-        'boolean',
-        'java.util.Map'
-    ).implementation = function (z, map) {
-        Log.e(`alzg.d(z=${z}, map=${dump(map)})`)
-        return this.d(z, map)
-    }
-
-    // const ammv = Java.use("ammv")
-    // ammv.a.overload(
-    //     // amlu amluVar, fixf fixfVar, ammt ammtVar, ammi ammiVar
-    //     "amlu",
-    //     "fixf",
-    //     "ammt",
-    //     "ammi"
-    // ).implementation = function (amlu, fixf, ammt, ammi) {
-    //     Log.e(`ammv.a(
-    //         amlu=${dump(amlu)},
-    //         fixf=${dump(fixf)},
-    //         ammt=${dump(ammt)},
-    //         ammi=${dump(ammi)})`)
-    //     trace()
-    //     return this.a(amlu, fixf, ammt, ammi)
-    // }
-
-    // const amag = Java.use("amag")
-    // amag.b.overload(
-    //     // akxi akxiVar, fiwx fiwxVar, long j
-    //     "akxi",
-    //     "fiwx",
-    //     "long"
-    // ).implementation = function (akxi, fiwx, j) {
-    //     Log.e(`amag.b(
-    //         akxi=${dump(akxi)},
-    //         fiwx=${dump(fiwx)},
-    //         j=${j})`)
-    //     trace()
-    //     return this.b(akxi, fiwx, j)
-    // }
-
-    // const Configuration = Java.use(
-    //     "com.google.android.ims.provisioning.config.Configuration"
-    // )
-    // Configuration.k.overload().implementation = function () {
-    //     Log.e(`Configuration.k() ${dump(this)}`)
-    //     return this.k()
-    // }
-
-    const amky = Java.use('amky')
-    amky.a.overload('android.content.Context', 'java.lang.String', 'java.lang.String').implementation = function (
-        context,
-        str,
-        str2
-    ) {
-        Log.e(`amky.a(${str}, ${str2})`)
-        return this.a(context, str, str2)
+    const EventManager = Java.use('com.google.android.gms.constellation.EventManager')
+    EventManager.onHandleIntent.overload('android.content.Intent').implementation = function (intent) {
+        Log.i('EventManager.onHandleIntent(intent)')
+        return this.onHandleIntent(intent)
     }
 })

+ 97 - 0
scripts/spoof_phone.js

@@ -0,0 +1,97 @@
+class Log {
+    static TAG = '[Phone]'
+    static Debug = true
+    static format(...msg) {
+        let m = []
+        for (let i = 0; i < msg.length; i++) {
+            if (typeof msg[i] === 'object') {
+                m.push(JSON.stringify(msg[i]))
+            } else {
+                m.push(msg[i])
+            }
+        }
+        m = m.join(' ')
+        return m
+    }
+    static i(...msg) {
+        if (!this.Debug) return
+        console.log(`\x1b[30m${this.TAG} ${this.format(...msg)}\x1b[0m`)
+    }
+    static w(...msg) {
+        console.log(`\x1b[33m${this.TAG} ${this.format(...msg)}\x1b[0m`)
+    }
+    static e(...msg) {
+        console.log(`\x1b[31m${this.TAG} ${this.format(...msg)}\x1b[0m`)
+    }
+    static s(...msg) {
+        console.log(`\x1b[32m${this.TAG} ${this.format(...msg)}\x1b[0m`)
+    }
+}
+
+function trace(tag) {
+    Log.e((tag || '') + Java.use('android.util.Log').getStackTraceString(Java.use('java.lang.Throwable').$new()))
+}
+
+setImmediate(() => {
+    Java.perform(function () {
+        const SmsController = Java.use('com.android.internal.telephony.SmsController')
+        Log.i('SmsController:', SmsController)
+        SmsController.sendTextForSubscriber.overload(
+            // int subId, String callingPackage,
+            // String callingAttributionTag, String destAddr, String scAddr, String text,
+            // PendingIntent sentIntent, PendingIntent deliveryIntent,
+            // boolean persistMessageForNonDefaultSmsApp, long messageId
+            'int',
+            'java.lang.String',
+            'java.lang.String',
+            'java.lang.String',
+            'java.lang.String',
+            'java.lang.String',
+            'android.app.PendingIntent',
+            'android.app.PendingIntent',
+            'boolean',
+            'long'
+        ).implementation = function (
+            subId,
+            callingPackage,
+            callingAttributionTag,
+            destAddr,
+            scAddr,
+            text,
+            sentIntent,
+            deliveryIntent,
+            persistMessageForNonDefaultSmsApp,
+            messageId
+        ) {
+            Log.i('sendTextForSubscriber', subId, callingPackage, callingAttributionTag, destAddr, scAddr, text)
+            return this.sendTextForSubscriber(
+                subId,
+                callingPackage,
+                callingAttributionTag,
+                destAddr,
+                scAddr,
+                text,
+                sentIntent,
+                deliveryIntent,
+                persistMessageForNonDefaultSmsApp,
+                messageId
+            )
+        }
+
+        const RcsFeatureConnection = Java.use('com.android.ims.RcsFeatureConnection')
+        Log.i('RcsFeatureConnection:', RcsFeatureConnection)
+        const RcsFeatureManager = Java.use('com.android.ims.RcsFeatureManager')
+        Log.i('RcsFeatureManager:', RcsFeatureManager)
+
+        const PhoneGlobals = Java.use('com.android.phone.PhoneGlobals')
+        Log.i('PhoneGlobals:', PhoneGlobals)
+
+        const RcsProvisioningMonitor = Java.use('com.android.phone.RcsProvisioningMonitor')
+        Log.i('RcsProvisioningMonitor:', RcsProvisioningMonitor)
+
+        RcsProvisioningMonitor.requestReconfig.overload('int').implementation = function (subId) {
+            Log.i('requestReconfig', subId)
+            return this.requestReconfig(subId)
+        }
+    })
+})

+ 23 - 479
scripts/spoof_sms.js

@@ -1,15 +1,3 @@
-const mcc = '{{mcc}}'
-const mnc = '{{mnc}}'
-const simOperator = '{{simOperator}}'
-const networkOperator = '{{networkOperator}}'
-const simSerialNumber = '{{simSerialNumber}}'
-const iccId = '{{iccId}}'
-const number = '{{number}}'
-const imei = '{{imei}}'
-const imsi = '{{imsi}}'
-const countryIso = '{{countryIso}}'
-const subId = '{{subId}}'
-
 class Log {
     static TAG = '[SMS]'
     static Debug = true
@@ -46,454 +34,32 @@ function trace(tag) {
 
 setImmediate(() => {
     Java.perform(function () {
-        const SmsManager = Java.use('android.telephony.SmsManager')
-        SmsManager.getSmsManagerForSubscriptionId.overload('int').implementation = function (i) {
-            const _smsManager = this.getSmsManagerForSubscriptionId(i)
-            Log.i(`SmsManager.getSmsManagerForSubscriptionId: ${i}`)
-            return _smsManager
-        }
-
-        SmsManager.getDefault.overload().implementation = function () {
-            const _smsManager = this.getDefault(i)
-            Log.i(`SmsManager.getDefault`)
-            return _smsManager
-        }
-
-        // SmsManager.getDefaultSmsSubscriptionId.overload().implementation =
-        //     function () {
-        //         const _subId = this.getDefaultSmsSubscriptionId()
-        //         Log.i(
-        //             `spoof SmsManager.getDefaultSmsSubscriptionId: ${_subId} -> ${subId}`
-        //         )
-        //         return parseInt(subId)
-        //     }
-
-        // SmsManager.getSubscriptionId.overload().implementation = function () {
-        //     const _subId = this.getSubscriptionId()
-        //     Log.i(`SmsManager.getSubscriptionId: ${_subId} -> ${subId}`)
-        //     return parseInt(subId)
-        // }
-        SmsManager.getCarrierConfigValues.overload().implementation = function () {
-            const _config = this.getCarrierConfigValues()
-            Log.i(`SmsManager.getCarrierConfigValues: ${_config}`)
-            return _config
-        }
-
-        const CarrierConfigManager = Java.use('android.telephony.CarrierConfigManager')
-        CarrierConfigManager.getConfigForSubId.overload('int').implementation = function (i) {
-            const _config = this.getConfigForSubId(i)
-            Log.i(`CarrierConfigManager.getConfigForSubId: ${i}`)
-            return _config
-        }
-
-        const SubscriptionManager = Java.use('android.telephony.SubscriptionManager')
-        SubscriptionManager.getActiveSubscriptionInfoCount.overload().implementation = function () {
-            const _count = this.getActiveSubscriptionInfoCount()
-            Log.i(`SubscriptionManager.getActiveSubscriptionInfoCount: ${_count}`)
-            return _count
-        }
-        // SubscriptionManager.getDefaultSubscriptionId.overload().implementation =
-        //     function () {
-        //         const _subId = this.getDefaultSubscriptionId()
-        //         Log.i(
-        //             `spoof SubscriptionManager.getDefaultSubscriptionId: ${_subId} -> ${subId}`
-        //         )
-        //         return parseInt(subId)
-        //     }
-        // SubscriptionManager.getDefaultSmsSubscriptionId.overload().implementation =
-        //     function () {
-        //         const _subId = this.getDefaultSmsSubscriptionId()
-        //         Log.i(
-        //             `spoof SubscriptionManager.getDefaultSmsSubscriptionId: ${_subId} -> ${subId}`
-        //         )
-        //         return parseInt(subId)
-        //     }
-        // SubscriptionManager.getDefaultVoiceSubscriptionId.overload().implementation =
-        //     function () {
-        //         const _subId = this.getDefaultVoiceSubscriptionId()
-        //         Log.i(
-        //             `spoof SubscriptionManager.getDefaultVoiceSubscriptionId: ${_subId} -> ${subId}`
-        //         )
-        //         return parseInt(subId)
-        //     }
-        // SubscriptionManager.getActiveDataSubscriptionId.overload().implementation =
-        //     function () {
-        //         const _subId = this.getActiveDataSubscriptionId()
-        //         Log.i(
-        //             `spoof SubscriptionManager.getActiveDataSubscriptionId: ${_subId} -> ${subId}`
-        //         )
-        //         return parseInt(subId)
-        //     }
-        // SubscriptionManager.getSlotIndex.overload("int").implementation =
-        //     function (i) {
-        //         const _slotIndex = this.getSlotIndex(i)
-        //         Log.i(
-        //             `spoof SubscriptionManager.getSlotIndex: ${_slotIndex} -> 0`
-        //         )
-        //         return 0
-        //     }
-        // SubscriptionManager.isUsableSubscriptionId.overload(
-        //     "int"
-        // ).implementation = function (i) {
-        //     const _isUsable = this.isUsableSubscriptionId(i)
-        //     Log.i(`SubscriptionManager.isUsableSubscriptionId: ${_isUsable}`)
-        //     return _isUsable
-        // }
-        // SubscriptionManager.isValidSubscriptionId.overload(
-        //     "int"
-        // ).implementation = function (i) {
-        //     const _isValid = this.isValidSubscriptionId(i)
-        //     Log.i(
-        //         `spoof SubscriptionManager.isValidSubscriptionId(${i}): ${_isValid} -> true`
-        //     )
-        //     return true
-        // }
-        SubscriptionManager.getPhoneNumber.overload('int').implementation = function (i) {
-            Log.i(`spoof SubscriptionManager.getPhoneNumber(${i}): -> ${number}`)
-            return number
-        }
-        SubscriptionManager.getPhoneNumber.overload('int', 'int').implementation = function (i, i2) {
-            Log.i(`spoof SubscriptionManager.getPhoneNumber(${i},${i2}): -> ${number}`)
-            return number
-        }
-        // SubscriptionManager.getActiveSubscriptionInfoList.overload().implementation =
-        //     function () {
-        //         const _list = this.getActiveSubscriptionInfoList()
-        //         Log.i(
-        //             `SubscriptionManager.getActiveSubscriptionInfoList ${_list.size()}`
-        //         )
-        //         return _list
-        //     }
-        // SubscriptionManager.getActiveSubscriptionIdList.overload().implementation =
-        //     function () {
-        //         const _list = this.getActiveSubscriptionIdList()
-        //         Log.i(
-        //             `spoof SubscriptionManager.getActiveSubscriptionIdList ${_list} -> ${subId}`
-        //         )
-        //         return [parseInt(subId)]
-        //     }
-        // SubscriptionManager.getActiveSubscriptionInfo.overload(
-        //     "int"
-        // ).implementation = function (i) {
-        //     const _info = this.getActiveSubscriptionInfo(i)
-
-        //     const simCount = this.getActiveSubscriptionInfoCountMax()
-
-        //     let subInfo = null
-        //     try {
-        //         for (let i = 0; i < simCount; i++) {
-        //             subInfo = this.getActiveSubscriptionInfoForSimSlotIndex(i)
-        //             if (subInfo) {
-        //                 break
-        //             }
-        //         }
-        //         Log.i(
-        //             `spoof SubscriptionManager.getActiveSubscriptionInfo(${i})`
-        //         )
-        //     } catch (error) {
-        //         console.error(
-        //             `spoof error SubscriptionManager.getActiveSubscriptionInfo(${i})`
-        //         )
-        //         error.printStackTrace()
-        //     }
-        //     return subInfo
-        // }
-        // SubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex.overload(
-        //     "int"
-        // ).implementation = function (i) {
-        //     const _info = this.getActiveSubscriptionInfoForSimSlotIndex(i)
-        //     Log.i(
-        //         `SubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex(${i}): ${
-        //             _info ? "ok" : "null"
-        //         }`
-        //     )
-        //     return _info
-        // }
-        // SubscriptionManager.isActiveSubscriptionId.overload(
-        //     "int"
-        // ).implementation = function (i) {
-        //     const _isActive = this.isActiveSubscriptionId(i)
-        //     Log.i(
-        //         `spoof SubscriptionManager.isActiveSubscriptionId(${i}): ${_isActive} -> true`
-        //     )
-        //     return true
-        // }
-
-        const SubscriptionInfo = Java.use('android.telephony.SubscriptionInfo')
-        SubscriptionInfo.getMcc.overload().implementation = function () {
-            const _mcc = this.getMcc()
-            Log.i(`spoof SubscriptionInfo.getMcc: ${_mcc} -> ${mcc}`)
-            return parseInt(mcc)
-        }
-
-        SubscriptionInfo.getMnc.overload().implementation = function () {
-            const _mnc = this.getMnc()
-            Log.i(`spoof SubscriptionInfo.getMnc: ${_mnc} -> ${mnc}`)
-            return parseInt(mnc)
-        }
-
-        SubscriptionInfo.getMccString.overload().implementation = function () {
-            const _mccString = this.getMccString()
-            Log.i(`spoof SubscriptionInfo.getMccString: ${_mccString} -> ${mcc}`)
-            return mcc
-        }
-
-        SubscriptionInfo.getMncString.overload().implementation = function () {
-            const _mncString = this.getMncString()
-            Log.i(`spoof SubscriptionInfo.getMncString: ${_mncString} -> ${mnc}`)
-            return mnc
-        }
-
-        SubscriptionInfo.getNumber.overload().implementation = function () {
-            const _number = this.getNumber()
-            Log.i(`spoof SubscriptionInfo.getNumber: ${_number} -> ${number}`)
-            return number
-        }
-
-        SubscriptionInfo.getIccId.overload().implementation = function () {
-            const _iccId = this.getIccId()
-            Log.i(`spoof SubscriptionInfo.getIccId: ${_iccId} -> ${iccId}`)
-            return iccId
-        }
-
-        SubscriptionInfo.getCountryIso.overload().implementation = function () {
-            const _countryIso = this.getCountryIso()
-            Log.i(`spoof SubscriptionInfo.getCountryIso: ${_countryIso} -> ${countryIso}`)
-            return countryIso
-        }
-
-        // SubscriptionInfo.getSubscriptionId.overload().implementation =
-        //     function () {
-        //         const _subId = this.getSubscriptionId()
-        //         if (!subId) {
-        //             Log.i(_subId)
-        //             return _subId
-        //         }
-        //         Log.i(
-        //             `spoof SubscriptionInfo.getSubscriptionId: ${_subId} -> ${subId}`
-        //         )
-        //         return parseInt(subId)
-        //     }
-
-        const TelephonyManager = Java.use('android.telephony.TelephonyManager')
-        // TelephonyManager.createForSubscriptionId.overload(
-        //     "int"
-        // ).implementation = function (i) {
-        //     Log.i(`spoof TelephonyManager.createForSubscriptionId: ${i}`)
-        //     return this
-        // }
-        TelephonyManager.getLine1Number.overload().implementation = function () {
-            const _number = this.getLine1Number()
-            Log.i(`spoof TelephonyManager.getLine1Number: ${_number} -> ${number}`)
-            return number
-        }
-
-        TelephonyManager.getSimOperator.overload().implementation = function () {
-            const _simOperator = this.getSimOperator()
-            Log.i(`spoof TelephonyManager.getSimOperator: ${_simOperator} -> ${simOperator}`)
-            return simOperator
-        }
-
-        TelephonyManager.getNetworkOperator.overload().implementation = function () {
-            const _networkOperator = this.getNetworkOperator()
-            Log.i(`spoof TelephonyManager.getNetworkOperator: ${_networkOperator} -> ${networkOperator}`)
-            return networkOperator
-        }
-
-        TelephonyManager.getSimSerialNumber.overload().implementation = function () {
-            const _simSerialNumber = this.getSimSerialNumber()
-            Log.i(`spoof TelephonyManager.getSimSerialNumber: ${_simSerialNumber} -> ${simSerialNumber}`)
-            return simSerialNumber
-        }
-
-        TelephonyManager.getSubscriberId.overload().implementation = function () {
-            const _imsi = this.getSubscriberId()
-            Log.i(`spoof TelephonyManager.getSubscriberId: ${_imsi} -> ${imsi}`)
-            return imsi
-        }
-
-        TelephonyManager.getImei.overload().implementation = function () {
-            const _imei = this.getImei()
-            Log.i(`spoof TelephonyManager.getImei: ${_imei} -> ${imei}`)
-            return imei
-        }
-
-        TelephonyManager.getNetworkCountryIso.overload().implementation = function () {
-            const _countryIso = this.getNetworkCountryIso()
-            Log.i(`spoof TelephonyManager.getNetworkCountryIso: ${_countryIso} -> ${countryIso}`)
-            return countryIso
-        }
-
-        TelephonyManager.getSimCountryIso.overload().implementation = function () {
-            const _countryIso = this.getSimCountryIso()
-            Log.i(`spoof TelephonyManager.getSimCountryIso: ${_countryIso} -> ${countryIso}`)
-            return countryIso
-        }
-
-        // TelephonyManager.getSubscriptionId.overload().implementation =
-        //     function () {
-        //         const _subId = this.getSubscriptionId()
-        //         if (!subId) {
-        //             Log.i(_subId)
-        //             return _subId
-        //         }
-        //         Log.i(
-        //             `spoof TelephonyManager.getSubscriptionId: ${_subId} -> ${subId}`
-        //         )
-        //         return parseInt(subId)
-        //     }
+        const PhoneNumberVerification = Java.use('com.google.android.gms.constellation.PhoneNumberVerification')
+        PhoneNumberVerification.$init.overload(
+            'java.lang.String',
+            'long',
+            'int',
+            'int',
+            'java.lang.String',
+            'android.os.Bundle',
+            'int',
+            'long'
+        ).implementation = function (str, l, i, i2, str2, bundle, i3, l2) {
+            Log.i('PhoneNumberVerification.$init')
+
+            Log.i(`str: ${str}, l: ${l}, i: ${i}, i2: ${i2}, str2: ${str2}, i3: ${i3}, l2: ${l2}`)
+            // print bundle
+            if (bundle) {
+                const keySet = bundle.keySet().toArray()
+                for (let i = 0; i < keySet.length; i++) {
+                    const key = keySet[i]
+                    Log.i(`key: ${key}, value: ${bundle.get(key)}`)
+                }
+            }
 
-        TelephonyManager.getSimState.overload().implementation = function () {
-            const _simState = this.getSimState()
-            Log.i(`spoof TelephonyManager.getSimState: ${_simState} -> 5`)
-            return 5
+            return this.$init(str, l, i, i2, str2, bundle, i3, l2)
         }
 
-        // const PhoneNumberVerification = Java.use(
-        //     "com.google.android.gms.constellation.PhoneNumberVerification"
-        // )
-        // PhoneNumberVerification.$init.overload(
-        //     "java.lang.String",
-        //     "long",
-        //     "int",
-        //     "int",
-        //     "java.lang.String",
-        //     "android.os.Bundle",
-        //     "int",
-        //     "long"
-        // ).implementation = function (str, l, i, i2, str2, bundle, i3, l2) {
-        //     Log.i("PhoneNumberVerification.$init")
-
-        //     Log.i(
-        //         `str: ${str}, l: ${l}, i: ${i}, i2: ${i2}, str2: ${str2}, i3: ${i3}, l2: ${l2}`
-        //     )
-        //     // print bundle
-        //     if (bundle) {
-        //         const keySet = bundle.keySet().toArray()
-        //         for (let i = 0; i < keySet.length; i++) {
-        //             const key = keySet[i]
-        //             Log.i(`key: ${key}, value: ${bundle.get(key)}`)
-        //         }
-        //     }
-
-        //     return this.$init(str, l, i, i2, str2, bundle, i3, l2)
-        // }
-
-        // // const aays = Java.use("aays")
-        // // aays.d.overload("int", "boolean").implementation = function (i, z) {
-        // //     Log.i("aays.d", i, z, Object.keys(this.f.value))
-
-        // //     return number
-        // // }
-
-        // const SetAsterismConsentRequest = Java.use(
-        //     "com.google.android.gms.asterism.SetAsterismConsentRequest"
-        // )
-        // SetAsterismConsentRequest.$init.overload(
-        //     "int",
-        //     "int",
-        //     "int",
-        //     "[I",
-        //     "java.lang.Long",
-        //     "int",
-        //     "android.os.Bundle",
-        //     "int",
-        //     "java.lang.String",
-        //     "java.lang.String",
-        //     "java.lang.String",
-        //     "java.lang.String",
-        //     "java.lang.String",
-        //     "java.lang.String",
-        //     "java.lang.String",
-        //     "java.lang.String"
-        // ).implementation = function (
-        //     i,
-        //     i2,
-        //     i3,
-        //     iArr,
-        //     l,
-        //     i4,
-        //     bundle,
-        //     i5,
-        //     str,
-        //     str2,
-        //     str3,
-        //     str4,
-        //     str5,
-        //     str6,
-        //     str7,
-        //     str8
-        // ) {
-        //     Log.i(
-        //         Java.use("android.util.Log").getStackTraceString(
-        //             Java.use("java.lang.Throwable").$new()
-        //         )
-        //     )
-        //     Log.i("SetAsterismConsentRequest.$init")
-
-        //     Log.i(
-        //         `i: ${i}, i2: ${i2}, i3: ${i3}, iArr: ${iArr}, l: ${l}, i4: ${i4}, i5: ${i5}, str: ${str}, str2: ${str2}, str3: ${str3}, str4: ${str4}, str5: ${str5}, str6: ${str6}, str7: ${str7}, str8: ${str8}`
-        //     )
-        //     // print bundle
-        //     const keySet = bundle.keySet().toArray()
-        //     for (let i = 0; i < keySet.length; i++) {
-        //         const key = keySet[i]
-        //         Log.i(`key: ${key}, value: ${bundle.get(key)}`)
-        //     }
-
-        //     return this.$init(
-        //         i,
-        //         i2,
-        //         i3,
-        //         iArr,
-        //         l,
-        //         i4,
-        //         bundle,
-        //         i5,
-        //         str,
-        //         str2,
-        //         str3,
-        //         str4,
-        //         str5,
-        //         str6,
-        //         str7,
-        //         str8
-        //     )
-        // }
-
-        // const SetAsterismConsentResponse = Java.use(
-        //     "com.google.android.gms.asterism.SetAsterismConsentResponse"
-        // )
-        // SetAsterismConsentResponse.$init.overload(
-        //     "int",
-        //     "java.lang.String",
-        //     "java.lang.String"
-        // ).implementation = function (i, str, str2) {
-        //     Log.i(
-        //         Java.use("android.util.Log").getStackTraceString(
-        //             Java.use("java.lang.Throwable").$new()
-        //         )
-        //     )
-
-        //     Log.i("SetAsterismConsentResponse.$init")
-        //     Log.i(`i: ${i}, str: ${str}, str2: ${str2}`)
-        //     // return this.$init(
-        //     //     1,
-        //     //     "c4q5zP5Ft4A:APA91bEASr50HwwOY789LSZrcHPT8aG_fT19xlelS35qgIJeC3UBYypAHmmL9IygzlphzTKKz0wCdiQwuoPZMJKvgKPmGi3_imdr1CY0s7fs8qa_LMgNDFfvWEnpTCReAYc7IjThhFQq",
-        //     //     "c4q5zP5Ft4A"
-        //     // )
-        //     return this.$init(i, str, str2)
-        // }
-
-        // // spoof sim to exist
-        // const bjsf = Java.use("bjsf")
-        // bjsf.s.overload("android.content.Context").implementation = function (
-        //     c
-        // ) {
-        //     Log.i("bjsf.s spoof sim to exist")
-        //     return true
-        // }
-
         function printConfiguration(config) {
             JSON.stringify({
                 mDeviceId: config.mDeviceId.value,
@@ -605,27 +171,5 @@ setImmediate(() => {
             }
             return []
         }
-
-        const bjaq = Java.use('bjaq')
-        bjaq.f.overload('java.io.InputStream').implementation = function (inputStream) {
-            const res = this.f(inputStream)
-            Log.e(
-                `bjaq.f() => ${JSON.stringify({
-                    a: dumpList(res._a.value),
-                    b: dumpList(res._b.value),
-                    c: res._c.value
-                })}`
-            )
-            return res
-        }
-        bjaq.a.overload(
-            'java.io.InputStream',
-            'com.google.android.ims.provisioning.config.Configuration',
-            'boolean'
-        ).implementation = function (inputStream, configuration, z) {
-            trace('bjaq.a')
-            printConfiguration(configuration)
-            return this.a(inputStream, configuration, z)
-        }
     })
 })

+ 1 - 1
twilio.js

@@ -13,7 +13,7 @@
 import axios from 'axios'
 
 axios
-    .get('https://lookups.twilio.com/v1/PhoneNumbers/14014224597?CountryCode=US&Type=carrier', {
+    .get('https://lookups.twilio.com/v1/PhoneNumbers/14084220298?CountryCode=US&Type=carrier', {
         headers: {
             Authorization:
                 'Basic ' + btoa('ACf0d397ceb325114e435237056465b495' + ':' + 'c23f40f96b936e837bc6da105bf9150e')