function trace(tag) { Log.e((tag || '') + Java.use('android.util.Log').getStackTraceString(Java.use('java.lang.Throwable').$new())) } class Log { static TAG = '[GMS]' static Debug = false static format(...msg) { let m = [] for (let i = 0; i < msg.length; i++) { if (typeof msg[i] === 'object') { m.push(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`) } } Java.perform(function () { const aoks = Java.use('aoks') const Bundle = Java.use('android.os.Bundle') aoks.d.overload('boolean', 'java.util.Map').implementation = function (b, map) { trace('aoks.d()') return this.d(b, map) } const Reiceiver = Java.use('com.google.android.gms.constellation.util.OnSyncCompletedListener$Receiver') Reiceiver.onReceiveResult.overload('int', 'android.os.Bundle').implementation = function (i, bundle) { Log.e(`i=${i}, ${bundle}`) return this.onReceiveResult(i, bundle) } const aokt = Java.use('aokt') aokt.c.overload( 'com.google.android.gms.constellation.VerifyPhoneNumberRequest', 'com.google.android.gms.constellation.VerifyPhoneNumberResponse', 'int' ).implementation = function (request, response, i) { Log.e(`${request.a.value} ${request.b.value}`) return this.c(request, response, i) } const BaseBundle = Java.use('android.os.BaseBundle') BaseBundle.getInt.overload('java.lang.String', 'int').implementation = function (key, i) { const value = this.getInt(key, i) // Log.e(`[BaseBundle]${key}, ${i} -> ${value}`) if (key == 'sim_slot_index') { return 0 } return this.getInt(key, i) } })