https://github.com/brucewind/jarhook
An example about hooking a method in jar.
https://github.com/brucewind/jarhook
bytecode hack hook
Last synced: about 1 month ago
JSON representation
An example about hooking a method in jar.
- Host: GitHub
- URL: https://github.com/brucewind/jarhook
- Owner: BruceWind
- License: apache-2.0
- Created: 2017-05-17T11:14:45.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-09-27T10:01:06.000Z (over 3 years ago)
- Last Synced: 2025-03-22T00:44:22.673Z (about 1 year ago)
- Topics: bytecode, hack, hook
- Language: Java
- Homepage:
- Size: 95.7 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JarHook
An example about hooking a Jar.
[中文](https://github.com/BruceWind/JarHook/blob/master/README_zh.md)
### my goal
In this project, I put `MainActivity.hookXM(String name);` into `sayHello`.
the source code of this jar in hello sub-module :
``` java
package com.androidyuan;
public class Hello {
public Hello() {
}
public static void sayHello(String name) { //this method would be hooked.
}
}
```
### important code in build.gradle
```
['methodName': 'sayHello', 'methodDesc': '(Ljava/lang/String;)V'
```
This code above has the structure is Byte-code. If you have seen some byte-code example, you may be familiar with it.
### Priciple
It modify Byte-code by hibeaber, which work with gradle and building process. And it depend on ASM.
## Thanks
[hibeaver](https://github.com/BryanSharp/hibeaver)
[ASM](https://github.com/marchof/asm)