Merge new documentation

This commit is contained in:
2022-04-09 01:37:12 +08:00
parent c3fbaf553f
commit a455eec5de
52 changed files with 8270 additions and 104 deletions

106
README.md
View File

@@ -18,116 +18,14 @@
《ももくり》女主 栗原 雪(Yuki)</a>
- 前身为 [开发学习项目](https://github.com/fankes/TMore) 中使用的 Innocent Xposed API现在重新命名并开源
# Functions
# Get Started
- <strong>Xposed 模块开发</strong><br/>
自动构建程序可以帮你快速创建一个 Xposed 模块,完全省去配置入口类和 xposed_init 文件。<br/>
- <strong>轻量优雅</strong><br/>
拥有一套强大、优雅和人性化的 Kotlin Lambda Hook API可以帮你快速实现 Method、Constructor、Field 的查找以及 Hook。<br/>
- <strong>高效调试</strong><br/>
拥有丰富的调试日志功能,细到每个 Hook 方法的名称、所在类以及查找耗时,可进行快速调试和排错。<br/>
- <strong>方便移植</strong><br/>
原生支持 Xposed API 用法,并原生对接 Xposed API拥有 Xposed API 的 Hook 框架都能快速对接 Yuki Hook API。<br/>
- <strong>支持混淆</strong><br/>
使用 Yuki Hook API 构建的 Xposed 模块原生支持 R8 压缩优化混淆,混淆不会破坏 Hook 入口点R8 下无需任何其它配置。<br/>
- <strong>快速上手</strong><br/>
简单易用,不需要繁琐的配置,不需要十足的开发经验,搭建环境集成依赖即可立即开始使用。
# Supports
以下是 `YukiHookAPI` 支持的 `Hook Framework` 以及 Xposed 框架。
| Hook Framework | ST | Describe |
| --------------------------------------------------------- | -- | ---------------------------------------------------------------------------------------- |
| [LSPosed](https://github.com/LSPosed/LSPosed) | ✅ | 多场景下稳定使用 |
| [EdXposed](https://github.com/ElderDrivers/EdXposed) | ☑ | 部分兼容 |
| [Pine](https://github.com/canyie/pine) | ⭕ | 可以使用 |
| [SandHook](https://github.com/asLody/SandHook) | ⭕ | 可以使用 |
| [Whale](https://github.com/asLody/whale) | ⭕ | 需要 [xposed-hook-based-on-whale](https://github.com/WindySha/xposed-hook-based-on-whale) |
| [YAHFA](https://github.com/PAGalaxyLab/YAHFA) | ❗ | 需要自行实现 Xposed API |
| [FastHook](https://github.com/turing-technician/FastHook) | ❗ | 需要自行实现 Xposed API |
| [Epic](https://github.com/tiann/epic) | ❗ | 需要自行对接 [Dexposed](https://github.com/alibaba/dexposed) |
| [TaiChi](https://github.com/taichi-framework/TaiChi) | ⭕ | 可以作为模块使用 |
| [Xposed](https://github.com/rovo89/Xposed) | ❎ | 未测试,不再推荐使用 |
- [点击这里](https://fankes.github.io/YukiHookAPI) 前往文档页面查看更多详细教程和内容。
# Contacts
- [点击加入 Telegram 群组](https://t.me/YukiHookAPI)
# Advantage
以前,我们在构建 Xposed 模块的时候,首先需要在 `assets` 下创建 `xposed_init` 文件。<br/><br/>
然后,将自己的入口类名手动填入文件中,使用 `XposedHelper` 去实现我们的 Hook 逻辑。
- 示例如下
```kotlin
class MainHook : IXposedHookLoadPackage {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
if (lpparam.packageName == "com.android.browser")
XposedHelpers.findAndHookMethod(
Activity::class.java.name,
lpparam.classLoader,
"onCreate",
Bundle::class.java,
object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam?) {
// Your code here.
}
override fun afterHookedMethod(param: MethodHookParam?) {
// Your code here.
}
})
}
}
```
`Kotlin` 作为 Android 主要开发语言以来,这套 API 用起来确实已经不是很优雅了。<br/><br/>
有没有什么 <b>好用、轻量、优雅</b> 的解决办法呢?<br/><br/>
本着这样的想法,`YukiHookAPI` 诞生了。<br/><br/>
现在,我们只需要编写少量的代码,一切时间开销和花费交给自动化处理。
- 示例如下
```kotlin
@InjectYukiHookWithXposed
class MainHook : YukiHookXposedInitProxy {
override fun onHook() = encase {
loadApp(name = "com.android.browser") {
ActivityClass.hook {
injectMember {
method {
name = "onCreate"
param(BundleClass)
}
beforeHook {
// Your code here.
}
afterHook {
// Your code here.
}
}
}
}
}
}
```
是的,你没有看错,仅仅就需要这几行代码,就一切安排妥当。<br/><br/>
代码量少,逻辑清晰,借助高效强大的 `YukiHookAPI`,你就可以实现一个非常简单的 Xposed 模块。
# Get Started
- 你可以点击 [快速开始](https://github.com/fankes/YukiHookAPI/wiki#%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B),在 `Gradle` 中集成 `YukiHookAPI` 并开始使用。
- 更多使用教程及 API 文档请 [前往 Wiki 主页](https://github.com/fankes/YukiHookAPI/wiki) 进行查看。
# Changelogs
- [更新日志](https://github.com/fankes/YukiHookAPI/blob/master/CHANGELOG.md)
# Features
如果你喜欢 `YukiHookAPI` 项目,欢迎为此项目贡献你的代码,可以是任何改进的建议以及新增的功能。