sendsms.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. Java.perform(() => {
  2. Java.deoptimizeEverything()
  3. const RcsHackToolClass = Java.openClassFile(
  4. "/sdcard/Download/RcsHackTool.dex"
  5. )
  6. RcsHackToolClass.load()
  7. console.log("RcsHackTool class loaded", RcsHackToolClass.getClassNames())
  8. let found = false
  9. Java.choose("com.android.internal.telephony.SmsDispatchersController", {
  10. onMatch: function (instance) {
  11. if (found) {
  12. return
  13. }
  14. found = true
  15. console.log("Found instance of SmsDispatchersController")
  16. const RcsHackTool = Java.use("com.example.RcsHackTool")
  17. const intent = RcsHackTool.createSmsIntent(
  18. "3456",
  19. "Google Chat features code RmIQYpA3gtU 979881",
  20. 0,
  21. 57
  22. )
  23. // instance.mContext.value.sendBroadcast(intent)
  24. intent.setAction("android.provider.Telephony.SMS_RECEIVED")
  25. instance.mContext.value.sendBroadcast(intent)
  26. intent.setAction("android.provider.Telephony.SMS_DELIVER")
  27. instance.mContext.value.sendBroadcast(intent)
  28. console.log("Sent SMS")
  29. send("ok")
  30. },
  31. onComplete: function () {
  32. console.log("Completed choose SmsDispatchersController")
  33. }
  34. })
  35. // Java.choose('com.android.internal.telephony.InboundSmsHandler', {
  36. // onMatch: function(instance) {
  37. // console.log("Found instance of InboundSmsHandler")
  38. // instance.processMessagePart()
  39. // },
  40. // onComplete: function() {
  41. // console.log("Completed choose InboundSmsHandler")
  42. // }
  43. // })
  44. // Java.choose('com.android.internal.telephony.cdma.CdmaInboundSmsHandler', {
  45. // onMatch: function(instance) {
  46. // console.log("Found instance of CdmaInboundSmsHandler")
  47. // instance.dispatchMessage()
  48. // },
  49. // onComplete: function() {
  50. // console.log("Completed choose CdmaInboundSmsHandler")
  51. // }
  52. // })
  53. // Java.choose('com.android.internal.telephony.gsm.GsmInboundSmsHandler', {
  54. // onMatch: function(instance) {
  55. // console.log("Found instance of GsmInboundSmsHandler")
  56. // instance.dispatchMessage()
  57. // },
  58. // onComplete: function() {
  59. // console.log("Completed choose GsmInboundSmsHandler")
  60. // }
  61. // })
  62. // setTimeout(() => {
  63. // Java.choose("com.google.android.apps.messaging.home.HomeActivity", {
  64. // onMatch: function (instance) {
  65. // console.log("Found instance of MainActivity")
  66. // const intent = Java.use(
  67. // "com.example.smshook.HookTools"
  68. // ).getSmsIntent(
  69. // "123",
  70. // "test",
  71. // "3gpp",
  72. // 1,
  73. // parseInt((Math.random() * 100000000).toString()),
  74. // 1,
  75. // 1,
  76. // 1
  77. // )
  78. // // var context = instance.getApplicationContext()
  79. // var Receiver = Java.use(
  80. // "com.google.android.apps.messaging.shared.receiver.SmsDeliverReceiver"
  81. // )
  82. // var onReceiveMethod = Receiver.onReceive
  83. // var receiverInstance = Receiver.$new()
  84. // var context = Java.use("android.app.ActivityThread")
  85. // .currentApplication()
  86. // .getApplicationContext()
  87. // onReceiveMethod.call(receiverInstance, context, intent)
  88. // },
  89. // onComplete: function () {
  90. // console.log("Completed")
  91. // }
  92. // })
  93. // }, 1000)
  94. })