Skip to content

Commit 8e6843f

Browse files
author
rrrfff
committed
updates README
1 parent 1bc5111 commit 8e6843f

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

README.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,21 @@ AndHook is a lightweight java method hook framework for android, which supports
55
Android 4.x or later, most of the ROMs and devices (armeabi-v7a, arm64-v8a, x86, x86_64).
66

77
# Structure
8-
AndHook consists of the following part:
9-
- java
10-
- AndHook.java
11-
- optional bridge class of ArtHook and DalvikHook, and an inner class HookHelper is provided to help simplify method backup
12-
- ArtHook.java
13-
- ART hook apis
14-
- DalvikHook.java
15-
- Dalvik VM hook apis
16-
- jni
17-
- andhook.cpp
18-
- JNI_OnLoad/JNI_OnUnLoad
19-
- art.cpp
20-
- ART hook implementation
21-
- dalvik_vm.cpp
22-
- Dalvik VM hook implementation
8+
AndHook consists of only one java file (AndHook.java) and binaries for specified architectures, no other dependencies.
9+
- AndHook.java provides an optional bridge class of ArtHook and DalvikHook, and an inner class HookHelper to help simplify method backup.
2310

2411
# Usage
12+
Just put AndHook.java and binaries (*.so files) into proper directories, and do what you want. You don't need to compile jni code yourself as precompiled binaries is provided, and everyone who wants to contribute to it please contact me, thanks.
13+
- makes sure that all the classes involved are initialized, e.g. non-system classes. To prevent GC collections, AndHook will keep global reference of the class as well.
14+
```java
15+
AndHook.ensureClassInitialized(A.class);
16+
AndHook.ensureClassInitialized(B.class);
17+
```
2518
- simply replaces a method (compatible with all Android version, but may encounter some issues such as NoSuchMethodError. `You should try this first to see if it meets your requirements`):
2619
```java
2720
AndHook.replaceMethod(final Method origin, final Method replacement);
2821
```
29-
- replaces a method and applys workaround for known issues (with limited self-adapting capabilities, needs more tests):
22+
- replaces a method and applys workaround for known issues mentioned above (with limited self-adapting capabilities, needs more tests):
3023
```java
3124
AndHook.hookNoBackup(final Method origin, final Method replacement);
3225
```

0 commit comments

Comments
 (0)