_spoof_gms.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784
  1. const mcc = "302"
  2. const mnc = "299"
  3. const simOperator = "302299"
  4. const networkOperator = "302299"
  5. const simSerialNumber = "25343849204326395079"
  6. const iccId = "25343849204326395079"
  7. const number = "4305581376"
  8. const imei = "359028031160102"
  9. const imsi = "302299418648530"
  10. const countryIso = "ca"
  11. const subId = "45"
  12. const androidId = "d7a277d884757666"
  13. const serialNumber = "41d7c20e"
  14. function trace(tag) {
  15. Log.e(
  16. (tag || "") +
  17. Java.use("android.util.Log").getStackTraceString(
  18. Java.use("java.lang.Throwable").$new()
  19. )
  20. )
  21. }
  22. function dump(obj) {
  23. try {
  24. const gson = Java.use("com.google.gson.Gson").$new()
  25. const json = gson.toJson(obj)
  26. return json
  27. } catch (error) {
  28. return ""
  29. }
  30. }
  31. class Log {
  32. static TAG = "[GMS]"
  33. static Debug = false
  34. static format(...msg) {
  35. let m = []
  36. for (let i = 0; i < msg.length; i++) {
  37. if (typeof msg[i] === "object") {
  38. m.push(msg[i] + "")
  39. } else {
  40. m.push(msg[i])
  41. }
  42. }
  43. m = m.join(" ")
  44. return m
  45. }
  46. static i(...msg) {
  47. if (!this.Debug) return
  48. console.log(`\x1b[30m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  49. }
  50. static w(...msg) {
  51. console.log(`\x1b[33m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  52. }
  53. static e(...msg) {
  54. console.log(`\x1b[31m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  55. }
  56. static s(...msg) {
  57. console.log(`\x1b[32m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  58. }
  59. }
  60. Java.perform(function () {
  61. try {
  62. const GsonClass = Java.openClassFile(
  63. "/sdcard/Android/data/com.google.android.gms/gson.dex"
  64. )
  65. GsonClass.load()
  66. Log.s("gson class loaded")
  67. } catch (error) {
  68. Log.e("load gson error", error)
  69. }
  70. const SmsManager = Java.use("android.telephony.SmsManager")
  71. SmsManager.getSmsManagerForSubscriptionId.overload("int").implementation =
  72. function (i) {
  73. const _smsManager = this.getSmsManagerForSubscriptionId(i)
  74. Log.i(`SmsManager.getSmsManagerForSubscriptionId: ${i}`)
  75. return _smsManager
  76. }
  77. SmsManager.getDefault.overload().implementation = function () {
  78. const _smsManager = this.getDefault(i)
  79. Log.i(`SmsManager.getDefault`)
  80. return _smsManager
  81. }
  82. // SmsManager.getDefaultSmsSubscriptionId.overload().implementation =
  83. // function () {
  84. // const _subId = this.getDefaultSmsSubscriptionId()
  85. // Log.i(
  86. // `spoof SmsManager.getDefaultSmsSubscriptionId: ${_subId} -> ${subId}`
  87. // )
  88. // return parseInt(subId)
  89. // }
  90. // SmsManager.getSubscriptionId.overload().implementation = function () {
  91. // const _subId = this.getSubscriptionId()
  92. // Log.i(`SmsManager.getSubscriptionId: ${_subId} -> ${subId}`)
  93. // return parseInt(subId)
  94. // }
  95. SmsManager.getCarrierConfigValues.overload().implementation = function () {
  96. const _config = this.getCarrierConfigValues()
  97. Log.i(`SmsManager.getCarrierConfigValues: ${_config}`)
  98. return _config
  99. }
  100. const CarrierConfigManager = Java.use(
  101. "android.telephony.CarrierConfigManager"
  102. )
  103. // CarrierConfigManager.getConfigForSubId.overload("int").implementation =
  104. // function (i) {
  105. // const _config = this.getConfigForSubId(i)
  106. // Log.i(`CarrierConfigManager.getConfigForSubId: ${i}`)
  107. // return _config
  108. // }
  109. const SubscriptionManager = Java.use(
  110. "android.telephony.SubscriptionManager"
  111. )
  112. SubscriptionManager.getActiveSubscriptionInfoCount.overload().implementation =
  113. function () {
  114. const _count = this.getActiveSubscriptionInfoCount()
  115. Log.i(
  116. `SubscriptionManager.getActiveSubscriptionInfoCount: ${_count}`
  117. )
  118. return _count
  119. }
  120. // SubscriptionManager.getDefaultSubscriptionId.overload().implementation =
  121. // function () {
  122. // const _subId = this.getDefaultSubscriptionId()
  123. // Log.i(
  124. // `spoof SubscriptionManager.getDefaultSubscriptionId: ${_subId} -> ${subId}`
  125. // )
  126. // return parseInt(subId)
  127. // }
  128. // SubscriptionManager.getDefaultSmsSubscriptionId.overload().implementation =
  129. // function () {
  130. // const _subId = this.getDefaultSmsSubscriptionId()
  131. // Log.i(
  132. // `spoof SubscriptionManager.getDefaultSmsSubscriptionId: ${_subId} -> ${subId}`
  133. // )
  134. // return parseInt(subId)
  135. // }
  136. // SubscriptionManager.getDefaultVoiceSubscriptionId.overload().implementation =
  137. // function () {
  138. // const _subId = this.getDefaultVoiceSubscriptionId()
  139. // Log.i(
  140. // `spoof SubscriptionManager.getDefaultVoiceSubscriptionId: ${_subId} -> ${subId}`
  141. // )
  142. // return parseInt(subId)
  143. // }
  144. // SubscriptionManager.getActiveDataSubscriptionId.overload().implementation =
  145. // function () {
  146. // const _subId = this.getActiveDataSubscriptionId()
  147. // Log.i(
  148. // `spoof SubscriptionManager.getActiveDataSubscriptionId: ${_subId} -> ${subId}`
  149. // )
  150. // return parseInt(subId)
  151. // }
  152. // SubscriptionManager.getSlotIndex.overload("int").implementation = function (
  153. // i
  154. // ) {
  155. // const _slotIndex = this.getSlotIndex(i)
  156. // Log.i(`spoof SubscriptionManager.getSlotIndex: ${_slotIndex} -> 0`)
  157. // return 0
  158. // }
  159. // SubscriptionManager.isUsableSubscriptionId.overload("int").implementation =
  160. // function (i) {
  161. // const _isUsable = this.isUsableSubscriptionId(i)
  162. // Log.i(`SubscriptionManager.isUsableSubscriptionId: ${_isUsable}`)
  163. // return _isUsable
  164. // }
  165. // SubscriptionManager.isValidSubscriptionId.overload("int").implementation =
  166. // function (i) {
  167. // const _isValid = this.isValidSubscriptionId(i)
  168. // Log.i(
  169. // `spoof SubscriptionManager.isValidSubscriptionId(${i}): ${_isValid} -> true`
  170. // )
  171. // return true
  172. // }
  173. SubscriptionManager.getPhoneNumber.overload("int").implementation =
  174. function (i) {
  175. Log.i(
  176. `spoof SubscriptionManager.getPhoneNumber(${i}): -> ${number}`
  177. )
  178. return number
  179. }
  180. SubscriptionManager.getPhoneNumber.overload("int", "int").implementation =
  181. function (i, i2) {
  182. Log.i(
  183. `spoof SubscriptionManager.getPhoneNumber(${i},${i2}): -> ${number}`
  184. )
  185. return number
  186. }
  187. SubscriptionManager.getActiveSubscriptionInfoList.overload().implementation =
  188. function () {
  189. const _list = this.getActiveSubscriptionInfoList()
  190. Log.i(
  191. `SubscriptionManager.getActiveSubscriptionInfoList ${_list.size()}`
  192. )
  193. return _list
  194. }
  195. // SubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex.overload(
  196. // "int"
  197. // ).implementation = function (i) {
  198. // const _info = this.getActiveSubscriptionInfoForSimSlotIndex(i)
  199. // Log.i(
  200. // `SubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex(${i}): ${
  201. // _info ? "ok" : "null"
  202. // }`
  203. // )
  204. // return _info
  205. // }
  206. // SubscriptionManager.getActiveSubscriptionIdList.overload().implementation =
  207. // function () {
  208. // const _list = this.getActiveSubscriptionIdList()
  209. // Log.i(
  210. // `spoof SubscriptionManager.getActiveSubscriptionIdList ${_list} -> ${subId}`
  211. // )
  212. // return [parseInt(subId)]
  213. // }
  214. // SubscriptionManager.getActiveSubscriptionInfo.overload(
  215. // "int"
  216. // ).implementation = function (i) {
  217. // const _info = this.getActiveSubscriptionInfo(i)
  218. // const simCount = this.getActiveSubscriptionInfoCountMax()
  219. // let subInfo = null
  220. // try {
  221. // for (let i = 0; i < simCount; i++) {
  222. // subInfo = this.getActiveSubscriptionInfoForSimSlotIndex(i)
  223. // if (subInfo) {
  224. // break
  225. // }
  226. // }
  227. // Log.i(`spoof SubscriptionManager.getActiveSubscriptionInfo(${i})`)
  228. // } catch (error) {
  229. // console.error(
  230. // `spoof error SubscriptionManager.getActiveSubscriptionInfo(${i})`
  231. // )
  232. // error.printStackTrace()
  233. // }
  234. // return subInfo
  235. // }
  236. SubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex.overload(
  237. "int"
  238. ).implementation = function (i) {
  239. const _info = this.getActiveSubscriptionInfoForSimSlotIndex(i)
  240. Log.i(
  241. `SubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex: ${_info}`
  242. )
  243. return _info
  244. }
  245. // SubscriptionManager.isActiveSubscriptionId.overload("int").implementation =
  246. // function (i) {
  247. // const _isActive = this.isActiveSubscriptionId(i)
  248. // Log.i(
  249. // `spoof SubscriptionManager.isActiveSubscriptionId(${i}): ${_isActive} -> true`
  250. // )
  251. // return true
  252. // }
  253. const SubscriptionInfo = Java.use("android.telephony.SubscriptionInfo")
  254. SubscriptionInfo.getMcc.overload().implementation = function () {
  255. const _mcc = this.getMcc()
  256. Log.i(`spoof SubscriptionInfo.getMcc: ${_mcc} -> ${mcc}`)
  257. return parseInt(mcc)
  258. }
  259. SubscriptionInfo.getMnc.overload().implementation = function () {
  260. const _mnc = this.getMnc()
  261. Log.i(`spoof SubscriptionInfo.getMnc: ${_mnc} -> ${mnc}`)
  262. return parseInt(mnc)
  263. }
  264. SubscriptionInfo.getMccString.overload().implementation = function () {
  265. const _mccString = this.getMccString()
  266. Log.i(`spoof SubscriptionInfo.getMccString: ${_mccString} -> ${mcc}`)
  267. return mcc
  268. }
  269. SubscriptionInfo.getMncString.overload().implementation = function () {
  270. const _mncString = this.getMncString()
  271. Log.i(`spoof SubscriptionInfo.getMncString: ${_mncString} -> ${mnc}`)
  272. return mnc
  273. }
  274. SubscriptionInfo.getNumber.overload().implementation = function () {
  275. const _number = this.getNumber()
  276. Log.i(`spoof SubscriptionInfo.getNumber: ${_number} -> ${number}`)
  277. return number
  278. }
  279. SubscriptionInfo.getIccId.overload().implementation = function () {
  280. const _iccId = this.getIccId()
  281. Log.i(`spoof SubscriptionInfo.getIccId: ${_iccId} -> ${iccId}`)
  282. return iccId
  283. }
  284. SubscriptionInfo.getCountryIso.overload().implementation = function () {
  285. const _countryIso = this.getCountryIso()
  286. Log.i(
  287. `spoof SubscriptionInfo.getCountryIso: ${_countryIso} -> ${countryIso}`
  288. )
  289. return countryIso
  290. }
  291. // SubscriptionInfo.getSubscriptionId.overload().implementation = function () {
  292. // const _subId = this.getSubscriptionId()
  293. // if (!subId) {
  294. // Log.i(_subId)
  295. // return _subId
  296. // }
  297. // Log.i(`spoof SubscriptionInfo.getSubscriptionId: ${_subId} -> ${subId}`)
  298. // return parseInt(subId)
  299. // }
  300. const TelephonyManager = Java.use("android.telephony.TelephonyManager")
  301. TelephonyManager.createForSubscriptionId.overload("int").implementation =
  302. function (i) {
  303. Log.i(`spoof TelephonyManager.createForSubscriptionId: ${i}`)
  304. return this
  305. }
  306. TelephonyManager.getLine1Number.overload().implementation = function () {
  307. const _number = this.getLine1Number()
  308. Log.i(`spoof TelephonyManager.getLine1Number: ${_number} -> ${number}`)
  309. return number
  310. }
  311. TelephonyManager.getSimOperator.overload().implementation = function () {
  312. const _simOperator = this.getSimOperator()
  313. Log.i(
  314. `spoof TelephonyManager.getSimOperator: ${_simOperator} -> ${simOperator}`
  315. )
  316. return simOperator
  317. }
  318. TelephonyManager.getNetworkOperator.overload().implementation =
  319. function () {
  320. const _networkOperator = this.getNetworkOperator()
  321. Log.i(
  322. `spoof TelephonyManager.getNetworkOperator: ${_networkOperator} -> ${networkOperator}`
  323. )
  324. return networkOperator
  325. }
  326. TelephonyManager.getSimSerialNumber.overload().implementation =
  327. function () {
  328. const _simSerialNumber = this.getSimSerialNumber()
  329. Log.i(
  330. `spoof TelephonyManager.getSimSerialNumber: ${_simSerialNumber} -> ${simSerialNumber}`
  331. )
  332. return simSerialNumber
  333. }
  334. TelephonyManager.getSubscriberId.overload().implementation = function () {
  335. const _imsi = this.getSubscriberId()
  336. Log.i(`spoof TelephonyManager.getSubscriberId: ${_imsi} -> ${imsi}`)
  337. return imsi
  338. }
  339. TelephonyManager.getImei.overload().implementation = function () {
  340. const _imei = this.getImei()
  341. Log.i(`spoof TelephonyManager.getImei: ${_imei} -> ${imei}`)
  342. return imei
  343. }
  344. TelephonyManager.getNetworkCountryIso.overload().implementation =
  345. function () {
  346. const _countryIso = this.getNetworkCountryIso()
  347. Log.i(
  348. `spoof TelephonyManager.getNetworkCountryIso: ${_countryIso} -> ${countryIso}`
  349. )
  350. return countryIso
  351. }
  352. TelephonyManager.getSimCountryIso.overload().implementation = function () {
  353. const _countryIso = this.getSimCountryIso()
  354. Log.i(
  355. `spoof TelephonyManager.getSimCountryIso: ${_countryIso} -> ${countryIso}`
  356. )
  357. return countryIso
  358. }
  359. // TelephonyManager.getSubscriptionId.overload().implementation = function () {
  360. // const _subId = this.getSubscriptionId()
  361. // if (!subId) {
  362. // Log.i(_subId)
  363. // return _subId
  364. // }
  365. // Log.i(`spoof TelephonyManager.getSubscriptionId: ${_subId} -> ${subId}`)
  366. // return parseInt(subId)
  367. // }
  368. TelephonyManager.getSimState.overload().implementation = function () {
  369. const _simState = this.getSimState()
  370. Log.i(`spoof TelephonyManager.getSimState: ${_simState} -> 5`)
  371. return 5
  372. }
  373. const PhoneNumberVerification = Java.use(
  374. "com.google.android.gms.constellation.PhoneNumberVerification"
  375. )
  376. PhoneNumberVerification.$init.overload(
  377. "java.lang.String",
  378. "long",
  379. "int",
  380. "int",
  381. "java.lang.String",
  382. "android.os.Bundle",
  383. "int",
  384. "long"
  385. ).implementation = function (str, j, i, i2, str2, bundle, i3, l) {
  386. Log.e(
  387. `PhoneNumberVerification.$init(str=${str}, j=${j}, i=${i}, i2=${i2}, str2=${str2}, i3=${i3}, l=${l}`
  388. )
  389. // print bundle
  390. const keySet = bundle.keySet().toArray()
  391. for (let i = 0; i < keySet.length; i++) {
  392. const key = keySet[i]
  393. Log.i(
  394. `PhoneNumberVerification(key: ${key}, value: ${bundle.get(
  395. key
  396. )})`
  397. )
  398. }
  399. return this.$init(str, j, i, i2, str2, bundle, i3, l)
  400. }
  401. const VerifyPhoneNumberRequest = Java.use(
  402. "com.google.android.gms.constellation.VerifyPhoneNumberRequest"
  403. )
  404. VerifyPhoneNumberRequest.$init.overload(
  405. //String str, long j, IdTokenRequest idTokenRequest, Bundle bundle, List list, boolean z, int i, List list2
  406. "java.lang.String",
  407. "long",
  408. "com.google.android.gms.constellation.IdTokenRequest",
  409. "android.os.Bundle",
  410. "java.util.List",
  411. "boolean",
  412. "int",
  413. "java.util.List"
  414. ).implementation = function (
  415. str,
  416. j,
  417. idTokenRequest,
  418. bundle,
  419. list,
  420. z,
  421. i,
  422. list2
  423. ) {
  424. Log.e(`VerifyPhoneNumberRequest.$init(
  425. str=${str}, j=${j}, idTokenRequest=${idTokenRequest}, bundle=${bundle}, list=${list}, z=${z}, i=${i}, list2=${list2})`)
  426. // print bundle
  427. const keySet = bundle.keySet().toArray()
  428. for (let i = 0; i < keySet.length; i++) {
  429. const key = keySet[i]
  430. Log.i(
  431. `VerifyPhoneNumberRequest.Bundle(key=${key}, value=${bundle.get(
  432. key
  433. )})`
  434. )
  435. }
  436. return this.$init(str, j, idTokenRequest, bundle, list, z, i, list2)
  437. }
  438. const SetAsterismConsentRequest = Java.use(
  439. "com.google.android.gms.asterism.SetAsterismConsentRequest"
  440. )
  441. SetAsterismConsentRequest.$init.overload(
  442. "int",
  443. "int",
  444. "int",
  445. "[I",
  446. "java.lang.Long",
  447. "int",
  448. "android.os.Bundle",
  449. "int",
  450. "java.lang.String",
  451. "java.lang.String",
  452. "java.lang.String",
  453. "java.lang.String",
  454. "java.lang.String",
  455. "java.lang.String",
  456. "java.lang.String",
  457. "java.lang.String",
  458. "int"
  459. ).implementation = function (
  460. i,
  461. i2,
  462. i3,
  463. iArr,
  464. l,
  465. i4,
  466. bundle,
  467. i5,
  468. str,
  469. str2,
  470. str3,
  471. str4,
  472. str5,
  473. str6,
  474. str7,
  475. str8,
  476. i6
  477. ) {
  478. Log.i(
  479. `SetAsterismConsentRequest.$init(
  480. i=${i}, i2=${i2}, i3=${i3}, iArr=${iArr}, l=${l},
  481. i4=${i4}, bundle=${bundle}, i5=${i5}, str=${str},
  482. str2=${str2}, str3=${str3}, str4=${str4}, str5=${str5},
  483. str6=${str6}, str7=${str7}, str8=${str8}, i6=${i6})`
  484. )
  485. // print bundle
  486. const keySet = bundle.keySet().toArray()
  487. for (let i = 0; i < keySet.length; i++) {
  488. const key = keySet[i]
  489. Log.i(
  490. `SetAsterismConsentRequest.Bundle(key=${key}, value=${bundle.get(
  491. key
  492. )})`
  493. )
  494. }
  495. return this.$init(
  496. i,
  497. i2,
  498. i3,
  499. iArr,
  500. l,
  501. i4,
  502. bundle,
  503. i5,
  504. str,
  505. str2,
  506. str3,
  507. str4,
  508. str5,
  509. str6,
  510. str7,
  511. str8,
  512. i6
  513. )
  514. }
  515. const SetAsterismConsentResponse = Java.use(
  516. "com.google.android.gms.asterism.SetAsterismConsentResponse"
  517. )
  518. SetAsterismConsentResponse.$init.overload(
  519. "int",
  520. "java.lang.String",
  521. "java.lang.String"
  522. ).implementation = function (i, str, str2) {
  523. Log.i(
  524. `SetAsterismConsentResponse.$init(i=${i}, str=${str}, str2=${str2})`
  525. )
  526. return this.$init(i, str, str2)
  527. }
  528. const alyx = Java.use("alyx")
  529. alyx.a.overload("fixf").implementation = function (fixf) {
  530. const b = this.a(fixf)
  531. const keySet = b.keySet().toArray()
  532. for (let i = 0; i < keySet.length; i++) {
  533. const key = keySet[i]
  534. Log.w(`alyx.a::key: ${key}, value: ${b.get(key)}`)
  535. }
  536. return b
  537. }
  538. alyx.m.overload("amlu", "java.util.List").implementation = function (
  539. amlu,
  540. list
  541. ) {
  542. const a = amlu._a.value // string
  543. const f = amlu.f.value // string
  544. const g = amlu.g.value // list
  545. const h = amlu.h.value // list
  546. const HashMap = Java.use("java.util.HashMap")
  547. const d = Java.cast(amlu.d.value, HashMap) // map
  548. const e = Java.cast(amlu.e.value, HashMap) // map
  549. Log.e(`alyx.m(
  550. a=${a},
  551. f=${f},
  552. g=${g ? dump(g) : null},
  553. h=${h ? dump(h) : null},
  554. d=${d ? dump(d) : null},
  555. e=${e ? dump(e) : null})`)
  556. const res = this.m(amlu, list)
  557. Log.e(`alyx.m res: ${dump(res)}`)
  558. return res
  559. }
  560. alyx.r.overload(
  561. "amlu",
  562. "java.util.List",
  563. "java.lang.String",
  564. "java.lang.String"
  565. ).implementation = function (amlu, list, str, str2) {
  566. trace()
  567. Log.e(`alyx.r(
  568. amlu=${dump(amlu)},
  569. list=${dump(list)},
  570. str=${str},
  571. str2=${str2})`)
  572. try {
  573. const res = this.r(amlu, list, str, str2)
  574. return res
  575. Log.e(`alyx.r res: ${res}`)
  576. } catch (error) {
  577. Log.e(`alyx.r error: ${error}`)
  578. }
  579. return false
  580. }
  581. alyx.x.overload("amlu", "java.util.List").implementation = function (
  582. amlu,
  583. list
  584. ) {
  585. const res = this.x(amlu, list)
  586. Log.e(`alyx.x(
  587. amlu=${dump(amlu)},
  588. list=${dump(list)})
  589. => ${dump(res)}`)
  590. return res
  591. }
  592. //amlu amluVar, fixf fixfVar, ammt ammtVar
  593. alyx.e.overload("amlu", "fixf", "ammt").implementation = function (
  594. amlu,
  595. fixf,
  596. ammt
  597. ) {
  598. const res = this.e(amlu, fixf, ammt)
  599. Log.e(`alyx.e(
  600. amlu=${dump(amlu)},
  601. fixf=${dump(fixf)},
  602. ammt=${dump(ammt)})
  603. => ${dump(res)}`)
  604. return res
  605. }
  606. // alyx.v.overload("amlu", "java.util.List").implementation = function (
  607. // amlu,
  608. // list
  609. // ) {
  610. // const res = this.v(amlu, list)
  611. // Log.e(`alyx.v(
  612. // amlu=${dump(amlu)},
  613. // list=${dump(list)})
  614. // => ${dump(res)}`)
  615. // trace()
  616. // return res
  617. // }
  618. const ftit = Java.use("ftit")
  619. const ftgv = Java.use("ftgv")
  620. ftit.h.overload("ftgv").implementation = function (ftgvVar) {
  621. try {
  622. Log.e(`ftit.h(
  623. this=${dump(this)},
  624. ftgvVar=${dump(ftgvVar)})`)
  625. return Java.use("ftiu").$new(this, ftgvVar)
  626. } catch (e) {
  627. e.printStackTrace()
  628. Log.e(`ftit.h exception: ${e}`)
  629. }
  630. }
  631. const Secure = Java.use("android.provider.Settings$Secure")
  632. Secure.getString.overload(
  633. "android.content.ContentResolver",
  634. "java.lang.String"
  635. ).implementation = function (contentResolver, str) {
  636. const _str = this.getString(contentResolver, str)
  637. if (str === "android_id") {
  638. Log.w(`spoof Secure.getString(android_id): ${_str} -> ${androidId}`)
  639. return androidId
  640. }
  641. return _str
  642. }
  643. const Build = Java.use("android.os.Build")
  644. Build.getString.overload("java.lang.String").implementation = function (
  645. str
  646. ) {
  647. const _str = this.getString(str)
  648. Log.w(`Build.getString(${str}): ${_str}`)
  649. return _str
  650. }
  651. Build.getSerial.overload().implementation = function () {
  652. const _serial = this.getSerial()
  653. Log.w(`spoof Build.getSerial: ${_serial} -> ${serialNumber}`)
  654. return serialNumber
  655. }
  656. // const SystemProperties = Java.use("android.os.SystemProperties")
  657. // SystemProperties.get.overload("java.lang.String").implementation =
  658. // function (str) {
  659. // const _str = this.get(str)
  660. // Log.w(`SystemProperties.get(${str}): ${_str}`)
  661. // return _str
  662. // }
  663. // SystemProperties.get.overload(
  664. // "java.lang.String",
  665. // "java.lang.String"
  666. // ).implementation = function (str, str2) {
  667. // const _str = this.get(str, str2)
  668. // Log.w(`SystemProperties.get(${str}, ${str2}): ${_str}`)
  669. // return _str
  670. // }
  671. // SystemProperties.getInt.overload("java.lang.String", "int").implementation =
  672. // function (str, i) {
  673. // const _i = this.getInt(str, i)
  674. // Log.w(`SystemProperties.getInt(${str}, ${i}): ${_i}`)
  675. // return _i
  676. // }
  677. // SystemProperties.getLong.overload(
  678. // "java.lang.String",
  679. // "long"
  680. // ).implementation = function (str, l) {
  681. // const _l = this.getLong(str, l)
  682. // Log.w(`SystemProperties.getLong(${str}, ${l}): ${_l}`)
  683. // return _l
  684. // }
  685. // SystemProperties.getBoolean.overload(
  686. // "java.lang.String",
  687. // "boolean"
  688. // ).implementation = function (str, z) {
  689. // const _z = this.getBoolean(str, z)
  690. // Log.w(`SystemProperties.getBoolean(${str}, ${z}): ${_z}`)
  691. // return _z
  692. // }
  693. const alzg = Java.use("alzg")
  694. alzg.d.overload(
  695. // boolean, map
  696. "boolean",
  697. "java.util.Map"
  698. ).implementation = function (z, map) {
  699. Log.e(`alzg.d(z=${z}, map=${dump(map)})`)
  700. return this.d(z, map)
  701. }
  702. // const ammv = Java.use("ammv")
  703. // ammv.a.overload(
  704. // // amlu amluVar, fixf fixfVar, ammt ammtVar, ammi ammiVar
  705. // "amlu",
  706. // "fixf",
  707. // "ammt",
  708. // "ammi"
  709. // ).implementation = function (amlu, fixf, ammt, ammi) {
  710. // Log.e(`ammv.a(
  711. // amlu=${dump(amlu)},
  712. // fixf=${dump(fixf)},
  713. // ammt=${dump(ammt)},
  714. // ammi=${dump(ammi)})`)
  715. // trace()
  716. // return this.a(amlu, fixf, ammt, ammi)
  717. // }
  718. // const amag = Java.use("amag")
  719. // amag.b.overload(
  720. // // akxi akxiVar, fiwx fiwxVar, long j
  721. // "akxi",
  722. // "fiwx",
  723. // "long"
  724. // ).implementation = function (akxi, fiwx, j) {
  725. // Log.e(`amag.b(
  726. // akxi=${dump(akxi)},
  727. // fiwx=${dump(fiwx)},
  728. // j=${j})`)
  729. // trace()
  730. // return this.b(akxi, fiwx, j)
  731. // }
  732. })