Register broadcast receiver
This commit is contained in:
parent
9f6e7f9504
commit
36a223dbc0
33
README.md
33
README.md
@ -45,6 +45,7 @@
|
|||||||
* [`Bypass FLAG_SECURE`](#bypass-flag_secure)
|
* [`Bypass FLAG_SECURE`](#bypass-flag_secure)
|
||||||
* [`Shared Preferences update`](#shared-preferences-update)
|
* [`Shared Preferences update`](#shared-preferences-update)
|
||||||
* [`Hook all method overloads`](#hook-overloads)
|
* [`Hook all method overloads`](#hook-overloads)
|
||||||
|
* [`Register broadcast receiver`](#register-broadcast-receiver)
|
||||||
* File system access hook `$ frida --codeshare FrenchYeti/android-file-system-access-hook -f com.example.app --no-pause`
|
* File system access hook `$ frida --codeshare FrenchYeti/android-file-system-access-hook -f com.example.app --no-pause`
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@ -1412,8 +1413,6 @@ TODO
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### Hook overloads
|
#### Hook overloads
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@ -1455,6 +1454,36 @@ TODO
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
|
#### Register broadcast receiver
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Java.perform(() => {
|
||||||
|
const MyBroadcastReceiver = Java.registerClass({
|
||||||
|
name: 'MyBroadcastReceiver',
|
||||||
|
superClass: Java.use('android.content.BroadcastReceiver'),
|
||||||
|
methods: {
|
||||||
|
onReceive: [{
|
||||||
|
returnType: 'void',
|
||||||
|
argumentTypes: ['android.content.Context', 'android.content.Intent'],
|
||||||
|
implementation: function(context, intent) {
|
||||||
|
// ..
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
});
|
||||||
|
let ctx = Java.use('android.app.ActivityThread').currentApplication().getApplicationContext();
|
||||||
|
ctx.registerReceiver(MyBroadcastReceiver.$new(), Java.use('android.content.IntentFilter').$new('com.example.JAVA_TO_AGENT'));
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Output example</summary>
|
||||||
|
TODO
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
#### OS Log
|
#### OS Log
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
Loading…
Reference in New Issue
Block a user