spoof_sms.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // 043001RC00
  2. class Log {
  3. static TAG = '[SMS]'
  4. static Debug = true
  5. static format(...msg) {
  6. let m = []
  7. for (let i = 0; i < msg.length; i++) {
  8. if (typeof msg[i] === 'object') {
  9. m.push(JSON.stringify(msg[i]))
  10. } else {
  11. m.push(msg[i])
  12. }
  13. }
  14. m = m.join(' ')
  15. return m
  16. }
  17. static i(...msg) {
  18. if (!this.Debug) return
  19. console.log(`\x1b[30m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  20. }
  21. static w(...msg) {
  22. console.log(`\x1b[33m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  23. }
  24. static e(...msg) {
  25. console.log(`\x1b[31m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  26. }
  27. static s(...msg) {
  28. console.log(`\x1b[32m${this.TAG} ${this.format(...msg)}\x1b[0m`)
  29. }
  30. }
  31. function trace(tag) {
  32. Log.e((tag || '') + Java.use('android.util.Log').getStackTraceString(Java.use('java.lang.Throwable').$new()))
  33. }
  34. setImmediate(() => {
  35. Java.perform(function () {
  36. const PhoneNumberVerification = Java.use('com.google.android.gms.constellation.PhoneNumberVerification')
  37. PhoneNumberVerification.$init.overload(
  38. 'java.lang.String',
  39. 'long',
  40. 'int',
  41. 'int',
  42. 'java.lang.String',
  43. 'android.os.Bundle',
  44. 'int',
  45. 'long'
  46. ).implementation = function (a, b, c, d, e, f, g, h) {
  47. Log.i('PhoneNumberVerification.$init', a, b, c, d, e, f, g, h)
  48. return this.$init(a, b, c, d, e, f, g, h)
  49. }
  50. const VerifyPhoneNumberRequest = Java.use('com.google.android.gms.constellation.VerifyPhoneNumberRequest')
  51. VerifyPhoneNumberRequest.$init.overload(
  52. 'java.lang.String',
  53. 'long',
  54. 'com.google.android.gms.constellation.IdTokenRequest',
  55. 'android.os.Bundle',
  56. 'java.util.List',
  57. 'boolean',
  58. 'int',
  59. 'java.util.List'
  60. ).implementation = function (a, b, c, d, e, f, g, h) {
  61. Log.i('VerifyPhoneNumberRequest.$init', a, b, c, d, e, f, g, h)
  62. return this.$init(a, b, c, d, e, f, g, h)
  63. }
  64. const bhyo = Java.use('bhyo')
  65. bhyo.d.overload('java.lang.String').implementation = function (str) {
  66. Log.s(`bhyo.d(str=${str}) modify res.b to upi-carrier-id-with-mo-sms-relax`)
  67. const res = this.d(str)
  68. // res.b.value = 'upi-carrier-id-with-mo-sms-relax'
  69. Log.s(res)
  70. return res
  71. }
  72. bhyo.c.overload('java.lang.String').implementation = function (str) {
  73. Log.s(`bhyo.c(str=${str}) modify res.C to 1`)
  74. const res = this.c(str)
  75. res.C.value = 2
  76. return res
  77. }
  78. })
  79. }, 0)