| 123456789101112131415161718192021222324252627282930 |
- import { log } from "./logger.js"
- setImmediate(() => {
- Java.perform(() => {
- var MainActivity = Java.use("com.google.android.apps.messaging.main.MainActivity")
- var SmsUtil = Java.use("com.example.mysmsapp.SmsUtils")
- Java.choose("com.example.mysmsapp.MainActivity", {
- onMatch: function (instance) {
- log("Found instance of MainActivity")
- var intent = SmsUtil.getSmsIntent("123", "test")
- var Receiver = Java.use(
- "com.example.mysmsapp.SmsReceiver"
- )
- var onReceiveMethod = Receiver.onReceive
- var receiverInstance = Receiver.$new()
- var context = Java.use("android.app.ActivityThread")
- .currentApplication()
- .getApplicationContext()
- onReceiveMethod.call(receiverInstance, context, intent)
- },
- onComplete: function () {
- log("Completed")
- }
- })
- var res = SmsUtil.createFakeSms("123", "11a1sdfasdftest")
- log(res)
- log(res.length)
- })
- })
|