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())) } const config = { "mcc": "310", "mnc": "240", "iccid": "15946952472810582287", "number": "3145612379", "imei": "011546001540649", "imsi": "310240325454398", "country": "us" } setImmediate(() => { Java.perform(function () { function checkPackage(name) { // return ( // name.startsWith('com.google.android.gsf') || // name.startsWith('com.google.android.gms') || // name.startsWith('com.google.android.apps') || // name.startsWith('com.example') // ) return true } const SubscriptionController = Java.use('com.android.internal.telephony.SubscriptionController') SubscriptionController.getSimStateForSlotIndex.overload('int').implementation = function (slotIndex) { const res = this.getSimStateForSlotIndex(slotIndex) Log.i(`spoof SubscriptionController.getSimStateForSlotIndex(${slotIndex}): ${res} -> 5`) return 5 } }) })