_spoof.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. const mcc = "255"
  2. const mnc = "06"
  3. const simOperator = "25506"
  4. const networkOperator = "25506"
  5. const simSerialNumber = "89380062300689131876"
  6. const iccId = "89380062300689131876"
  7. const number = "731848010"
  8. const imei = "864929043714851"
  9. const imsi = "255065007246456"
  10. const countryIso = "ua"
  11. const subId = ""
  12. Java.perform(function () {
  13. const SmsManager = Java.use("android.telephony.SmsManager")
  14. SmsManager.getSmsManagerForSubscriptionId.overload("int").implementation =
  15. function (i) {
  16. const _smsManager = this.getSmsManagerForSubscriptionId(i)
  17. console.log(`SmsManager.getSmsManagerForSubscriptionId: ${i}`)
  18. return _smsManager
  19. }
  20. SmsManager.getDefault.overload().implementation = function () {
  21. const _smsManager = this.getDefault(i)
  22. console.log(`SmsManager.getDefault`)
  23. return _smsManager
  24. }
  25. SmsManager.getDefaultSmsSubscriptionId.overload().implementation =
  26. function () {
  27. const _subId = this.getDefaultSmsSubscriptionId()
  28. console.log(`SmsManager.getDefaultSmsSubscriptionId: ${_subId}`)
  29. return _subId
  30. }
  31. SmsManager.getSubscriptionId.overload().implementation = function () {
  32. const _subId = this.getSubscriptionId()
  33. console.log(`SmsManager.getSubscriptionId: ${_subId}`)
  34. return _subId
  35. }
  36. const SubscriptionInfo = Java.use("android.telephony.SubscriptionInfo")
  37. SubscriptionInfo.getMcc.overload().implementation = function () {
  38. const _mcc = this.getMcc()
  39. console.log(`spoof SubscriptionInfo.getMcc: ${_mcc} -> ${mcc}`)
  40. return parseInt(mcc)
  41. }
  42. SubscriptionInfo.getMnc.overload().implementation = function () {
  43. const _mnc = this.getMnc()
  44. console.log(`spoof SubscriptionInfo.getMnc: ${_mnc} -> ${mnc}`)
  45. return parseInt(mnc)
  46. }
  47. SubscriptionInfo.getMccString.overload().implementation = function () {
  48. const _mccString = this.getMccString()
  49. console.log(
  50. `spoof SubscriptionInfo.getMccString: ${_mccString} -> ${mcc}`
  51. )
  52. return mcc
  53. }
  54. SubscriptionInfo.getMncString.overload().implementation = function () {
  55. const _mncString = this.getMncString()
  56. console.log(
  57. `spoof SubscriptionInfo.getMncString: ${_mncString} -> ${mnc}`
  58. )
  59. return mnc
  60. }
  61. SubscriptionInfo.getNumber.overload().implementation = function () {
  62. const _number = this.getNumber()
  63. console.log(`spoof SubscriptionInfo.getNumber: ${_number} -> ${number}`)
  64. return number
  65. }
  66. SubscriptionInfo.getIccId.overload().implementation = function () {
  67. const _iccId = this.getIccId()
  68. console.log(`spoof SubscriptionInfo.getIccId: ${_iccId} -> ${iccId}`)
  69. return iccId
  70. }
  71. SubscriptionInfo.getCountryIso.overload().implementation = function () {
  72. const _countryIso = this.getCountryIso()
  73. console.log(
  74. `spoof SubscriptionInfo.getCountryIso: ${_countryIso} -> ${countryIso}`
  75. )
  76. return countryIso
  77. }
  78. SubscriptionInfo.getSubscriptionId.overload().implementation = function () {
  79. const _subId = this.getSubscriptionId()
  80. if (!subId) {
  81. console.log(_subId)
  82. return _subId
  83. }
  84. console.log(
  85. `spoof SubscriptionInfo.getSubscriptionId: ${_subId} -> ${subId}`
  86. )
  87. return parseInt(subId)
  88. }
  89. const TelephonyManager = Java.use("android.telephony.TelephonyManager")
  90. TelephonyManager.getLine1Number.overload().implementation = function () {
  91. const _number = this.getLine1Number()
  92. console.log(
  93. `spoof TelephonyManager.getLine1Number: ${_number} -> ${number}`
  94. )
  95. return number
  96. }
  97. TelephonyManager.getSimOperator.overload().implementation = function () {
  98. const _simOperator = this.getSimOperator()
  99. console.log(
  100. `spoof TelephonyManager.getSimOperator: ${_simOperator} -> ${simOperator}`
  101. )
  102. return simOperator
  103. }
  104. TelephonyManager.getNetworkOperator.overload().implementation =
  105. function () {
  106. const _networkOperator = this.getNetworkOperator()
  107. console.log(
  108. `spoof TelephonyManager.getNetworkOperator: ${_networkOperator} -> ${networkOperator}`
  109. )
  110. return networkOperator
  111. }
  112. TelephonyManager.getSimSerialNumber.overload().implementation =
  113. function () {
  114. const _simSerialNumber = this.getSimSerialNumber()
  115. console.log(
  116. `spoof TelephonyManager.getSimSerialNumber: ${_simSerialNumber} -> ${simSerialNumber}`
  117. )
  118. return simSerialNumber
  119. }
  120. TelephonyManager.getSubscriberId.overload().implementation = function () {
  121. const _imsi = this.getSubscriberId()
  122. console.log(
  123. `spoof TelephonyManager.getSubscriberId: ${_imsi} -> ${imsi}`
  124. )
  125. return imsi
  126. }
  127. TelephonyManager.getImei.overload().implementation = function () {
  128. const _imei = this.getImei()
  129. console.log(`spoof TelephonyManager.getImei: ${_imei} -> ${imei}`)
  130. return imei
  131. }
  132. TelephonyManager.getNetworkCountryIso.overload().implementation =
  133. function () {
  134. const _countryIso = this.getNetworkCountryIso()
  135. console.log(
  136. `spoof TelephonyManager.getNetworkCountryIso: ${_countryIso} -> ${countryIso}`
  137. )
  138. return countryIso
  139. }
  140. TelephonyManager.getSimCountryIso.overload().implementation = function () {
  141. const _countryIso = this.getSimCountryIso()
  142. console.log(
  143. `spoof TelephonyManager.getSimCountryIso: ${_countryIso} -> ${countryIso}`
  144. )
  145. return countryIso
  146. }
  147. TelephonyManager.getSubscriptionId.overload().implementation = function () {
  148. const _subId = this.getSubscriptionId()
  149. if (!subId) {
  150. console.log(_subId)
  151. return _subId
  152. }
  153. console.log(
  154. `spoof TelephonyManager.getSubscriptionId: ${_subId} -> ${subId}`
  155. )
  156. return parseInt(subId)
  157. }
  158. // const asos = Java.use("asos")
  159. // asos.b.overload().implementation = function () {
  160. // console.log("asos.b")
  161. // return true
  162. // }
  163. const asmy = Java.use("asmy")
  164. const bqni = Java.use("bqni")
  165. const askd = Java.use("askd")
  166. // asmy.b.overload().implementation = function () {
  167. // this.$super.b()
  168. // this._a.value.Q(bqni.b(19))
  169. // this._a.value.av(27)
  170. // const a = this._a.value._P.value.a()
  171. // var c = askd.c(a, "")
  172. // console.log(this._a.value.r)
  173. // var ar = Java.cast(this._a.value, Java.use("arqs"))
  174. // ar.r(36, Java.cast(c, Java.use("java.lang.Object")))
  175. // }
  176. const PhoneNumberVerification = Java.use(
  177. "com.google.android.gms.constellation.PhoneNumberVerification"
  178. )
  179. PhoneNumberVerification.$init.overload(
  180. "java.lang.String",
  181. "long",
  182. "int",
  183. "int",
  184. "java.lang.String",
  185. "android.os.Bundle"
  186. ).implementation = function (str, j, i, i2, str2, bundle) {
  187. console.log("PhoneNumberVerification.$init")
  188. console.log(`str: ${str}, j: ${j}, i: ${i}, i2: ${i2}, str2: ${str2}`)
  189. // print bundle
  190. if (bundle) {
  191. const keySet = bundle.keySet().toArray()
  192. for (let i = 0; i < keySet.length; i++) {
  193. const key = keySet[i]
  194. console.log(`key: ${key}, value: ${bundle.get(key)}`)
  195. }
  196. }
  197. return this.$init(str, j, i, i2, str2, bundle)
  198. }
  199. const aays = Java.use("aays")
  200. aays.d.overload("int", "boolean").implementation = function (i, z) {
  201. console.log("aays.d", i, z, Object.keys(this.f.value))
  202. return number
  203. }
  204. const aoor = Java.use("aoor")
  205. aoor.h.overload("android.content.Context", "int").implementation =
  206. function (c, i) {
  207. const _i = this.h(c, i)
  208. console.log("aoor.h", c, i, _i)
  209. return _i
  210. }
  211. const SetAsterismConsentRequest = Java.use(
  212. "com.google.android.gms.asterism.SetAsterismConsentRequest"
  213. )
  214. SetAsterismConsentRequest.$init.overload(
  215. //int i, int i2, int i3, int[] iArr, Long l, int i4, Bundle bundle, int i5, String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8
  216. "int",
  217. "int",
  218. "int",
  219. "[I",
  220. "java.lang.Long",
  221. "int",
  222. "android.os.Bundle",
  223. "int",
  224. "java.lang.String",
  225. "java.lang.String",
  226. "java.lang.String",
  227. "java.lang.String",
  228. "java.lang.String",
  229. "java.lang.String",
  230. "java.lang.String",
  231. "java.lang.String"
  232. ).implementation = function (
  233. i,
  234. i2,
  235. i3,
  236. iArr,
  237. l,
  238. i4,
  239. bundle,
  240. i5,
  241. str,
  242. str2,
  243. str3,
  244. str4,
  245. str5,
  246. str6,
  247. str7,
  248. str8
  249. ) {
  250. console.log(
  251. Java.use("android.util.Log").getStackTraceString(
  252. Java.use("java.lang.Throwable").$new()
  253. )
  254. )
  255. console.log("SetAsterismConsentRequest.$init")
  256. console.log(
  257. `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}`
  258. )
  259. // print bundle
  260. const keySet = bundle.keySet().toArray()
  261. for (let i = 0; i < keySet.length; i++) {
  262. const key = keySet[i]
  263. console.log(`key: ${key}, value: ${bundle.get(key)}`)
  264. }
  265. return this.$init(
  266. i,
  267. i2,
  268. i3,
  269. iArr,
  270. l,
  271. i4,
  272. bundle,
  273. i5,
  274. str,
  275. str2,
  276. str3,
  277. str4,
  278. str5,
  279. str6,
  280. str7,
  281. str8
  282. )
  283. }
  284. const SetAsterismConsentResponse = Java.use(
  285. "com.google.android.gms.asterism.SetAsterismConsentResponse"
  286. )
  287. SetAsterismConsentResponse.$init.overload(
  288. "int",
  289. "java.lang.String",
  290. "java.lang.String"
  291. ).implementation = function (i, str, str2) {
  292. console.log(
  293. Java.use("android.util.Log").getStackTraceString(
  294. Java.use("java.lang.Throwable").$new()
  295. )
  296. )
  297. console.log("SetAsterismConsentResponse.$init")
  298. console.log(`i: ${i}, str: ${str}, str2: ${str2}`)
  299. return this.$init(1, 'c4q5zP5Ft4A:APA91bEASr50HwwOY789LSZrcHPT8aG_fT19xlelS35qgIJeC3UBYypAHmmL9IygzlphzTKKz0wCdiQwuoPZMJKvgKPmGi3_imdr1CY0s7fs8qa_LMgNDFfvWEnpTCReAYc7IjThhFQq', 'c4q5zP5Ft4A')
  300. }
  301. })