Files
YukiHookAPI/docs/config/r8-proguard.md
2022-04-09 01:37:12 +08:00

28 lines
944 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# R8 与 Proguard 混淆
> 大部分场景下 Xposed 模块可通过原生混淆压缩体积,这里介绍了混淆的配置方法。
## R8
> 如果你使用的是 `R8`,那么你无需对 `YukiHookAPI` 进行任何特殊配置。
## Proguard
> 如果你仍然在使用 `Proguard`,你需要做一些规则配置。
`proguard-rules.pro` 添加如下代码即可。
> 示例如下
```proguard
-keep class com.highcapable.yukihookapi.hook.xposed.YukiHookModuleStatus {*;}
-keep class 这里填你的 HookEntryClass 入口类完整包名_YukiHookXposedInit {*;}
```
!> 自从 Android Gradle Plugin 4.2 后,拥有 Android Jetpack 套件最新版本的混淆处理程序默认均为 `R8`,基本可以不需要考虑混淆的问题。
若要在任何版本下启用 `R8`,请在 `gradle.properties` 文件中加入如下规则Android Gradle Plugin 7.0 及以上版本无需任何配置。
```gradle
android.enableR8=true
```