|
|
@@ -18,8 +18,15 @@ function trace(tag) {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
+function dump(obj) {
|
|
|
+ const gson = Java.use("com.google.gson.Gson").$new()
|
|
|
+ const json = gson.toJson(obj)
|
|
|
+ return json
|
|
|
+}
|
|
|
+
|
|
|
class Log {
|
|
|
static TAG = "[GMS]"
|
|
|
+ static Debug = true
|
|
|
static format(...msg) {
|
|
|
let m = []
|
|
|
for (let i = 0; i < msg.length; i++) {
|
|
|
@@ -33,6 +40,7 @@ class Log {
|
|
|
return m
|
|
|
}
|
|
|
static i(...msg) {
|
|
|
+ if (!this.Debug) return
|
|
|
console.log(`\x1b[30m${this.TAG} ${this.format(...msg)}\x1b[0m`)
|
|
|
}
|
|
|
static w(...msg) {
|
|
|
@@ -47,11 +55,15 @@ class Log {
|
|
|
}
|
|
|
|
|
|
Java.perform(function () {
|
|
|
- const GsonClass = Java.openClassFile(
|
|
|
- "/data/data/com.google.android.gms/gson.dex"
|
|
|
- )
|
|
|
- GsonClass.load()
|
|
|
- Log.s("gson class loaded")
|
|
|
+ try {
|
|
|
+ const GsonClass = Java.openClassFile(
|
|
|
+ "/data/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 =
|
|
|
@@ -228,7 +240,7 @@ Java.perform(function () {
|
|
|
}
|
|
|
SubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex.overload(
|
|
|
"int"
|
|
|
- ).implementation = function (s) {
|
|
|
+ ).implementation = function (i) {
|
|
|
const _info = this.getActiveSubscriptionInfoForSimSlotIndex(i)
|
|
|
Log.i(
|
|
|
`SubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex: ${_info}`
|
|
|
@@ -396,17 +408,19 @@ Java.perform(function () {
|
|
|
"int",
|
|
|
"long"
|
|
|
).implementation = function (str, j, i, i2, str2, bundle, i3, l) {
|
|
|
- Log.e("PhoneNumberVerification.$init")
|
|
|
-
|
|
|
Log.e(
|
|
|
- `str: ${str}, j: ${j}, i: ${i}, i2: ${i2}, str2: ${str2}, i3: ${i3}, l: ${l}`
|
|
|
+ `PhoneNumberVerification.$init(str=${str}, j=${j}, i=${i}, i2=${i2}, str2=${str2}, i3=${i3}, l=${l}`
|
|
|
)
|
|
|
// 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)}`)
|
|
|
+ Log.i(
|
|
|
+ `PhoneNumberVerification(key: ${key}, value: ${bundle.get(
|
|
|
+ key
|
|
|
+ )})`
|
|
|
+ )
|
|
|
}
|
|
|
|
|
|
return this.$init(str, j, i, i2, str2, bundle, i3, l)
|
|
|
@@ -452,16 +466,22 @@ Java.perform(function () {
|
|
|
str8,
|
|
|
i6
|
|
|
) {
|
|
|
- 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}, i6: ${i6}`
|
|
|
+ `SetAsterismConsentRequest.$init(
|
|
|
+ i=${i}, i2=${i2}, i3=${i3}, iArr=${iArr}, l=${l},
|
|
|
+ i4=${i4}, bundle=${bundle}, i5=${i5}, str=${str},
|
|
|
+ str2=${str2}, str3=${str3}, str4=${str4}, str5=${str5},
|
|
|
+ str6=${str6}, str7=${str7}, str8=${str8}, i6=${i6})`
|
|
|
)
|
|
|
// 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)}`)
|
|
|
+ Log.i(
|
|
|
+ `SetAsterismConsentRequest.Bundle(key=${key}, value=${bundle.get(
|
|
|
+ key
|
|
|
+ )})`
|
|
|
+ )
|
|
|
}
|
|
|
|
|
|
return this.$init(
|
|
|
@@ -493,8 +513,9 @@ Java.perform(function () {
|
|
|
"java.lang.String",
|
|
|
"java.lang.String"
|
|
|
).implementation = function (i, str, str2) {
|
|
|
- Log.i("SetAsterismConsentResponse.$init")
|
|
|
- Log.i(`i: ${i}, str: ${str}, str2: ${str2}`)
|
|
|
+ Log.i(
|
|
|
+ `SetAsterismConsentResponse.$init(i=${i}, str=${str}, str2=${str2})`
|
|
|
+ )
|
|
|
return this.$init(i, str, str2)
|
|
|
}
|
|
|
|
|
|
@@ -668,33 +689,28 @@ Java.perform(function () {
|
|
|
|
|
|
const alja = Java.use("alja")
|
|
|
alja.u.overload("java.lang.Exception").implementation = function (e) {
|
|
|
- Log.i("alja.u", JSON.stringify(e))
|
|
|
- Log.i(Object.keys(e))
|
|
|
-
|
|
|
- const b = e.b.value
|
|
|
- Log.i("b", b.toString())
|
|
|
+ Log.e(`"alja.u(e=${dump(e)})`)
|
|
|
return this.u(e)
|
|
|
}
|
|
|
|
|
|
- const albf = Java.use("albf")
|
|
|
- albf.h.overload("java.lang.String", "[Ljava.lang.Object;").implementation =
|
|
|
- function (str, objArr) {
|
|
|
- Log.e("albf.h", str, objArr)
|
|
|
- if (str.includes("Verification failed")) {
|
|
|
- trace()
|
|
|
- }
|
|
|
- return this.h(str, objArr)
|
|
|
- }
|
|
|
+ // const albf = Java.use("albf")
|
|
|
+ // albf.h.overload("java.lang.String", "[Ljava.lang.Object;").implementation =
|
|
|
+ // function (str, objArr) {
|
|
|
+ // Log.e("albf.h", str, objArr)
|
|
|
+ // if (str.includes("Verification failed")) {
|
|
|
+ // trace()
|
|
|
+ // }
|
|
|
+ // this.h(str, objArr)
|
|
|
+ // }
|
|
|
|
|
|
const alyx = Java.use("alyx")
|
|
|
const fixf = Java.use("fixf")
|
|
|
alyx.a.overload("fixf").implementation = function (fixf) {
|
|
|
- Log.i("alyx.a", 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(`key: ${key}, value: ${b.get(key)}`)
|
|
|
+ Log.w(`alyx.a::key: ${key}, value: ${b.get(key)}`)
|
|
|
}
|
|
|
return b
|
|
|
}
|
|
|
@@ -702,53 +718,49 @@ Java.perform(function () {
|
|
|
amlu,
|
|
|
list
|
|
|
) {
|
|
|
- Log.e("alyx.m", amlu, list)
|
|
|
- for (let i = 0; i < list.size(); i++) {
|
|
|
- Log.e(`list[${i}]=${list.get(i)}`)
|
|
|
- }
|
|
|
const a = amlu._a.value // string
|
|
|
- Log.e(`\ta=${a}`)
|
|
|
const f = amlu.f.value // string
|
|
|
- Log.e(`\tf=${f}`)
|
|
|
const g = amlu.g.value // list
|
|
|
- for (let i = 0; i < g.size(); i++) {
|
|
|
- Log.e(`\tg[${i}]=${g.get(i)}`)
|
|
|
- }
|
|
|
-
|
|
|
const h = amlu.h.value // list
|
|
|
- if (h) {
|
|
|
- for (let i = 0; i < h.size(); i++) {
|
|
|
- Log.e(`\th[${i}]=${h.get(i)}`)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
const HashMap = Java.use("java.util.HashMap")
|
|
|
const d = Java.cast(amlu.d.value, HashMap) // map
|
|
|
- const keySet = d.keySet().toArray()
|
|
|
- for (let key of keySet) {
|
|
|
- Log.e(`\td[${key}]=${d.get(key)}`)
|
|
|
- Log.e(Object.getOwnPropertyNames(d.get(key).__proto__).join("\n"))
|
|
|
- const gson = Java.use("com.google.gson.Gson").$new()
|
|
|
- const json = gson.toJson(d.get(key))
|
|
|
- Log.e(json)
|
|
|
- }
|
|
|
-
|
|
|
const e = Java.cast(amlu.e.value, HashMap) // map
|
|
|
- const keySet2 = e.keySet().toArray()
|
|
|
- for (let key of keySet2) {
|
|
|
- Log.e(`\te[${key}]=${e.get(key)}`)
|
|
|
- }
|
|
|
- return this.m(amlu, list)
|
|
|
- }
|
|
|
|
|
|
- const Bundle = Java.use("android.os.Bundle")
|
|
|
- Bundle.getInt.overload("java.lang.String").implementation = function (str) {
|
|
|
- Log.e(`Bundle.getInt: ${str}`)
|
|
|
- if (str === "sim_slot_index") {
|
|
|
-
|
|
|
- trace()
|
|
|
- return 0
|
|
|
- }
|
|
|
- return this.getInt(str)
|
|
|
+ Log.e(`alyx.m(
|
|
|
+ a=${a},
|
|
|
+ f=${f},
|
|
|
+ g=${g ? dump(g) : null},
|
|
|
+ h=${h ? dump(h) : null},
|
|
|
+ d=${d ? dump(d) : null},
|
|
|
+ e=${e ? dump(e) : null})`)
|
|
|
+
|
|
|
+ return this.m(amlu, list)
|
|
|
}
|
|
|
+ alyx.r.overload(
|
|
|
+ "amlu",
|
|
|
+ "java.util.List",
|
|
|
+ "java.lang.String",
|
|
|
+ "java.lang.String"
|
|
|
+ ).implementation = function (amlu, list, str, str2) {
|
|
|
+ Log.e(`alyx.r(
|
|
|
+ amlu=${dump(amlu)},
|
|
|
+ list=${dump(list)},
|
|
|
+ str=${str},
|
|
|
+ str2=${str2})`)
|
|
|
+ return this.r(amlu, list, str, str2)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 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}`)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
})
|