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
bhook(aka ByteHook) is a PLT hook framework for Android app.
10
+
ByteHook is a PLT hook framework for Android app.
11
11
12
-
Most of ByteDance's Android apps use bhook as the PLT hook solution online.
12
+
Most of ByteDance's Android apps use ByteHook as the PLT hook solution online.
13
13
14
14
15
15
## Features
@@ -28,7 +28,7 @@ Most of ByteDance's Android apps use bhook as the PLT hook solution online.
28
28
29
29
### 1. Add dependency in build.gradle
30
30
31
-
bhook is published on [Maven Central](https://search.maven.org/), and uses [Prefab](https://google.github.io/prefab/) package format for [native dependencies](https://developer.android.com/studio/build/native-dependencies), which is supported by [Android Gradle Plugin 4.0+](https://developer.android.com/studio/releases/gradle-plugin?buildsystem=cmake#native-dependencies).
31
+
ByteHook is published on [Maven Central](https://search.maven.org/), and uses [Prefab](https://google.github.io/prefab/) package format for [native dependencies](https://developer.android.com/studio/build/native-dependencies), which is supported by [Android Gradle Plugin 4.0+](https://developer.android.com/studio/releases/gradle-plugin?buildsystem=cmake#native-dependencies).
32
32
33
33
```Gradle
34
34
allprojects {
@@ -87,7 +87,7 @@ android {
87
87
88
88
### 4. Add packaging options
89
89
90
-
If you are using bhook in an SDK project, you may need to avoid packaging libbytehook.so into your AAR, so as not to encounter duplicate libbytehook.so file when packaging the app project.
90
+
If you are using ByteHook in an SDK project, you may need to avoid packaging libbytehook.so into your AAR, so as not to encounter duplicate libbytehook.so file when packaging the app project.
91
91
92
92
```Gradle
93
93
android {
@@ -97,7 +97,7 @@ android {
97
97
}
98
98
```
99
99
100
-
On the other hand, if you are using bhook in an APP project, you may need to add some options to deal with conflicts caused by duplicate libbytehook.so file.
100
+
On the other hand, if you are using ByteHook in an APP project, you may need to add some options to deal with conflicts caused by duplicate libbytehook.so file.
101
101
102
102
```Gradle
103
103
android {
@@ -158,11 +158,15 @@ These three hook functions are used to hook single, partial, and all caller dyna
158
158
Notice:
159
159
* If you need to call the original function in the proxy function, please always use the `BYTEHOOK_CALL_PREV()` macro.
160
160
* Make sure to call `BYTEHOOK_POP_STACK()` macro before proxy function returning. In the CPP source file, you can also call `BYTEHOOK_STACK_SCOPE()` macro at the beginning of the proxy function instead.
161
-
* bhook proxies `dlopen()` and `android_dlopen_ext()` internally, so please do not try to hook these two functions. If you want to monitor the loading of ELF, please use `bytehook_add_dlopen_callback()` and `bytehook_del_dlopen_callback()`.
162
161
163
162
There is a sample app in the [bytehook-sample](bytehook_sample) folder you can refer to.
0 commit comments