Skip to content

Commit cf0505f

Browse files
committed
Add documentation.
1 parent a9ddf48 commit cf0505f

16 files changed

+1179
-17
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Contributing to bhook
1+
# Contributing to ByteHook
22

3-
Welcome to the bhook project. Read on to learn more about our development process and how to propose bug fixes and improvements.
3+
Welcome to the ByteHook project. Read on to learn more about our development process and how to propose bug fixes and improvements.
44

55
## Issues
66

@@ -44,4 +44,4 @@ Please make sure the following is done when submitting a pull request:
4444

4545
## License
4646

47-
By contributing to bhook, you agree that your contributions will be licensed under its [MIT LICENSE](LICENSE).
47+
By contributing to ByteHook, you agree that your contributions will be licensed under its [MIT LICENSE](LICENSE).

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# bhook
1+
# ByteHook
22

33
![](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)
44
![](https://img.shields.io/badge/release-1.0.1-red.svg?style=flat)
@@ -7,9 +7,9 @@
77

88
[README 中文版](README.zh-CN.md)
99

10-
bhook(aka ByteHook) is a PLT hook framework for Android app.
10+
ByteHook is a PLT hook framework for Android app.
1111

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.
1313

1414

1515
## Features
@@ -28,7 +28,7 @@ Most of ByteDance's Android apps use bhook as the PLT hook solution online.
2828

2929
### 1. Add dependency in build.gradle
3030

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).
3232

3333
```Gradle
3434
allprojects {
@@ -87,7 +87,7 @@ android {
8787

8888
### 4. Add packaging options
8989

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.
9191

9292
```Gradle
9393
android {
@@ -97,7 +97,7 @@ android {
9797
}
9898
```
9999

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.
101101

102102
```Gradle
103103
android {
@@ -158,11 +158,15 @@ These three hook functions are used to hook single, partial, and all caller dyna
158158
Notice:
159159
* If you need to call the original function in the proxy function, please always use the `BYTEHOOK_CALL_PREV()` macro.
160160
* 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()`.
162161
163162
There is a sample app in the [bytehook-sample](bytehook_sample) folder you can refer to.
164163
165164
165+
## Documentation
166+
167+
[Documentation](doc)
168+
169+
166170
## Contributing
167171
168172
[Contributing Guide](CONTRIBUTING.md)

README.zh-CN.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# bhook
1+
# ByteHook
22

33
![](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)
44
![](https://img.shields.io/badge/release-1.0.1-red.svg?style=flat)
@@ -7,9 +7,9 @@
77

88
[README English Version](README.md)
99

10-
bhook(aka ByteHook) 是一个针对 Android app 的 PLT hook 框架。
10+
ByteHook 是一个针对 Android app 的 PLT hook 框架。
1111

12-
字节跳动的大多数 Android app 在线上使用了 bhook 作为 PLT hook 方案。
12+
字节跳动的大多数 Android app 在线上使用了 ByteHook 作为 PLT hook 方案。
1313

1414

1515
## 特征
@@ -28,7 +28,7 @@ bhook(aka ByteHook) 是一个针对 Android app 的 PLT hook 框架。
2828

2929
### 1. 在 build.gradle 中增加依赖
3030

31-
bhook 发布在 [Maven Central](https://search.maven.org/) 上。为了使用 [native 依赖项](https://developer.android.com/studio/build/native-dependencies)xDL 使用了从 [Android Gradle Plugin 4.0+](https://developer.android.com/studio/releases/gradle-plugin?buildsystem=cmake#native-dependencies) 开始支持的 [Prefab](https://google.github.io/prefab/) 包格式。
31+
ByteHook 发布在 [Maven Central](https://search.maven.org/) 上。为了使用 [native 依赖项](https://developer.android.com/studio/build/native-dependencies)ByteHook 使用了从 [Android Gradle Plugin 4.0+](https://developer.android.com/studio/releases/gradle-plugin?buildsystem=cmake#native-dependencies) 开始支持的 [Prefab](https://google.github.io/prefab/) 包格式。
3232

3333
```Gradle
3434
allprojects {
@@ -87,7 +87,7 @@ android {
8787

8888
### 4. 增加打包选项
8989

90-
如果你是在一个 SDK 工程里使用 bhook,你可能需要避免把 libbytehook.so 打包到你的 AAR 里,以免 app 工程打包时遇到重复的 libbytehook.so 文件。
90+
如果你是在一个 SDK 工程里使用 ByteHook,你可能需要避免把 libbytehook.so 打包到你的 AAR 里,以免 app 工程打包时遇到重复的 libbytehook.so 文件。
9191

9292
```Gradle
9393
android {
@@ -97,7 +97,7 @@ android {
9797
}
9898
```
9999

100-
另一方面, 如果你是在一个 APP 工程里使用 bhook,你可以需要增加一些选项,用来处理重复的 libbytehook.so 文件引起的冲突。
100+
另一方面, 如果你是在一个 APP 工程里使用 ByteHook,你可以需要增加一些选项,用来处理重复的 libbytehook.so 文件引起的冲突。
101101

102102
```Gradle
103103
android {
@@ -158,11 +158,15 @@ int bytehook_unhook(bytehook_stub_t stub);
158158
注意:
159159
* 如果需要在代理函数中调用原函数,请始终使用 `BYTEHOOK_CALL_PREV()` 宏来完成。
160160
* 确保在代理函数返回前调用 `BYTEHOOK_POP_STACK()` 宏。在 CPP 源文件中,也可以改为在代理函数的开头调用 `BYTEHOOK_STACK_SCOPE()` 宏。
161-
* bhook 在内部代理了 `dlopen()` 和 `android_dlopen_ext()`,所以请不要试图 hook 这两个函数。如果想监控 ELF 的加载,请使用 `bytehook_add_dlopen_callback()` 和 `bytehook_del_dlopen_callback()`。
162161
163162
你可以参考 [bytehook-sample](bytehook_sample) 文件夹中的示例 app。
164163
165164
165+
## 文档
166+
167+
[Documentation](doc)
168+
169+
166170
## 贡献
167171
168172
[Contributing Guide](CONTRIBUTING.md)

doc/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# ByteHook Documentation
2+
3+
Only Chinese documents are now available.
4+
5+
现在只有中文文档。
6+
7+
[项目介绍和原理概述](overview.zh-CN.md)
8+
9+
[快速入门使用](quickstart.zh-CN.md)
10+
11+
[Java API 手册](java_manual.zh-CN.md)
12+
13+
[Native API 手册](native_manual.zh-CN.md)
14+
15+
[状态码](status_code.zh-CN.md)

doc/img/bytehook_intro.png

65.3 KB
Loading

doc/img/elf.png

485 KB
Loading

doc/img/linker_reloc.png

279 KB
Loading

doc/img/linker_reloc_call.png

98.5 KB
Loading

doc/img/linker_reloc_ref.png

119 KB
Loading

doc/img/unhook_with_trampoline.png

78.4 KB
Loading

0 commit comments

Comments
 (0)