import{_ as e,o as a,c as s,a as n}from"./app-OEUYI7Bq.js";const c={},l=n(`<h1 id="r8-与-proguard-混淆" tabindex="-1"><a class="header-anchor" href="#r8-与-proguard-混淆" aria-hidden="true">#</a> R8 与 Proguard 混淆</h1><blockquote><p>大部分场景下 Android 应用程序安装包可通过混淆压缩体积，这里介绍了混淆规则的配置方法。</p></blockquote><p>如果你使用了 <a href="../library/kavaref-extension">kavaref-extension</a> 模块，并使用了其中的 <code>TypeRef</code> 功能，请在你的 <code>proguard-rules.pro</code> 文件中添加以下规则。</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="shiki github-dark-dimmed" style="background-color:#22272e;" tabindex="0"><code><span class="line"><span style="color:#adbac7;">-keepattributes Signature</span></span>
<span class="line"><span style="color:#adbac7;">-keep,allowobfuscation class * extends com.highcapable.kavaref.extension.TypeRef</span></span>
<span class="line"><span style="color:#adbac7;">-keepclassmembers class * extends com.highcapable.kavaref.extension.TypeRef {</span></span>
<span class="line"><span style="color:#adbac7;">    &lt;init&gt;(...);</span></span>
<span class="line"><span style="color:#adbac7;">}</span></span>
<span class="line"><span style="color:#adbac7;"></span></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><code>TypeRef</code> 已添加 <code>Keep</code> 注解，如果无效，请手动添加以下规则以保留类。</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="shiki github-dark-dimmed" style="background-color:#22272e;" tabindex="0"><code><span class="line"><span style="color:#adbac7;">-keep class com.highcapable.kavaref.extension.TypeRef {*;}</span></span>
<span class="line"><span style="color:#adbac7;"></span></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div>`,6),d=[l];function i(r,o){return a(),s("div",null,d)}const p=e(c,[["render",i],["__file","r8-proguard.html.vue"]]);export{p as default};
