You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-16Lines changed: 9 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,28 +5,21 @@ AndHook is a lightweight java method hook framework for android, which supports
5
5
Android 4.x or later, most of the ROMs and devices (armeabi-v7a, arm64-v8a, x86, x86_64).
6
6
7
7
# 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.
23
10
24
11
# 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
+
```
25
18
- 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`):
0 commit comments