Files
Hikage/assets/r8-proguard.html-QzcvrWH7.js
github-actions[bot] bd0c3576e8 Deploy to GitHub pages
2025-12-17 02:22:30 +00:00

6 lines
2.2 KiB
JavaScript

import{_ as e,o as a,c as s,e as o}from"./app-ZhvU1cLD.js";const n={},i=o(`<h1 id="r8-proguard-obfuscation" tabindex="-1"><a class="header-anchor" href="#r8-proguard-obfuscation" aria-hidden="true">#</a> R8 &amp; Proguard Obfuscation</h1><blockquote><p>In most scenarios, app packages can be compressed through obfuscation. Here is an introduction to how to configure obfuscation rules.</p></blockquote><p><code>Hikage</code> itself does not require additional configuration of obfuscation rules, since <code>View</code> objects created by Hikage do not need to be defined in XML, they can be equally obfuscated.</p><p>However, please note that if a custom <code>View</code> is not defined in XML, the latest R8 rules will choose to obfuscate it. To prevent the constructor from being lost, you still need to add the following rules to avoid problems.</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,allowobfuscation class * extends android.view.View {</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></div><p>If <code>Hikage</code> itself encounters problems after being obfuscated, you can use the following more aggressive rules to prevent <code>Hikage</code> from being obfuscated.</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.hikage.**</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>`,7),t=[i];function c(d,l){return a(),s("div",null,t)}const u=e(n,[["render",c],["__file","r8-proguard.html.vue"]]);export{u as default};