import{_ as e,r as o,o as p,c,b as s,d as i,a,e as n}from"./app.78a03919.js";const t={},r=a(`<h1 id="\u5BBF\u4E3B\u8D44\u6E90\u6CE8\u5165\u6269\u5C55" tabindex="-1"><a class="header-anchor" href="#\u5BBF\u4E3B\u8D44\u6E90\u6CE8\u5165\u6269\u5C55" aria-hidden="true">#</a> \u5BBF\u4E3B\u8D44\u6E90\u6CE8\u5165\u6269\u5C55</h1><blockquote><p>\u8FD9\u662F\u4E00\u4E2A\u5C06\u6A21\u5757\u8D44\u6E90\u3001<code>Activity</code> \u7EC4\u4EF6\u4EE5\u53CA <code>Context</code> \u4E3B\u9898\u6CE8\u5165\u5230\u5BBF\u4E3B\u7684\u6269\u5C55\u529F\u80FD\u3002</p></blockquote><p>\u5728\u4F7F\u7528\u4EE5\u4E0B\u529F\u80FD\u4E4B\u524D\uFF0C\u4E3A\u9632\u6B62\u8D44\u6E90 ID \u4E92\u76F8\u51B2\u7A81\uFF0C\u4F60\u9700\u8981\u5728\u5F53\u524D Xposed \u6A21\u5757\u9879\u76EE\u7684 <code>build.gradle</code> \u4E2D\u4FEE\u6539\u8D44\u6E90 ID\u3002</p><ul><li>Kotlin Gradle DSL</li></ul><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">android {</span></span>
<span class="line"><span style="color:#ADBAC7;">    androidResources.additionalParameters(</span><span style="color:#96D0FF;">&quot;--allow-reserved-package-id&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;--package-id&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;0x64&quot;</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></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><ul><li>Groovy</li></ul><div class="language-groovy ext-groovy line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">android {</span></span>
<span class="line"><span style="color:#ADBAC7;">    aaptOptions</span><span style="color:#F47067;">.</span><span style="color:#ADBAC7;">additionalParameters </span><span style="color:#96D0FF;">&#39;--allow-reserved-package-id&#39;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&#39;--package-id&#39;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&#39;0x64&#39;</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></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><div class="custom-container warning"><p class="custom-container-title">\u6CE8\u610F</p><p>\u63D0\u4F9B\u7684\u793A\u4F8B\u8D44\u6E90 ID \u503C\u4EC5\u4F9B\u53C2\u8003\uFF0C\u4E0D\u53EF\u4F7F\u7528 <strong>0x7f</strong>\uFF0C\u9ED8\u8BA4\u4E3A <strong>0x64</strong>\uFF0C\u4E3A\u4E86\u9632\u6B62\u5F53\u524D\u5BBF\u4E3B\u5B58\u5728\u591A\u4E2A Xposed \u6A21\u5757\uFF0C\u5EFA\u8BAE\u81EA\u5B9A\u4E49\u4F60\u81EA\u5DF1\u7684\u8D44\u6E90 ID\u3002</p></div><h2 id="\u6CE8\u5165\u6A21\u5757\u8D44\u6E90-resources" tabindex="-1"><a class="header-anchor" href="#\u6CE8\u5165\u6A21\u5757\u8D44\u6E90-resources" aria-hidden="true">#</a> \u6CE8\u5165\u6A21\u5757\u8D44\u6E90 (Resources)</h2><p>\u5728 Hook \u5BBF\u4E3B\u4E4B\u540E\uFF0C\u6211\u4EEC\u53EF\u4EE5\u76F4\u63A5\u5728 Hooker \u4E2D\u5F97\u5230\u7684 <code>Context</code> \u6CE8\u5165\u5F53\u524D\u6A21\u5757\u8D44\u6E90\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">injectMember {</span></span>
<span class="line"><span style="color:#ADBAC7;">    method {</span></span>
<span class="line"><span style="color:#ADBAC7;">        name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;onCreate&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">        param(</span><span style="color:#F69D50;">BundleClass</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">    afterHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        instance</span><span style="color:#F47067;">&lt;</span><span style="color:#F69D50;">Activity</span><span style="color:#F47067;">&gt;</span><span style="color:#ADBAC7;">().</span><span style="color:#6CB6FF;">also</span><span style="color:#ADBAC7;"> {</span></span>
<span class="line"><span style="color:#ADBAC7;">            </span><span style="color:#768390;">// &lt;\u65B9\u68481&gt; \u901A\u8FC7 Context \u6CE8\u5165\u6A21\u5757\u8D44\u6E90</span></span>
<span class="line"><span style="color:#ADBAC7;">            it.injectModuleAppResources()</span></span>
<span class="line"><span style="color:#ADBAC7;">            </span><span style="color:#768390;">// &lt;\u65B9\u68482&gt; \u76F4\u63A5\u5F97\u5230\u5BBF\u4E3B Resources \u6CE8\u5165\u6A21\u5757\u8D44\u6E90</span></span>
<span class="line"><span style="color:#ADBAC7;">            it.resources.injectModuleAppResources()</span></span>
<span class="line"><span style="color:#ADBAC7;">            </span><span style="color:#768390;">// \u76F4\u63A5\u4F7F\u7528\u6A21\u5757\u8D44\u6E90 ID</span></span>
<span class="line"><span style="color:#ADBAC7;">            it.getString(</span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.id.app_name)</span></span>
<span class="line"><span style="color:#ADBAC7;">        }</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></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 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 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 class="line-number"></div></div></div><p>\u4F60\u8FD8\u53EF\u4EE5\u76F4\u63A5\u5728 <code>AppLifecycle</code> \u4E2D\u6CE8\u5165\u5F53\u524D\u6A21\u5757\u8D44\u6E90\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">onAppLifecycle {</span></span>
<span class="line"><span style="color:#ADBAC7;">    onCreate {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u5168\u5C40\u6CE8\u5165\u6A21\u5757\u8D44\u6E90\uFF0C\u4F46\u4EC5\u9650\u4E8E\u5168\u5C40\u751F\u547D\u5468\u671F</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u7C7B\u4F3C ImageView.setImageResource \u8FD9\u6837\u7684\u65B9\u6CD5\u5728 Activity \u4E2D\u9700\u8981\u5355\u72EC\u6CE8\u5165</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// &lt;\u65B9\u68481&gt; \u901A\u8FC7 Context \u6CE8\u5165\u6A21\u5757\u8D44\u6E90</span></span>
<span class="line"><span style="color:#ADBAC7;">        injectModuleAppResources()</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// &lt;\u65B9\u68482&gt; \u76F4\u63A5\u5F97\u5230\u5BBF\u4E3B Resources \u6CE8\u5165\u6A21\u5757\u8D44\u6E90</span></span>
<span class="line"><span style="color:#ADBAC7;">        resources.injectModuleAppResources()</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u76F4\u63A5\u4F7F\u7528\u6A21\u5757\u8D44\u6E90 ID</span></span>
<span class="line"><span style="color:#ADBAC7;">        getString(</span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.id.app_name)</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></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 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 class="line-number"></div><div class="line-number"></div></div></div><div class="custom-container tip"><p class="custom-container-title">\u5C0F\u63D0\u793A</p><p>\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 <a href="../public/com/highcapable/yukihookapi/hook/factory/YukiHookFactory#context-resources-injectmoduleappresources-ext-method">Context+Resources.injectModuleAppResources</a> \u65B9\u6CD5\u3002</p></div><h2 id="\u6CE8\u518C\u6A21\u5757-activity" tabindex="-1"><a class="header-anchor" href="#\u6CE8\u518C\u6A21\u5757-activity" aria-hidden="true">#</a> \u6CE8\u518C\u6A21\u5757 Activity</h2><p>\u5728 Android \u7CFB\u7EDF\u4E2D\u6240\u6709\u5E94\u7528\u7684 <code>Activity</code> \u542F\u52A8\u65F6\uFF0C\u90FD\u9700\u8981\u5728 <code>AndroidManifest.xml</code> \u4E2D\u8FDB\u884C\u6CE8\u518C\uFF0C\u5728 Hook \u8FC7\u7A0B\u4E2D\uFF0C\u5982\u679C\u6211\u4EEC\u60F3\u901A\u8FC7\u5BBF\u4E3B\u6765\u76F4\u63A5\u542F\u52A8\u6A21\u5757\u4E2D\u672A\u6CE8\u518C\u7684 <code>Activity</code> \u8981\u600E\u4E48\u505A\u5462\uFF1F</p><p>\u5728 Hook \u5BBF\u4E3B\u4E4B\u540E\uFF0C\u6211\u4EEC\u53EF\u4EE5\u76F4\u63A5\u5728 Hooker \u4E2D\u5F97\u5230\u7684 <code>Context</code> \u6CE8\u518C\u5F53\u524D\u6A21\u5757\u7684 <code>Activity</code> \u4EE3\u7406\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">injectMember {</span></span>
<span class="line"><span style="color:#ADBAC7;">    method {</span></span>
<span class="line"><span style="color:#ADBAC7;">        name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;onCreate&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">        param(</span><span style="color:#F69D50;">BundleClass</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">    afterHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        instance</span><span style="color:#F47067;">&lt;</span><span style="color:#F69D50;">Activity</span><span style="color:#F47067;">&gt;</span><span style="color:#ADBAC7;">().registerModuleAppActivities()</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></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 class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>\u4F60\u8FD8\u53EF\u4EE5\u76F4\u63A5\u5728 <code>AppLifecycle</code> \u4E2D\u6CE8\u518C\u5F53\u524D\u6A21\u5757\u7684 <code>Activity</code> \u4EE3\u7406\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">onAppLifecycle {</span></span>
<span class="line"><span style="color:#ADBAC7;">    onCreate {</span></span>
<span class="line"><span style="color:#ADBAC7;">        registerModuleAppActivities()</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></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>\u5982\u679C\u6CA1\u6709\u586B\u5199 <code>proxy</code> \u53C2\u6570\uFF0CAPI \u5C06\u4F1A\u6839\u636E\u5F53\u524D <code>Context</code> \u81EA\u52A8\u83B7\u53D6\u5F53\u524D\u5BBF\u4E3B\u7684\u542F\u52A8\u5165\u53E3 <code>Activity</code> \u8FDB\u884C\u4EE3\u7406\u3002</p><p>\u901A\u5E38\u60C5\u51B5\u4E0B\uFF0C\u5B83\u662F\u6709\u6548\u7684\uFF0C\u4F46\u662F\u4EE5\u4E0A\u60C5\u51B5\u5728\u4E00\u4E9B APP \u4E2D\u4F1A\u5931\u6548\uFF0C\u4F8B\u5982\u4E00\u4E9B <code>Activity</code> \u4F1A\u5728\u6CE8\u518C\u6E05\u5355\u4E0A\u52A0\u5165\u542F\u52A8\u53C2\u6570\uFF0C\u90A3\u4E48\u6211\u4EEC\u5C31\u9700\u8981\u4F7F\u7528\u53E6\u4E00\u79CD\u89E3\u51B3\u65B9\u6848\u3002</p><p>\u82E5\u672A\u6CE8\u518C\u7684 <code>Activity</code> \u4E0D\u80FD\u88AB\u6B63\u786E\u542F\u52A8\uFF0C\u6211\u4EEC\u53EF\u4EE5\u624B\u52A8\u62FF\u5230\u5BBF\u4E3B\u7684 <code>AndroidManifest.xml</code> \u8FDB\u884C\u5206\u6790\uFF0C\u6765\u5F97\u5230\u4E00\u4E2A\u6CE8\u518C\u8FC7\u7684 <code>Activity</code> \u6807\u7B7E\uFF0C\u83B7\u53D6\u5176\u4E2D\u7684 <code>name</code>\u3002</p><p>\u4F60\u9700\u8981\u9009\u62E9\u4E00\u4E2A\u5F53\u524D\u5BBF\u4E3B\u53EF\u80FD\u7528\u4E0D\u5230\u7684\u3001\u4E0D\u9700\u8981\u7684 <code>Activity</code> \u4F5C\u4E3A\u4E00\u4E2A\u201C\u5080\u5121\u201D\u5C06\u5176\u8FDB\u884C\u4EE3\u7406\uFF0C\u901A\u5E38\u662F\u6709\u6548\u7684\u3002</p><p>\u6BD4\u5982\u6211\u4EEC\u5DF2\u7ECF\u627E\u5230\u4E86\u80FD\u591F\u88AB\u4EE3\u7406\u7684\u5408\u9002 <code>Activity</code>\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-xml ext-xml line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">&lt;</span><span style="color:#8DDB8C;">activity</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#6CB6FF;">android:name</span><span style="color:#ADBAC7;">=</span><span style="color:#96D0FF;">&quot;com.demo.test.activity.TestActivity&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    ...&gt;</span></span>
<span class="line"></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>\u6839\u636E\u5176\u4E2D\u7684 <code>name</code>\uFF0C\u6211\u4EEC\u53EA\u9700\u8981\u5728\u65B9\u6CD5\u4E2D\u52A0\u5165\u8FD9\u4E2A\u53C2\u6570\u8FDB\u884C\u6CE8\u518C\u5373\u53EF\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">registerModuleAppActivities(proxy </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;com.demo.test.activity.TestActivity&quot;</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>\u53E6\u4E00\u79CD\u60C5\u51B5\uFF0C\u5982\u679C\u4F60\u5BF9\u5BBF\u4E3B\u7684\u7C7B\u7F16\u5199\u4E86\u4E00\u4E2A <code>stub</code>\uFF0C\u90A3\u4E48\u4F60\u53EF\u4EE5\u76F4\u63A5\u901A\u8FC7 <code>Class</code> \u5BF9\u8C61\u6765\u8FDB\u884C\u6CE8\u518C\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">registerModuleAppActivities(TestActivity::</span><span style="color:#6CB6FF;">class</span><span style="color:#ADBAC7;">.java)</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>\u6CE8\u518C\u5B8C\u6210\u540E\uFF0C\u8BF7\u5C06\u4F60\u9700\u8981\u4F7F\u7528\u5BBF\u4E3B\u542F\u52A8\u7684\u6A21\u5757\u4E2D\u7684 <code>Activity</code> \u7EE7\u627F\u4E8E <code>ModuleAppActivity</code> \u6216 <code>ModuleAppCompatActivity</code>\u3002</p><p>\u8FD9\u4E9B <code>Activity</code> \u73B0\u5728\u65E0\u9700\u6CE8\u518C\u5373\u53EF\u65E0\u7F1D\u5B58\u6D3B\u4E8E\u5BBF\u4E3B\u4E2D\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">class</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">HostTestActivity</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">ModuleAppActivity</span><span style="color:#ADBAC7;">() {</span></span>
<span class="line"></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#F47067;">override</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">onCreate</span><span style="color:#ADBAC7;">(savedInstanceState</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Bundle?</span><span style="color:#ADBAC7;">) {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#6CB6FF;">super</span><span style="color:#ADBAC7;">.onCreate(savedInstanceState)</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u6A21\u5757\u8D44\u6E90\u5DF2\u88AB\u81EA\u52A8\u6CE8\u5165\uFF0C\u53EF\u4EE5\u76F4\u63A5\u4F7F\u7528 xml \u88C5\u8F7D\u5E03\u5C40</span></span>
<span class="line"><span style="color:#ADBAC7;">        setContentView(</span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.layout.activity_main)</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></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 class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>\u82E5\u4F60\u9700\u8981\u7EE7\u627F\u4E8E <code>ModuleAppCompatActivity</code>\uFF0C\u4F60\u9700\u8981\u624B\u52A8\u8BBE\u7F6E AppCompat \u4E3B\u9898\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">class</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">HostTestActivity</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">ModuleAppCompatActivity</span><span style="color:#ADBAC7;">() {</span></span>
<span class="line"></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u8FD9\u91CC\u7684\u4E3B\u9898\u540D\u79F0\u4EC5\u4F9B\u53C2\u8003\uFF0C\u8BF7\u586B\u5199\u4F60\u6A21\u5757\u4E2D\u5DF2\u6709\u7684\u4E3B\u9898\u540D\u79F0</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#F47067;">override</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> moduleTheme get() </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">style</span><span style="color:#F47067;">.</span><span style="color:#F69D50;">Theme_AppCompat</span></span>
<span class="line"></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#F47067;">override</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">onCreate</span><span style="color:#ADBAC7;">(savedInstanceState</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Bundle?</span><span style="color:#ADBAC7;">) {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#6CB6FF;">super</span><span style="color:#ADBAC7;">.onCreate(savedInstanceState)</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u6A21\u5757\u8D44\u6E90\u5DF2\u88AB\u81EA\u52A8\u6CE8\u5165\uFF0C\u53EF\u4EE5\u76F4\u63A5\u4F7F\u7528 xml \u88C5\u8F7D\u5E03\u5C40</span></span>
<span class="line"><span style="color:#ADBAC7;">        setContentView(</span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.layout.activity_main)</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></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 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 class="line-number"></div></div></div><p>\u4EE5\u4E0A\u6B65\u9AA4\u5168\u90E8\u5B8C\u6210\u540E\uFF0C\u4F60\u5C31\u53EF\u4EE5\u5728 (Xposed) \u5BBF\u4E3B\u73AF\u5883\u4EFB\u610F\u5B58\u5728 <code>Context</code> \u7684\u5730\u65B9\u6109\u5FEB\u5730\u8C03\u7528 <code>startActivity</code> \u4E86\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> context</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Context</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> ... </span><span style="color:#768390;">// \u5047\u8BBE\u8FD9\u5C31\u662F\u4F60\u7684 Context</span></span>
<span class="line"><span style="color:#ADBAC7;">context.startActivity(context, HostTestActivity::</span><span style="color:#6CB6FF;">class</span><span style="color:#ADBAC7;">.java)</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><div class="custom-container tip"><p class="custom-container-title">\u5C0F\u63D0\u793A</p><p>\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 <a href="../public/com/highcapable/yukihookapi/hook/factory/YukiHookFactory#context-registermoduleappactivities-ext-method">Context.registerModuleAppActivities</a> \u65B9\u6CD5\u3002</p></div><h2 id="\u521B\u5EFA-contextthemewrapper-\u4EE3\u7406" tabindex="-1"><a class="header-anchor" href="#\u521B\u5EFA-contextthemewrapper-\u4EE3\u7406" aria-hidden="true">#</a> \u521B\u5EFA ContextThemeWrapper \u4EE3\u7406</h2><p>\u6709\u65F6\u5019\uFF0C\u6211\u4EEC\u9700\u8981\u4F7F\u7528 <code>MaterialAlertDialogBuilder</code> \u6765\u7F8E\u5316\u81EA\u5DF1\u5728\u5BBF\u4E3B\u4E2D\u7684\u5BF9\u8BDD\u6846\uFF0C\u4F46\u662F\u62FF\u4E0D\u5230 AppCompat \u4E3B\u9898\u5C31\u65E0\u6CD5\u521B\u5EFA\u3002</p><ul><li>\u4F1A\u5F97\u5230\u5982\u4E0B\u5F02\u5E38</li></ul><div class="language-text ext-text"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#adbac7;">The style on this component requires your app theme to be Theme.AppCompat (or a descendant).</span></span>
<span class="line"><span style="color:#adbac7;"></span></span></code></pre></div><p>\u8FD9\u65F6\uFF0C\u6211\u4EEC\u60F3\u5728\u5BBF\u4E3B\u88AB Hook \u7684\u5F53\u524D <code>Activity</code> \u4E2D\u4F7F\u7528 <code>MaterialAlertDialogBuilder</code> \u6765\u521B\u5EFA\u5BF9\u8BDD\u6846\uFF0C\u5C31\u53EF\u4EE5\u6709\u5982\u4E0B\u65B9\u6CD5\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">injectMember {</span></span>
<span class="line"><span style="color:#ADBAC7;">    method {</span></span>
<span class="line"><span style="color:#ADBAC7;">        name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;onCreate&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">        param(</span><span style="color:#F69D50;">BundleClass</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">    afterHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u4F7F\u7528 applyModuleTheme \u521B\u5EFA\u4E00\u4E2A\u5F53\u524D\u6A21\u5757\u4E2D\u7684\u4E3B\u9898\u8D44\u6E90</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> appCompatContext </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> instance</span><span style="color:#F47067;">&lt;</span><span style="color:#F69D50;">Activity</span><span style="color:#F47067;">&gt;</span><span style="color:#ADBAC7;">().applyModuleTheme(</span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">style</span><span style="color:#F47067;">.</span><span style="color:#F69D50;">Theme_AppCompat</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u76F4\u63A5\u4F7F\u7528\u8FD9\u4E2A\u5305\u88C5\u4E86\u6A21\u5757\u4E3B\u9898\u540E\u7684 Context \u521B\u5EFA\u5BF9\u8BDD\u6846</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#F69D50;">MaterialAlertDialogBuilder</span><span style="color:#ADBAC7;">(appCompatContext)</span></span>
<span class="line"><span style="color:#ADBAC7;">            .setTitle(</span><span style="color:#96D0FF;">&quot;AppCompat \u4E3B\u9898\u5BF9\u8BDD\u6846&quot;</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">            .setMessage(</span><span style="color:#96D0FF;">&quot;\u6211\u662F\u4E00\u4E2A\u5728\u5BBF\u4E3B\u4E2D\u663E\u793A\u7684 AppCompat \u4E3B\u9898\u5BF9\u8BDD\u6846\u3002&quot;</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">            .setPositiveButton(</span><span style="color:#96D0FF;">&quot;\u786E\u5B9A&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#6CB6FF;">null</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">            .show()</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></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 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 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 class="line-number"></div></div></div><p>\u4F60\u8FD8\u53EF\u4EE5\u5BF9\u5F53\u524D <code>Context</code> \u901A\u8FC7 <code>uiMode</code> \u8BBE\u7F6E\u539F\u751F\u7684\u591C\u95F4\u6A21\u5F0F\u548C\u65E5\u95F4\u6A21\u5F0F\uFF0C\u81F3\u5C11\u9700\u8981 Android 10 \u53CA\u4EE5\u4E0A\u7CFB\u7EDF\u7248\u672C\u652F\u6301\u4E14\u5F53\u524D\u4E3B\u9898\u5305\u542B\u591C\u95F4\u6A21\u5F0F\u76F8\u5173\u5143\u7D20\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">injectMember {</span></span>
<span class="line"><span style="color:#ADBAC7;">    method {</span></span>
<span class="line"><span style="color:#ADBAC7;">        name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;onCreate&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">        param(</span><span style="color:#F69D50;">BundleClass</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">    afterHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u5B9A\u4E49\u5F53\u524D\u6A21\u5757\u4E2D\u7684\u4E3B\u9898\u8D44\u6E90</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#F47067;">var</span><span style="color:#ADBAC7;"> appCompatContext</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ModuleContextThemeWrapper</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// &lt;\u65B9\u68481&gt; \u76F4\u63A5\u5F97\u5230 Configuration \u5BF9\u8C61\u8FDB\u884C\u8BBE\u7F6E</span></span>
<span class="line"><span style="color:#ADBAC7;">        appCompatContext </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> instance</span><span style="color:#F47067;">&lt;</span><span style="color:#F69D50;">Activity</span><span style="color:#F47067;">&gt;</span><span style="color:#ADBAC7;">()</span></span>
<span class="line"><span style="color:#ADBAC7;">            .applyModuleTheme(</span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">style</span><span style="color:#F47067;">.</span><span style="color:#F69D50;">Theme_AppCompat</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">            .applyConfiguration { uiMode </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Configuration</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">UI_MODE_NIGHT_YES</span><span style="color:#ADBAC7;"> }</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// &lt;\u65B9\u68482&gt; \u521B\u5EFA\u4E00\u4E2A\u65B0\u7684 Configuration \u5BF9\u8C61</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u6B64\u65B9\u6848\u4F1A\u7834\u574F\u5F53\u524D\u5BBF\u4E3B\u4E2D\u539F\u6709\u7684\u5B57\u4F53\u7F29\u653E\u5927\u5C0F\u7B49\u8BBE\u7F6E\uFF0C\u4F60\u9700\u8981\u624B\u52A8\u91CD\u65B0\u4F20\u9012 densityDpi \u7B49\u53C2\u6570</span></span>
<span class="line"><span style="color:#ADBAC7;">        appCompatContext </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> instance</span><span style="color:#F47067;">&lt;</span><span style="color:#F69D50;">Activity</span><span style="color:#F47067;">&gt;</span><span style="color:#ADBAC7;">().applyModuleTheme(</span></span>
<span class="line"><span style="color:#ADBAC7;">            theme </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">style</span><span style="color:#F47067;">.</span><span style="color:#F69D50;">Theme_AppCompat</span><span style="color:#ADBAC7;">,</span></span>
<span class="line"><span style="color:#ADBAC7;">            configuration </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Configuration</span><span style="color:#ADBAC7;">().</span><span style="color:#6CB6FF;">apply</span><span style="color:#ADBAC7;"> { uiMode </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Configuration</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">UI_MODE_NIGHT_YES</span><span style="color:#ADBAC7;"> }</span></span>
<span class="line"><span style="color:#ADBAC7;">        )</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u76F4\u63A5\u4F7F\u7528\u8FD9\u4E2A\u5305\u88C5\u4E86\u6A21\u5757\u4E3B\u9898\u540E\u7684 Context \u521B\u5EFA\u5BF9\u8BDD\u6846</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#F69D50;">MaterialAlertDialogBuilder</span><span style="color:#ADBAC7;">(appCompatContext)</span></span>
<span class="line"><span style="color:#ADBAC7;">            .setTitle(</span><span style="color:#96D0FF;">&quot;AppCompat \u4E3B\u9898\u5BF9\u8BDD\u6846&quot;</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">            .setMessage(</span><span style="color:#96D0FF;">&quot;\u6211\u662F\u4E00\u4E2A\u5728\u5BBF\u4E3B\u4E2D\u663E\u793A\u7684 AppCompat \u4E3B\u9898\u5BF9\u8BDD\u6846\u3002&quot;</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">            .setPositiveButton(</span><span style="color:#96D0FF;">&quot;\u786E\u5B9A&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#6CB6FF;">null</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">            .show()</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></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 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 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 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 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 class="line-number"></div></div></div><p>\u8FD9\u6837\uFF0C\u6211\u4EEC\u5C31\u53EF\u4EE5\u5728\u5BBF\u4E3B\u4E2D\u975E\u5E38\u7B80\u5355\u5730\u4F7F\u7528 <code>MaterialAlertDialogBuilder</code> \u521B\u5EFA\u5BF9\u8BDD\u6846\u4E86\u3002</p>`,59),d={class:"custom-container warning"},A=s("p",{class:"custom-container-title"},"\u53EF\u80FD\u5B58\u5728\u7684\u95EE\u9898",-1),y=n("\u7531\u4E8E\u4E00\u4E9B APP \u81EA\u8EAB\u4F7F\u7528\u7684 "),u=s("strong",null,"androidx",-1),v=n(" \u4F9D\u8D56\u5E93\u6216\u81EA\u5B9A\u4E49\u4E3B\u9898\u53EF\u80FD\u4F1A\u5BF9\u5F53\u524D "),C=s("strong",null,"MaterialAlertDialog",-1),m=n(" \u5B9E\u9645\u6837\u5F0F\u9020\u6210\u5E72\u6270\uFF0C\u4F8B\u5982\u5BF9\u8BDD\u6846\u7684\u6309\u94AE\u6837\u5F0F\uFF0C\u8FD9\u79CD\u60C5\u51B5\u4F60\u53EF\u4EE5\u53C2\u8003 "),D=s("strong",null,"\u6A21\u5757 Demo",-1),B=n(" \u4E2D "),b={href:"https://github.com/fankes/YukiHookAPI/tree/master/demo-module/src/main/java/com/highcapable/yukihookapi/demo_module/hook/factory/ComponentCompatFactory.kt",target:"_blank",rel:"noopener noreferrer"},F=n("\u8FD9\u91CC\u7684\u793A\u4F8B\u4EE3\u7801"),h=n(" \u6765\u4FEE\u590D\u8FD9\u4E2A\u95EE\u9898\u3002"),k=s("p",null,[n("\u67D0\u4E9B APP \u5728\u521B\u5EFA\u65F6\u53EF\u80FD\u4F1A\u53D1\u751F "),s("strong",null,"ClassCastException"),n(" \u5F02\u5E38\uFF0C\u8BF7\u624B\u52A8\u6307\u5B9A\u65B0\u7684 "),s("strong",null,"Configuration"),n(" \u5B9E\u4F8B\u6765\u8FDB\u884C\u4FEE\u590D\u3002")],-1),g=a(`<div class="custom-container tip"><p class="custom-container-title">\u5C0F\u63D0\u793A</p><p>\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 <a href="../public/com/highcapable/yukihookapi/hook/factory/YukiHookFactory#context-applymoduletheme-ext-method">Context.applyModuleTheme</a> \u65B9\u6CD5\u3002</p></div><h2 id="classloader-\u51B2\u7A81\u95EE\u9898" tabindex="-1"><a class="header-anchor" href="#classloader-\u51B2\u7A81\u95EE\u9898" aria-hidden="true">#</a> ClassLoader \u51B2\u7A81\u95EE\u9898</h2><p>\u672C\u9875\u9762\u6240\u4ECB\u7ECD\u7684\u5185\u5BB9\u90FD\u662F\u76F4\u63A5\u5C06\u6A21\u5757\u7684\u8D44\u6E90\u6CE8\u5165\u5230\u4E86\u5BBF\u4E3B\uFF0C\u7531\u4E8E\u6A21\u5757\u4E0E\u5BBF\u4E3B\u4E0D\u5728\u540C\u4E00\u4E2A\u8FDB\u7A0B (\u540C\u4E00\u4E2A <strong>APK</strong>) \u4E2D\uFF0C\u5176\u53EF\u80FD\u5B58\u5728 <code>ClassLoader</code> \u51B2\u7A81\u7684\u95EE\u9898\u3002</p><p>\u82E5\u53D1\u751F\u4E86 <code>ClassLoader</code> \u51B2\u7A81\uFF0C\u4F60\u53EF\u80FD\u4F1A\u9047\u5230 <code>ClassCastException</code> \u5F02\u5E38\u3002</p><p><code>YukiHookAPI</code> \u9ED8\u8BA4\u5DF2\u89E3\u51B3\u4E86\u53EF\u80FD\u51B2\u7A81\u7684\u95EE\u9898\uFF0C\u5176\u4F59\u60C5\u51B5\u9700\u8981\u4F60\u81EA\u884C\u914D\u7F6E\u6392\u9664\u5217\u8868\u3002</p><p>\u6392\u9664\u5217\u8868\u51B3\u5B9A\u4E86\u8FD9\u4E9B <code>Class</code> \u9700\u8981\u88AB\u6A21\u5757\u8FD8\u662F\u5BBF\u4E3B\u7684 <code>ClassLoader</code> \u8FDB\u884C\u88C5\u8F7D\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// \u6392\u9664\u5C5E\u4E8E\u5BBF\u4E3B\u7684 Class \u7C7B\u540D</span></span>
<span class="line"><span style="color:#768390;">// \u5B83\u4EEC\u5C06\u4F1A\u88AB\u5BBF\u4E3B\u7684 ClassLoader \u88C5\u8F7D</span></span>
<span class="line"><span style="color:#768390;">// \u2757\u4EE5\u4E0B\u5185\u5BB9\u4EC5\u4F9B\u6F14\u793A\uFF0C\u4E0D\u8981\u76F4\u63A5\u4F7F\u7528\uFF0C\u8BF7\u4EE5\u4F60\u7684\u5B9E\u9645\u60C5\u51B5\u4E3A\u51C6</span></span>
<span class="line"><span style="color:#F69D50;">ModuleClassLoader</span><span style="color:#ADBAC7;">.excludeHostClasses(</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#96D0FF;">&quot;androidx.core.app.ActivityCompat&quot;</span><span style="color:#ADBAC7;">,</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#96D0FF;">&quot;com.demo.Test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#768390;">// \u6392\u9664\u5C5E\u4E8E\u6A21\u5757\u7684 Class \u7C7B\u540D</span></span>
<span class="line"><span style="color:#768390;">// \u5B83\u4EEC\u5C06\u4F1A\u88AB\u6A21\u5757 (\u5F53\u524D Hook \u8FDB\u7A0B) \u7684 ClassLoader \u88C5\u8F7D</span></span>
<span class="line"><span style="color:#768390;">// \u2757\u4EE5\u4E0B\u5185\u5BB9\u4EC5\u4F9B\u6F14\u793A\uFF0C\u4E0D\u8981\u76F4\u63A5\u4F7F\u7528\uFF0C\u8BF7\u4EE5\u4F60\u7684\u5B9E\u9645\u60C5\u51B5\u4E3A\u51C6</span></span>
<span class="line"><span style="color:#F69D50;">ModuleClassLoader</span><span style="color:#ADBAC7;">.excludeModuleClasses(</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#96D0FF;">&quot;com.demo.entry.HookEntry&quot;</span><span style="color:#ADBAC7;">,</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#96D0FF;">&quot;com.demo.controller.ModuleController&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">)</span></span>
<span class="line"></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 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 class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>\u4F60\u9700\u8981\u5728\u5411\u5BBF\u4E3B\u6CE8\u5165\u6A21\u5757\u8D44\u6E90\u7684\u65B9\u6CD5\u6267\u884C\u4E4B\u524D\u8FDB\u884C\u8BBE\u7F6E\u624D\u80FD\u751F\u6548\u3002</p><p>\u6B64\u529F\u80FD\u4EC5\u4E3A\u89E3\u51B3\u5BBF\u4E3B\u4E0E\u6A21\u5757\u4E2D\u53EF\u80FD\u5B58\u5728<strong>\u540C\u540D\u7684 <code>Class</code></strong> \u60C5\u51B5\uFF0C\u4F8B\u5982\u5171\u7528\u7684 SDK \u4EE5\u53CA\u4F9D\u8D56\uFF0C\u5728\u5927\u90E8\u5206\u60C5\u51B5\u4E0B\u4F60\u4E0D\u4F1A\u7528\u5230\u6B64\u529F\u80FD\u3002</p><div class="custom-container tip"><p class="custom-container-title">\u5C0F\u63D0\u793A</p><p>\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 <a href="../public/com/highcapable/yukihookapi/hook/xposed/parasitic/reference/ModuleClassLoader">ModuleClassLoader</a>\u3002</p></div>`,11);function x(q,_){const l=o("ExternalLinkIcon");return p(),c("div",null,[r,s("div",d,[A,s("p",null,[y,u,v,C,m,D,B,s("a",b,[F,i(l)]),h]),k]),g])}const f=e(t,[["render",x],["__file","host-inject.html.vue"]]);export{f as default};
