docs: update r8-proguard

This commit is contained in:
2025-12-13 21:35:36 +08:00
parent ac678ae6af
commit 30e2bd2a80
2 changed files with 24 additions and 2 deletions

View File

@@ -3,4 +3,15 @@
> In most scenarios, Android application installation packages can reduce size through obfuscation. > In most scenarios, Android application installation packages can reduce size through obfuscation.
> Here is a configuration method for obfuscation rules. > Here is a configuration method for obfuscation rules.
`KavaRef` does not require any additional configuration of obfuscation rules in Android projects. If you are using the [kavaref-extension](../library/kavaref-extension) module and using the `TypeRef` feature, please add the following rule to your `proguard-rules.pro` file.
```
-keepattributes Signature
```
`TypeRef` has been annotated with `Keep`. If it doesn't work, please manually add the following rules to keep the class.
```
-keep class com.highcapable.kavaref.extension.TypeRef {*;}
-keep class,allowobfuscation * extends com.highcapable.kavaref.extension.TypeRef
```

View File

@@ -2,4 +2,15 @@
> 大部分场景下 Android 应用程序安装包可通过混淆压缩体积,这里介绍了混淆规则的配置方法。 > 大部分场景下 Android 应用程序安装包可通过混淆压缩体积,这里介绍了混淆规则的配置方法。
`KavaRef` 在 Android 项目中不需要额外配置任何混淆规则。 如果你使用了 [kavaref-extension](../library/kavaref-extension) 模块,并使用了其中的 `TypeRef` 功能,请在你的 `proguard-rules.pro` 文件中添加以下规则。
```
-keepattributes Signature
```
`TypeRef` 已添加 `Keep` 注解,如果无效,请手动添加以下规则以保留类。
```
-keep class com.highcapable.kavaref.extension.TypeRef {*;}
-keep class,allowobfuscation * extends com.highcapable.kavaref.extension.TypeRef
```