import{_ as s,o as n,c as e,a}from"./app.78a03919.js";const o={},l=a(`<h1 id="api-\u5F02\u5E38\u5904\u7406" tabindex="-1"><a class="header-anchor" href="#api-\u5F02\u5E38\u5904\u7406" aria-hidden="true">#</a> API \u5F02\u5E38\u5904\u7406</h1><blockquote><p>\u5F02\u5E38\u662F\u5728\u5F00\u53D1\u8FC7\u7A0B\u7ECF\u5E38\u9047\u5230\u7684\u4E3B\u8981\u95EE\u9898\uFF0C\u8FD9\u91CC\u4ECB\u7ECD\u4E86 <code>YukiHookAPI</code> \u5728\u4F7F\u7528\u8FC7\u7A0B\u4E2D\u53EF\u80FD\u9047\u5230\u7684\u5E38\u89C1\u5F02\u5E38\u4EE5\u53CA\u5904\u7406\u65B9\u5F0F\u3002</p></blockquote><p>\u8FD9\u91CC\u7684\u5F02\u5E38\u8BF4\u660E\u53EA\u4F1A\u540C\u6B65\u6700\u65B0\u7684 API \u7248\u672C\uFF0C\u8F83\u65E7\u7684 API \u7248\u672C\u7684\u5F02\u5E38\u5C06\u4E0D\u4F1A\u518D\u8FDB\u884C\u8BF4\u660E\uFF0C\u8BF7\u59CB\u7EC8\u4FDD\u6301 API \u7248\u672C\u4E3A\u6700\u65B0\u3002</p><h2 id="\u975E\u963B\u65AD\u5F02\u5E38" tabindex="-1"><a class="header-anchor" href="#\u975E\u963B\u65AD\u5F02\u5E38" aria-hidden="true">#</a> \u975E\u963B\u65AD\u5F02\u5E38</h2><blockquote><p>\u8FD9\u4E9B\u5F02\u5E38\u4E0D\u4F1A\u5BFC\u81F4 APP \u505C\u6B62\u8FD0\u884C(FC)\uFF0C\u4F46\u662F\u4F1A\u5728\u63A7\u5236\u53F0\u6253\u5370 <code>E</code> \u7EA7\u522B\u7684\u65E5\u5FD7\uFF0C\u4E5F\u53EF\u80FD\u4F1A\u505C\u6B62\u7EE7\u7EED\u6267\u884C\u76F8\u5173\u529F\u80FD\u3002</p></blockquote><h6 id="exception" tabindex="-1"><a class="header-anchor" href="#exception" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Could not found XposedBridge in current space! Aborted</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u4F60\u7684 Hook Framework \u672A\u5728\u5DE5\u4F5C\u6216\u5E76\u672A\u6210\u529F\u88C5\u8F7D <code>XposedBridge</code>\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u786E\u8BA4\u4F60\u5728\u6B63\u786E\u7684\u5730\u65B9\u88C5\u8F7D\u4E86 <code>YukiHookAPI</code> \u7684 <code>encase</code> \u65B9\u6CD5\uFF0C\u8BE6\u60C5\u8BF7\u53C2\u8003 <a href="../config/xposed-using">\u4F5C\u4E3A Xposed \u6A21\u5757\u4F7F\u7528\u7684\u76F8\u5173\u914D\u7F6E</a> \u4EE5\u53CA <a href="../config/api-using">\u4F5C\u4E3A Hook API \u4F7F\u7528\u7684\u76F8\u5173\u914D\u7F6E</a>\u3002</p><h6 id="exception-1" tabindex="-1"><a class="header-anchor" href="#exception-1" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>You cannot load a hooker in &quot;onInit&quot; or &quot;onXposedEvent&quot; method! Aborted</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u4F60\u5C1D\u8BD5\u5728\u7EE7\u627F <code>IYukiHookXposedInit</code> \u7684 Hook \u5165\u53E3\u7C7B\u7684 <code>onInit</code> \u6216 <code>onXposedEvent</code> \u65B9\u6CD5\u4E2D\u88C5\u8F7D\u4E86 <code>encase</code> \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:#F47067;">class</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">HookEntry</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">IYukiHookXposedInit</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;">onInit</span><span style="color:#ADBAC7;">() {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u2757\u9519\u8BEF\u7684\u4F7F\u7528\u65B9\u6CD5</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#F69D50;">YukiHookAPI</span><span style="color:#ADBAC7;">.encase {</span></span>
<span class="line"><span style="color:#ADBAC7;">            </span><span style="color:#768390;">// Your code here.</span></span>
<span class="line"><span style="color:#ADBAC7;">        }</span></span>
<span class="line"><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;">onXposedEvent</span><span style="color:#ADBAC7;">() {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u2757\u9519\u8BEF\u7684\u4F7F\u7528\u65B9\u6CD5</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#F69D50;">YukiHookAPI</span><span style="color:#ADBAC7;">.encase {</span></span>
<span class="line"><span style="color:#ADBAC7;">            </span><span style="color:#768390;">// Your code here.</span></span>
<span class="line"><span style="color:#ADBAC7;">        }</span></span>
<span class="line"><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;">onHook</span><span style="color:#ADBAC7;">() {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// Your code here.</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u5728 <code>onHook</code> \u65B9\u6CD5\u4E2D\u88C5\u8F7D <code>encase</code> \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:#F47067;">class</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">HookEntry</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">IYukiHookXposedInit</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;">onInit</span><span style="color:#ADBAC7;">() {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u8FD9\u91CC\u53EA\u80FD\u88C5\u8F7D configs \u65B9\u6CD5</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#F69D50;">YukiHookAPI</span><span style="color:#ADBAC7;">.configs {</span></span>
<span class="line"><span style="color:#ADBAC7;">            </span><span style="color:#768390;">// Your code here.</span></span>
<span class="line"><span style="color:#ADBAC7;">        }</span></span>
<span class="line"><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;">onHook</span><span style="color:#ADBAC7;">() {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u2705 \u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#F69D50;">YukiHookAPI</span><span style="color:#ADBAC7;">.encase {</span></span>
<span class="line"><span style="color:#ADBAC7;">            </span><span style="color:#768390;">// Your code here.</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><h6 id="exception-2" tabindex="-1"><a class="header-anchor" href="#exception-2" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Hooking Process exception occurred</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p><code>YukiHookAPI</code> \u5728\u8FDB\u884C\u81EA\u8EAB\u521D\u59CB\u5316 Hook \u8FC7\u7A0B\u4E2D\u53D1\u751F\u5F02\u5E38\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u901A\u5E38\u60C5\u51B5\u4E0B\u8FD9\u79CD\u9519\u8BEF\u4E0D\u4F1A\u8F7B\u6613\u53D1\u751F\uFF0C\u82E5\u4E00\u65E6\u53D1\u751F\u6B64\u9519\u8BEF\uFF0C\u53EF\u76F4\u63A5\u63D0\u4EA4\u65E5\u5FD7\u8FDB\u884C\u53CD\u9988\u3002</p><h6 id="exception-3" tabindex="-1"><a class="header-anchor" href="#exception-3" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>YukiHookAPI try to load HookEntryClass failed</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p><code>YukiHookAPI</code> \u5728\u5C1D\u8BD5\u88C5\u8F7D Hook \u5165\u53E3\u7C7B <code>onInit</code> \u6216 <code>onHook</code> \u65B9\u6CD5\u65F6\u53D1\u751F\u4E86\u4E0D\u80FD\u5904\u7406\u7684\u5F02\u5E38\u6216\u627E\u4E0D\u5230\u5165\u53E3\u7C7B\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u901A\u5E38\u60C5\u51B5\u4E0B\u8FD9\u79CD\u9519\u8BEF\u4E0D\u4F1A\u8F7B\u6613\u53D1\u751F\uFF0C\u82E5\u4E00\u65E6\u53D1\u751F\u6B64\u9519\u8BEF\uFF0C\u8BF7\u81EA\u884C\u67E5\u770B\u63A7\u5236\u53F0\u6253\u5370\u7684\u65E5\u5FD7\u5B9A\u4F4D\u95EE\u9898\uFF0C\u786E\u5B9A\u5E76\u975E\u81EA\u5DF1\u7684\u4EE3\u7801\u53D1\u751F\u7684\u95EE\u9898\u540E\uFF0C\u53EF\u63D0\u4EA4\u65E5\u5FD7\u8FDB\u884C\u53CD\u9988\u3002</p><h6 id="exception-4" tabindex="-1"><a class="header-anchor" href="#exception-4" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>YukiHookAPI bind initZygote failed</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p><code>YukiHookAPI</code> \u5728\u5C1D\u8BD5\u88C5\u8F7D Xposed \u539F\u751F\u63A5\u53E3 <code>initZygote</code> \u65B9\u6CD5\u65F6\u53D1\u751F\u4E86\u4E0D\u80FD\u5904\u7406\u7684\u5F02\u5E38\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u901A\u5E38\u60C5\u51B5\u4E0B\u8FD9\u79CD\u9519\u8BEF\u4E0D\u4F1A\u8F7B\u6613\u53D1\u751F\uFF0C\u82E5\u4E00\u65E6\u53D1\u751F\u6B64\u9519\u8BEF\uFF0C\u8BF7\u81EA\u884C\u67E5\u770B\u63A7\u5236\u53F0\u6253\u5370\u7684\u65E5\u5FD7\u5B9A\u4F4D\u95EE\u9898\uFF0C\u786E\u5B9A\u5E76\u975E\u81EA\u5DF1\u7684\u4EE3\u7801\u53D1\u751F\u7684\u95EE\u9898\u540E\uFF0C\u53EF\u63D0\u4EA4\u65E5\u5FD7\u8FDB\u884C\u53CD\u9988\u3002</p><h6 id="exception-5" tabindex="-1"><a class="header-anchor" href="#exception-5" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Failed to execute method &quot;<strong>NAME</strong>&quot;, maybe your Hook Framework not support Resources Hook</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p><code>YukiHookAPI</code> \u5728\u5C1D\u8BD5\u8FDB\u884C Resources Hook \u65F6\u53D1\u751F\u9519\u8BEF\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u4ED4\u7EC6\u68C0\u67E5\u9519\u8BEF\u65E5\u5FD7\u7684\u8BE6\u7EC6\u4FE1\u606F\u3002</p><p>\u82E5\u53D1\u751F <code>Resources$NotFoundException</code> \u5219\u53EF\u80FD\u4E3A\u4F60\u67E5\u627E\u7684 Resources Id \u4E0D\u6B63\u786E\u3002</p><p>\u82E5\u53D1\u751F <code>ClassNotFound</code> \u6216 <code>NoClassDefFoundError</code> \u53EF\u80FD\u662F Hook Framework \u4E0D\u652F\u6301 Resources Hook(\u8D44\u6E90\u94A9\u5B50)\u3002</p><h6 id="exception-6" tabindex="-1"><a class="header-anchor" href="#exception-6" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>HookClass [<strong>NAME</strong>] not found</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5F53\u524D\u88AB Hook \u7684 <code>Class</code> \u6CA1\u6709\u88AB\u627E\u5230\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u68C0\u67E5\u76EE\u6807 <code>Class</code> \u662F\u5426\u5B58\u5728\uFF0C\u82E5\u60F3\u5FFD\u7565\u6B64\u9519\u8BEF\u8BF7\u4F7F\u7528 <code>ignoredHookClassNotFoundFailure</code> \u65B9\u6CD5\u3002</p><h6 id="exception-7" tabindex="-1"><a class="header-anchor" href="#exception-7" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Hook Member [<strong>NAME</strong>] failed</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>Hook \u76EE\u6807\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u65F6\u53D1\u751F\u9519\u8BEF\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u6B64\u95EE\u9898\u901A\u5E38\u7531 Hook Framework \u4EA7\u751F\uFF0C\u8BF7\u68C0\u67E5\u5BF9\u5E94\u7684\u65E5\u5FD7\u5185\u5BB9\uFF0C\u82E5\u95EE\u9898\u6301\u7EED\u51FA\u73B0\u8BF7\u643A\u5E26\u8BE6\u7EC6\u65E5\u5FD7\u8FDB\u884C\u53CD\u9988\u3002</p><h6 id="exception-8" tabindex="-1"><a class="header-anchor" href="#exception-8" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Hooked Member with a finding error by <strong>CLASS</strong></p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 Hook \u6267\u884C\u540E\u88AB Hook \u7684 <code>member</code> \u4E3A <code>null</code> \u4E14\u5DF2\u7ECF\u8BBE\u7F6E\u76EE\u6807 Hook \u65B9\u6CD5\u3001\u6784\u9020\u7C7B\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u68C0\u67E5\u6B64\u9519\u8BEF\u53D1\u751F\u524D\u7684\u4E0A\u4E00\u4E2A\u9519\u8BEF\u65E5\u5FD7\uFF0C\u6216\u8BB8\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u7684\u65F6\u5019\u53D1\u751F\u4E86\u627E\u4E0D\u5230\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u7684\u9519\u8BEF\u3002</p><h6 id="exception-9" tabindex="-1"><a class="header-anchor" href="#exception-9" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Hooked Member cannot be non-null by <strong>CLASS</strong></p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 Hook \u6267\u884C\u540E\u88AB Hook \u7684 <code>member</code> \u4E3A <code>null</code> \u4E14\u6CA1\u6709\u8BBE\u7F6E\u76EE\u6807 Hook \u65B9\u6CD5\u3001\u6784\u9020\u7C7B\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;">    </span><span style="color:#768390;">// \u8FD9\u91CC\u5E76\u6CA1\u6709\u8BBE\u7F6E\u9700\u8981 Hook \u7684\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u7684\u67E5\u627E\u6761\u4EF6</span></span>
<span class="line"><span style="color:#ADBAC7;">    afterHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// ...</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u786E\u8BA4\u4F60\u5DF2\u7ECF\u5728 Hook \u4E4B\u524D\u6B63\u786E\u8BBE\u7F6E\u4E86\u8981 Hook \u7684\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u7684\u67E5\u627E\u65B9\u5F0F\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;">    </span><span style="color:#768390;">// \u2705 \u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5\u4E3E\u4F8B</span></span>
<span class="line"><span style="color:#ADBAC7;">    method {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// Your code here.</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;">// ...</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><h6 id="exception-10" tabindex="-1"><a class="header-anchor" href="#exception-10" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Hooked method return type match failed, required [<strong>TYPE</strong>] but got [<strong>TYPE</strong>]</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 Hook \u56DE\u8C03\u65B9\u6CD5\u4F53\u4E2D\u8BBE\u7F6E\u4E86 <code>HookParam.result</code> \u6216\u4F7F\u7528\u4E86 <code>replaceHook</code> \u4F46\u662F\u88AB Hook \u7684\u65B9\u6CD5\u8FD4\u56DE\u503C\u7C7B\u578B\u4E0E\u539F\u8FD4\u56DE\u503C\u7C7B\u578B\u4E0D\u5339\u914D\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><p>\u5047\u8BBE\u8FD9\u4E2A\u662F\u88AB Hook \u7684\u65B9\u6CD5\u3002</p><div class="language-java ext-java line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">private</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">boolean</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">test</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>\u4E0B\u9762\u662F\u4E00\u4E2A\u9519\u8BEF\u7684\u6848\u5217\u3002</p><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;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">        emptyParam()</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// &lt;\u60C5\u666F1&gt; \u8BBE\u7F6E\u4E86\u9519\u8BEF\u7684\u7C7B\u578B\uFF0C\u539F\u7C7B\u578B\u4E3A Boolean</span></span>
<span class="line"><span style="color:#ADBAC7;">    beforeHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        result </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">0</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// &lt;\u60C5\u666F2&gt; \u8FD4\u56DE\u4E86\u9519\u8BEF\u7684\u7C7B\u578B\uFF0C\u539F\u7C7B\u578B\u4E3A Boolean</span></span>
<span class="line"><span style="color:#ADBAC7;">    replaceAny {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#6CB6FF;">0</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// &lt;\u60C5\u666F3&gt; \u76F4\u63A5\u4F7F\u7528\u4E86\u9519\u8BEF\u7684\u7C7B\u578B\uFF0C\u539F\u7C7B\u578B\u4E3A Boolean</span></span>
<span class="line"><span style="color:#ADBAC7;">    replaceTo(any </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">0</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 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><div class="custom-container warning"><p class="custom-container-title">\u6CE8\u610F</p><p>\u82E5\u4E0A\u8FF0\u573A\u666F\u5728 <strong>beforeHook</strong> \u6216 <strong>afterHook</strong> \u4E2D\u53D1\u751F\uFF0C\u5219\u4F1A\u9020\u6210\u88AB Hook \u7684 APP (\u5BBF\u4E3B) \u7531 <strong>XposedBridge</strong> \u629B\u51FA\u5F02\u5E38 (\u4F1A\u5BF9\u5176\u66B4\u9732\u88AB Hook \u7684\u4E8B\u5B9E)\u3002</p></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u786E\u8BA4\u5F53\u524D\u88AB Hook \u65B9\u6CD5\u7684\u6B63\u786E\u8FD4\u56DE\u503C\u7C7B\u578B\uFF0C\u4FEE\u6539\u540E\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-11" tabindex="-1"><a class="header-anchor" href="#exception-11" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Hook initialization failed because got an Exception</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u51C6\u5907 Hook \u65F6\u53D1\u751F\u4E86\u4EFB\u610F\u7684\u5F02\u5E38\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u662F\u4E00\u4E2A\u51C6\u5907 Hook \u9636\u6BB5\u5C31\u53D1\u751F\u5F02\u5E38\u7684\u63D0\u9192\uFF0C\u8BF7\u4ED4\u7EC6\u67E5\u770B\u5177\u4F53\u7684\u5F02\u5E38\u662F\u4EC0\u4E48\u4EE5\u91CD\u65B0\u786E\u5B9A\u95EE\u9898\u3002</p><h6 id="exception-12" tabindex="-1"><a class="header-anchor" href="#exception-12" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Try to hook <strong>NAME</strong>[<strong>NAME</strong>] got an Exception</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 Hook \u5F00\u59CB\u65F6\u53D1\u751F\u4E86\u4EFB\u610F\u7684\u5F02\u5E38\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u662F\u4E00\u4E2A Hook \u5F00\u59CB\u5C31\u53D1\u751F\u5F02\u5E38\u7684\u63D0\u9192\uFF0C\u8BF7\u4ED4\u7EC6\u67E5\u770B\u5177\u4F53\u7684\u5F02\u5E38\u662F\u4EC0\u4E48\u4EE5\u91CD\u65B0\u786E\u5B9A\u95EE\u9898\u3002</p><h6 id="exception-13" tabindex="-1"><a class="header-anchor" href="#exception-13" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Method/Constructor/Field match type &quot;<strong>TYPE</strong>&quot; not allowed</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u65F6\u8BBE\u7F6E\u4E86\u4E0D\u5141\u8BB8\u7684\u53C2\u6570\u7C7B\u578B\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;">// \u67E5\u627E\u4E00\u4E2A\u65B9\u6CD5</span></span>
<span class="line"><span style="color:#ADBAC7;">method {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2757\u8BBE\u7F6E\u4E86\u65E0\u6548\u7684\u7C7B\u578B\u4E3E\u4F8B</span></span>
<span class="line"><span style="color:#ADBAC7;">    param(</span><span style="color:#6CB6FF;">false</span><span style="color:#ADBAC7;">, </span><span style="color:#6CB6FF;">1</span><span style="color:#ADBAC7;">, </span><span style="color:#6CB6FF;">0</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2757\u8BBE\u7F6E\u4E86\u65E0\u6548\u7684\u7C7B\u578B\u4E3E\u4F8B</span></span>
<span class="line"><span style="color:#ADBAC7;">    returnType </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">false</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#768390;">// \u67E5\u627E\u4E00\u4E2A\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">field {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2757\u8BBE\u7F6E\u4E86\u65E0\u6548\u7684\u7C7B\u578B\u4E3E\u4F8B</span></span>
<span class="line"><span style="color:#ADBAC7;">    type </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">false</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u5728\u67E5\u627E\u4E2D <code>param</code>\u3001<code>returnType</code>\u3001<code>type</code> \u4E2D\u4EC5\u63A5\u53D7 <code>Class</code>\u3001<code>String</code>\u3001<code>VariousClass</code> \u7C7B\u578B\u7684\u4F20\u503C\uFF0C\u4E0D\u53EF\u4F20\u5165\u53C2\u6570\u5B9E\u4F8B\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;">// \u67E5\u627E\u4E00\u4E2A\u65B9\u6CD5</span></span>
<span class="line"><span style="color:#ADBAC7;">method {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2705 \u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5\u4E3E\u4F8B</span></span>
<span class="line"><span style="color:#ADBAC7;">    param(</span><span style="color:#F69D50;">BooleanType</span><span style="color:#ADBAC7;">, </span><span style="color:#F69D50;">IntType</span><span style="color:#ADBAC7;">, </span><span style="color:#F69D50;">IntType</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2705 \u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5\u4E3E\u4F8B</span></span>
<span class="line"><span style="color:#ADBAC7;">    returnType </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">BooleanType</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2705 \u4EE5\u4E0B\u65B9\u6848\u4E5F\u662F\u6B63\u786E\u7684</span></span>
<span class="line"><span style="color:#ADBAC7;">    returnType </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;java.lang.Boolean&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#768390;">// \u67E5\u627E\u4E00\u4E2A\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">field {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2705 \u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5\u4E3E\u4F8B</span></span>
<span class="line"><span style="color:#ADBAC7;">    type </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">BooleanType</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></div><h6 id="exception-14" tabindex="-1"><a class="header-anchor" href="#exception-14" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>NoSuchMethod/NoSuchConstructor/NoSuchField happend in [<strong>NAME</strong>]</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u65F6\u5E76\u672A\u627E\u5230\u76EE\u6807\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u786E\u8BA4\u4F60\u7684\u67E5\u627E\u6761\u4EF6\u662F\u5426\u80FD\u6B63\u786E\u5339\u914D\u5230\u76EE\u6807 <code>Class</code> \u4E2D\u7684\u6307\u5B9A\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u3002</p><h6 id="exception-15" tabindex="-1"><a class="header-anchor" href="#exception-15" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Trying <strong>COUNT</strong> times and all failure by RemedyPlan</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u4F7F\u7528 <code>RemedyPlan</code> \u91CD\u65B0\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u3001\u53D8\u91CF\u65F6\u4F9D\u7136\u6CA1\u6709\u627E\u5230\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u3001\u53D8\u91CF\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u786E\u8BA4\u4F60\u8BBE\u7F6E\u7684 <code>RemedyPlan</code> \u53C2\u6570\u4EE5\u53CA\u5BBF\u4E3B\u5185\u5B58\u5728\u7684 <code>Class</code>\uFF0C\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-16" tabindex="-1"><a class="header-anchor" href="#exception-16" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>You must set a condition when finding a Method/Constructor/Field</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u65F6\u5E76\u672A\u8BBE\u7F6E\u4EFB\u4F55\u6761\u4EF6\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;">method {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u8FD9\u91CC\u6CA1\u6709\u8BBE\u7F6E\u4EFB\u4F55\u6761\u4EF6</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><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u5C06\u67E5\u627E\u6761\u4EF6\u8865\u5145\u5B8C\u6574\u5E76\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-17" tabindex="-1"><a class="header-anchor" href="#exception-17" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Can&#39;t find this Class in [<strong>CLASSLOADER</strong>]: <strong>CONTENT</strong> Generated by YukiHookAPI#ReflectionTool</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u901A\u8FC7 <code>ClassLoader.searchClass</code> \u6216 <code>PackageParam.searchClass</code> \u627E\u4E0D\u5230\u9700\u8981\u67E5\u627E\u7684 <code>Class</code> \u5BF9\u8C61\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;">custom</span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;">.searchClass {</span></span>
<span class="line"><span style="color:#ADBAC7;">    from(...)</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">}.get()</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u662F\u4E00\u4E2A\u5B89\u5168\u5F02\u5E38\uFF0C\u8BF7\u68C0\u67E5\u4F60\u8BBE\u7F6E\u7684\u6761\u4EF6\uFF0C\u4F7F\u7528\u76F8\u5173\u5DE5\u5177\u67E5\u770B\u6240\u5728 <strong>Dex</strong> \u4E2D\u7684 <code>Class</code> \u4EE5\u53CA\u5B57\u8282\u7801\u5BF9\u8C61\u7279\u5F81\uFF0C\u5E76\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-18" tabindex="-1"><a class="header-anchor" href="#exception-18" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Can&#39;t find this Method/Constructor/Field in [<strong>CLASS</strong>]: <strong>CONTENT</strong> Generated by YukiHookAPI#ReflectionTool</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u901A\u8FC7\u6307\u5B9A\u6761\u4EF6\u627E\u4E0D\u5230\u9700\u8981\u67E5\u627E\u7684\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\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:#F69D50;">TargetClass</span><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;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    param(</span><span style="color:#F69D50;">BooleanType</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 class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u662F\u4E00\u4E2A\u5B89\u5168\u5F02\u5E38\uFF0C\u8BF7\u68C0\u67E5\u4F60\u8BBE\u7F6E\u7684\u6761\u4EF6\uFF0C\u4F7F\u7528\u76F8\u5173\u5DE5\u5177\u67E5\u770B\u6240\u5728 <code>Class</code> \u4E2D\u7684\u5B57\u8282\u7801\u5BF9\u8C61\u7279\u5F81\uFF0C\u5E76\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-19" tabindex="-1"><a class="header-anchor" href="#exception-19" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>The number of VagueType must be at least less than the count of paramTypes</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>Method</code>\u3001<code>Constructor</code> \u67E5\u627E\u6761\u4EF6\u4E2D\u9519\u8BEF\u5730\u4F7F\u7528\u4E86 <code>VagueType</code>\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:#F69D50;">TargetClass</span><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;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// &lt;\u60C5\u666F1&gt;</span></span>
<span class="line"><span style="color:#ADBAC7;">    param(</span><span style="color:#F69D50;">VagueType</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// &lt;\u60C5\u666F2&gt;</span></span>
<span class="line"><span style="color:#ADBAC7;">    param(</span><span style="color:#F69D50;">VagueType</span><span style="color:#ADBAC7;">, </span><span style="color:#F69D50;">VagueType</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 class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p><code>VagueType</code> \u4E0D\u80FD\u5728\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u53C2\u6570\u4E2D\u5B8C\u5168\u586B\u5145\uFF0C\u82E5\u5B58\u5728\u8FD9\u6837\u7684\u9700\u6C42\u8BF7\u4F7F\u7528 <code>paramCount</code>\u3002</p><h6 id="exception-20" tabindex="-1"><a class="header-anchor" href="#exception-20" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Field match type class is not found</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u67E5\u627E\u53D8\u91CF\u65F6\u6240\u8BBE\u7F6E\u7684\u67E5\u627E\u6761\u4EF6\u4E2D <code>type</code> \u7684 <code>Class</code> \u5B9E\u4F8B\u672A\u88AB\u627E\u5230\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;">field {</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;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u5047\u8BBE\u8FD9\u91CC\u8BBE\u7F6E\u7684 type \u7684 Class \u5E76\u4E0D\u5B58\u5728</span></span>
<span class="line"><span style="color:#ADBAC7;">    type </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;com.example.TestClass&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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u68C0\u67E5\u67E5\u627E\u6761\u4EF6\u4E2D <code>type</code> \u7684 <code>Class</code> \u662F\u5426\u5B58\u5728\uFF0C\u7136\u540E\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-21" tabindex="-1"><a class="header-anchor" href="#exception-21" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Method match returnType class is not found</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u67E5\u627E\u65B9\u6CD5\u65F6\u6240\u8BBE\u7F6E\u7684\u67E5\u627E\u6761\u4EF6\u4E2D <code>returnType</code> \u7684 <code>Class</code> \u5B9E\u4F8B\u672A\u88AB\u627E\u5230\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;">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;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u5047\u8BBE\u8FD9\u91CC\u8BBE\u7F6E\u7684 returnType \u7684 Class \u5E76\u4E0D\u5B58\u5728</span></span>
<span class="line"><span style="color:#ADBAC7;">    returnType </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;com.example.TestClass&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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u68C0\u67E5\u67E5\u627E\u6761\u4EF6\u4E2D <code>returnType</code> \u7684 <code>Class</code> \u662F\u5426\u5B58\u5728\uFF0C\u7136\u540E\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-22" tabindex="-1"><a class="header-anchor" href="#exception-22" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Method/Constructor match paramType[<strong>INDEX</strong>] class is not found</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u65F6\u6240\u8BBE\u7F6E\u7684\u67E5\u627E\u6761\u4EF6\u4E2D <code>param</code> \u7684 <code>index</code> \u53F7\u4E0B\u6807\u7684 <code>Class</code> \u5B9E\u4F8B\u672A\u88AB\u627E\u5230\u3002</p><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><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;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u5047\u8BBE\u8FD9\u91CC\u8BBE\u7F6E\u7684 1 \u53F7\u4E0B\u6807\u7684 Class \u5E76\u4E0D\u5B58\u5728</span></span>
<span class="line"><span style="color:#ADBAC7;">    param(</span><span style="color:#F69D50;">StringType</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;com.example.TestClass&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#F69D50;">BooleanType</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 class="line-number"></div><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u68C0\u67E5\u67E5\u627E\u6761\u4EF6\u4E2D <code>param</code> \u7684 <code>index</code> \u53F7\u4E0B\u6807\u7684 <code>Class</code> \u662F\u5426\u5B58\u5728\uFF0C\u7136\u540E\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-23" tabindex="-1"><a class="header-anchor" href="#exception-23" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Resources Hook condition name/type cannot be empty [<strong>TAG</strong>]</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u67E5\u627E Resources \u65F6\u5E76\u672A\u8BBE\u7F6E\u4EFB\u4F55\u6761\u4EF6\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;">// \u60C5\u51B5 1</span></span>
<span class="line"><span style="color:#ADBAC7;">conditions {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u8FD9\u91CC\u6CA1\u6709\u8BBE\u7F6E\u4EFB\u4F55\u6761\u4EF6</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"><span style="color:#768390;">// \u60C5\u51B5 2</span></span>
<span class="line"><span style="color:#ADBAC7;">conditions {</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;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u8FD9\u91CC\u7F3A\u5C11\u4E86 type \u6761\u4EF6</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><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>Resources \u7684 Hook \u5E76\u975E\u7C7B\u4F3C\u65B9\u6CD5\u7684 Hook\uFF0C\u5176\u5FC5\u987B\u62E5\u6709\u5B8C\u6574\u7684\u540D\u79F0\u548C\u7C7B\u578B\u63CF\u8FF0\u624D\u80FD\u67E5\u627E\u6210\u529F\uFF0C\u8BF7\u5C06\u67E5\u627E\u6761\u4EF6\u8865\u5145\u5B8C\u6574\u5E76\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-24" tabindex="-1"><a class="header-anchor" href="#exception-24" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Resources Hook type is invalid [<strong>TAG</strong>]</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 Hook Resources \u65F6\u53D1\u751F\u4E86\u7C7B\u578B\u9519\u8BEF\u7684\u5F02\u5E38\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p><code>YukiHookAPI</code> \u4F1A\u5C1D\u8BD5\u5728 <code>initZygote</code> \u4E0E <code>handleInitPackageResources</code> \u4E2D\u88C5\u8F7D Resources Hook\uFF0C\u82E5\u5168\u90E8\u88C5\u8F7D\u5931\u8D25\u53EF\u80FD\u4F1A\u53D1\u751F\u6B64\u5F02\u5E38\uFF0C\u5F53\u524D Hook Framework \u9700\u8981\u652F\u6301\u5E76\u542F\u7528\u8D44\u6E90\u94A9\u5B50(Resources Hook)\u529F\u80FD\uFF0C\u8BF7\u68C0\u67E5\u540E\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-25" tabindex="-1"><a class="header-anchor" href="#exception-25" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Resources Hook got an Exception [<strong>TAG</strong>]</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 Hook Resources \u65F6\u53D1\u751F\u4E86\u4EFB\u610F\u7684\u5F02\u5E38\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u662F\u4E00\u4E2A\u5F02\u5E38\u6C47\u603B\uFF0C\u8BF7\u81EA\u884C\u5411\u4E0B\u67E5\u770B\u65E5\u5FD7\u5177\u4F53\u7684\u5F02\u5E38\u662F\u4EC0\u4E48\uFF0C\u4F8B\u5982\u627E\u4E0D\u5230 Resources Id \u7684\u95EE\u9898\u3002</p><h6 id="exception-26" tabindex="-1"><a class="header-anchor" href="#exception-26" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Received action &quot;<strong>ACTION</strong>&quot; failed</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u4F7F\u7528 <code>YukiHookDataChannel</code> \u65F6\u56DE\u8C03\u5E7F\u64AD\u4E8B\u4EF6\u5F02\u5E38\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u4E00\u822C\u60C5\u51B5\u4E0B\uFF0C\u6B64\u9519\u8BEF\u57FA\u672C\u4E0A\u4E0D\u4F1A\u53D1\u751F\uFF0C\u4E00\u65E6\u53D1\u751F\u9519\u8BEF\uFF0C\u6392\u9664\u81EA\u8EAB\u4EE3\u7801\u7684\u95EE\u9898\u540E\uFF0C\u8BF7\u643A\u5E26\u8BE6\u7EC6\u65E5\u5FD7\u8FDB\u884C\u53CD\u9988\u3002</p><h6 id="exception-27" tabindex="-1"><a class="header-anchor" href="#exception-27" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Failed to sendBroadcast like &quot;<strong>KEY</strong>&quot;, because got null context in &quot;<strong>PACKAGENAME</strong>&quot;</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u4F7F\u7528 <code>YukiHookDataChannel</code> \u65F6\u53D1\u9001\u5E7F\u64AD\u53D6\u5230\u4E86\u7A7A\u7684\u4E0A\u4E0B\u6587\u5B9E\u4F8B\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u4E00\u822C\u60C5\u51B5\u4E0B\uFF0C\u6B64\u9519\u8BEF\u57FA\u672C\u4E0A\u4E0D\u4F1A\u53D1\u751F\uFF0C\u5728\u6700\u65B0\u7248\u672C\u4E2D\u5DF2\u7ECF\u4FEE\u590D\u5BBF\u4E3B\u4F7F\u7528\u65F6\u53EF\u80FD\u53D1\u751F\u7684\u95EE\u9898\uFF0C\u82E5\u6700\u65B0\u7248\u672C\u4F9D\u7136\u53D1\u751F\u9519\u8BEF\uFF0C\u6392\u9664\u81EA\u8EAB\u4EE3\u7801\u7684\u95EE\u9898\u540E\uFF0C\u8BF7\u643A\u5E26\u8BE6\u7EC6\u65E5\u5FD7\u8FDB\u884C\u53CD\u9988\u3002</p><h6 id="exception-28" tabindex="-1"><a class="header-anchor" href="#exception-28" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Failed to inject module resources into [<strong>RESOURCES</strong>]</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 (Xposed) \u5BBF\u4E3B\u73AF\u5883\u4E2D\u4F7F\u7528 <code>injectModuleAppResources</code> \u6CE8\u5165\u6A21\u5757\u8D44\u6E90\u65F6\u53D1\u751F\u5F02\u5E38\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u4E00\u822C\u60C5\u51B5\u4E0B\uFF0C\u6B64\u9519\u8BEF\u57FA\u672C\u4E0A\u4E0D\u4F1A\u53D1\u751F\uFF0C\u6392\u9664\u81EA\u8EAB\u4EE3\u7801\u7684\u95EE\u9898\u540E\uFF0C\u8BF7\u643A\u5E26\u8BE6\u7EC6\u65E5\u5FD7\u8FDB\u884C\u53CD\u9988\u3002</p><h6 id="exception-29" tabindex="-1"><a class="header-anchor" href="#exception-29" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Activity Proxy initialization failed because got an Exception</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 (Xposed) \u5BBF\u4E3B\u73AF\u5883\u4E2D\u4F7F\u7528 <code>registerModuleAppActivities</code> \u6CE8\u5165\u6A21\u5757 <code>Activity</code> \u65F6\u53D1\u751F\u5F02\u5E38\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u68C0\u67E5\u6B64\u9519\u8BEF\u53D1\u751F\u540E\u7684\u4E0B\u4E00\u4E2A\u9519\u8BEF\u65E5\u5FD7\uFF0C\u6216\u8BB8\u5728\u914D\u7F6E\u53C2\u6570\u4E0A\u53EF\u80FD\u53D1\u751F\u4E86\u4E00\u4E9B\u95EE\u9898\uFF0C\u82E5\u627E\u4E0D\u5230\u76F8\u5173\u9519\u8BEF\u65E5\u5FD7\u7684\u8BF4\u660E\uFF0C\u6392\u9664\u81EA\u8EAB\u4EE3\u7801\u7684\u95EE\u9898\u540E\uFF0C\u8BF7\u643A\u5E26\u8BE6\u7EC6\u65E5\u5FD7\u8FDB\u884C\u53CD\u9988\u3002</p><h6 id="exception-30" tabindex="-1"><a class="header-anchor" href="#exception-30" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Activity Proxy got an Exception in msg.what [<strong>WHAT</strong>]</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 (Xposed) \u5BBF\u4E3B\u73AF\u5883\u4E2D\u4F7F\u7528 <code>registerModuleAppActivities</code> \u6CE8\u5165\u6A21\u5757 <code>Activity</code> \u65F6\u53D1\u751F\u5F02\u5E38\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u4E00\u822C\u60C5\u51B5\u4E0B\uFF0C\u6B64\u9519\u8BEF\u57FA\u672C\u4E0A\u4E0D\u4F1A\u53D1\u751F\uFF0C\u4F46\u6839\u636E\u7CFB\u7EDF\u7248\u672C\u5DEE\u5F02\u6027\u5E76\u672A\u505A\u8BE6\u7EC6\u6D4B\u8BD5\uFF0C\u6392\u9664\u81EA\u8EAB\u4EE3\u7801\u7684\u95EE\u9898\u540E\uFF0C\u8BF7\u643A\u5E26\u8BE6\u7EC6\u65E5\u5FD7\u8FDB\u884C\u53CD\u9988\u3002</p><h6 id="exception-31" tabindex="-1"><a class="header-anchor" href="#exception-31" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>This proxy [<strong>TYPE</strong>] type is not allowed</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 (Xposed) \u5BBF\u4E3B\u73AF\u5883\u4E2D\u4F7F\u7528 <code>registerModuleAppActivities</code> \u6CE8\u5165\u6A21\u5757 <code>Activity</code> \u65F6\u586B\u5165\u4E86\u65E0\u6548\u7684\u53C2\u6570\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;">// \u2757 \u8FD9\u91CC\u586B\u5165\u7684\u5185\u5BB9\u4EC5\u4E3A\u4E3E\u4F8B\uFF0C\u5176\u4E2D proxy \u586B\u5165\u4E86\u4E0D\u80FD\u7406\u89E3\u7684\u65E0\u6548\u53C2\u6570</span></span>
<span class="line"><span style="color:#ADBAC7;">registerModuleAppActivities(proxy </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">false</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 class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u65B9\u6CD5\u4E2D\u7684 <code>proxy</code> \u53C2\u6570\u53EA\u63A5\u53D7 <code>String</code>\u3001<code>CharSequence</code>\u3001<code>Class</code> \u7C7B\u578B\uFF0C\u8BF7\u67E5\u770B\u76F8\u5173\u4F7F\u7528\u65B9\u6CD5\u6B63\u786E\u586B\u5165\u65B9\u6CD5\u53C2\u6570\u3002</p><h6 id="exception-32" tabindex="-1"><a class="header-anchor" href="#exception-32" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Cound not got launch intent for package &quot;<strong>NAME</strong>&quot;</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 (Xposed) \u5BBF\u4E3B\u73AF\u5883\u4E2D\u4F7F\u7528 <code>registerModuleAppActivities</code> \u6CE8\u5165\u6A21\u5757 <code>Activity</code> \u65F6\u627E\u4E0D\u5230\u5BBF\u4E3B\u7684\u542F\u52A8 <code>Activity</code>\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;">// \u4F7F\u7528\u4E86\u9ED8\u8BA4\u53C2\u6570\u76F4\u63A5\u8FDB\u884C\u6CE8\u518C</span></span>
<span class="line"><span style="color:#ADBAC7;">registerModuleAppActivities()</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><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u9ED8\u8BA4\u53C2\u6570 (\u65E0\u53C2) \u53EA\u80FD\u7528\u4E8E\u53EF\u88AB\u542F\u52A8\u7684 APP\uFF0C\u82E5 APP \u5E76\u672A\u58F0\u660E\u542F\u52A8\u5165\u53E3 <code>Activity</code>\uFF0C\u4F60\u5C31\u9700\u8981\u624B\u52A8\u6307\u5B9A\u65B9\u6CD5\u7684 <code>proxy</code> \u53C2\u6570\u3002</p><h6 id="exception-33" tabindex="-1"><a class="header-anchor" href="#exception-33" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Could not found &quot;<strong>NAME</strong>&quot; or Class is not a type of Activity</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 (Xposed) \u5BBF\u4E3B\u73AF\u5883\u4E2D\u4F7F\u7528 <code>registerModuleAppActivities</code> \u6CE8\u5165\u6A21\u5757 <code>Activity</code> \u65F6\u65E0\u6CD5\u627E\u5230\u88AB\u586B\u5165\u53C2\u6570 <code>proxy</code> \u7684 <code>Activity</code>\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.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><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u786E\u8BA4\u4F60\u586B\u5165\u7684 <code>Activity</code> \u540D\u79F0\u771F\u5B9E\u6709\u6548\u5730\u5B58\u5728\u4E8E\u5BBF\u4E3B\u4E2D\uFF0C\u4E14\u76EE\u6807 <code>Class</code> \u7EE7\u627F\u4E8E <code>Activity</code>\u3002</p><h2 id="\u963B\u65AD\u5F02\u5E38" tabindex="-1"><a class="header-anchor" href="#\u963B\u65AD\u5F02\u5E38" aria-hidden="true">#</a> \u963B\u65AD\u5F02\u5E38</h2><blockquote><p>\u8FD9\u4E9B\u5F02\u5E38\u4F1A\u76F4\u63A5\u5BFC\u81F4 APP \u505C\u6B62\u8FD0\u884C(FC)\uFF0C\u540C\u65F6\u4F1A\u5728\u63A7\u5236\u53F0\u6253\u5370 <code>E</code> \u7EA7\u522B\u7684\u65E5\u5FD7\uFF0C\u8FD8\u4F1A\u9020\u6210 Hook \u8FDB\u7A0B\u201C\u6B7B\u6389\u201D\u3002</p></blockquote><h6 id="exception-34" tabindex="-1"><a class="header-anchor" href="#exception-34" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">RuntimeException</p><p>!!!DO NOT ALLOWED!!! You cannot hook or reflection to call the internal class of the YukiHookAPI itself, The called class is [<strong>CLASS</strong>]</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u4F60\u4F7F\u7528 <code>YukiHookAPI</code> \u7684\u76F8\u5173\u53CD\u5C04\u6216 Hook \u529F\u80FD\u8C03\u7528\u4E86 API \u81EA\u8EAB\u7684 <code>Class</code> \u5BF9\u8C61\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;">// &lt;\u60C5\u666F1&gt;</span></span>
<span class="line"><span style="color:#F69D50;">YukiHookAPI</span><span style="color:#ADBAC7;">.current()</span></span>
<span class="line"><span style="color:#768390;">// &lt;\u60C5\u666F2&gt;</span></span>
<span class="line"><span style="color:#F69D50;">PackageParam</span><span style="color:#ADBAC7;">::</span><span style="color:#6CB6FF;">class</span><span style="color:#ADBAC7;">.java.hook {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"><span style="color:#768390;">// &lt;\u60C5\u666F3&gt;</span></span>
<span class="line"><span style="color:#F69D50;">MethodFinder</span><span style="color:#ADBAC7;">::</span><span style="color:#6CB6FF;">class</span><span style="color:#ADBAC7;">.java.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;name&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    param(</span><span style="color:#F69D50;">StringType</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">}.get().call(</span><span style="color:#96D0FF;">&quot;name&quot;</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#768390;">// ...</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><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u68C0\u67E5\u4EE3\u7801\u90E8\u5206\u662F\u5426\u6709\u9519\u8BEF\uFF0C\u4F8B\u5982\u4E0B\u9762\u7684\u60C5\u51B5\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:#F69D50;">YourClass</span><span style="color:#ADBAC7;">.method {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2757 \u6CA1\u6709\u8C03\u7528\u65B9\u6CD5\u6267\u884C\uFF0C\u8FD9\u91CC\u5B9E\u9645\u8C03\u7528\u7684\u662F MethodFinder.Result \u5BF9\u8C61</span></span>
<span class="line"><span style="color:#ADBAC7;">}.get(instance).current()</span></span>
<span class="line"><span style="color:#F69D50;">YourClass</span><span style="color:#ADBAC7;">.method {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2705 \u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5\uFF0C\u5047\u8BBE\u6B64\u65B9\u6CD5\u65E0\u53C2</span></span>
<span class="line"><span style="color:#ADBAC7;">}.get(instance).call().current()</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>\u4E0D\u5141\u8BB8\u5185\u8054\u3001\u53CD\u5C04\u3001Hook <code>YukiHookAPI</code> \u81EA\u8EAB\u7684 <code>Class</code> \u4EE5\u53CA\u5185\u90E8\u529F\u80FD\uFF0C\u9632\u6B62\u53D1\u751F\u9519\u8BEF\u3002</p><h6 id="exception-35" tabindex="-1"><a class="header-anchor" href="#exception-35" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">UnsupportedOperationException</p><p>!!!DANGEROUS!!! Hook [<strong>CLASS</strong>] Class is a dangerous behavior! [<strong>CONTENT</strong>] [<strong>SOLVE</strong>]</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u4F60\u5C1D\u8BD5 Hook \u4E86\u5904\u4E8E\u5371\u9669\u884C\u4E3A\u5217\u8868\u4E2D\u7684 <code>Class</code> \u5BF9\u8C61\uFF0C\u4F8B\u5982 <code>Class</code>\u3001<code>ClassLoader</code>\u3001<code>Method</code>\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;">// &lt;\u60C5\u666F1&gt;</span></span>
<span class="line"><span style="color:#F69D50;">JavaClassLoader</span><span style="color:#ADBAC7;">.hook {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"><span style="color:#768390;">// &lt;\u60C5\u666F2&gt;</span></span>
<span class="line"><span style="color:#F69D50;">JavaClass</span><span style="color:#ADBAC7;">.hook {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"><span style="color:#768390;">// &lt;\u60C5\u666F3&gt;</span></span>
<span class="line"><span style="color:#F69D50;">JavaMethod</span><span style="color:#ADBAC7;">.hook {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"><span style="color:#768390;">// ...</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u4E9B\u529F\u80FD\u662F\u7CFB\u7EDF\u5185\u90E8\u7684\uFF0C<u><strong>\u5B83\u4EEC\u4E0D\u5E94\u8BE5\u88AB Hook\uFF0C\u5728\u90E8\u5206 Hook Framework \u4E0A\u53EF\u80FD\u4E0D\u88AB\u652F\u6301\uFF0C\u8FD8\u4F1A\u5F15\u53D1\u5176\u5B83\u9519\u8BEF</strong></u>\uFF0C\u8BF7\u5C1D\u8BD5\u66F4\u6362 Hook \u70B9\u3002</p><div class="custom-container tip"><p class="custom-container-title">\u5C0F\u63D0\u793A</p><p>\u82E5\u4F60\u4ECD\u8981\u4F7F\u7528\u6B64\u529F\u80FD\uFF0C\u8BF7\u53C2\u8003 <a href="../api/public/com/highcapable/yukihookapi/hook/core/YukiMemberHookCreator#usedangerousoperation-method">YukiMemberHookCreator.useDangerousOperation</a>\u3002</p><p>\u4F46\u662F<strong>\u5F3A\u70C8\u5EFA\u8BAE\u4E0D\u8981\u8FD9\u6837\u505A\uFF0C\u53D1\u751F\u95EE\u9898\u8BF7\u4E0D\u8981\u53CD\u9988\uFF0C<u>\u81EA\u884C\u627F\u62C5\u4E00\u5207\u540E\u679C</u></strong>\u3002</p></div><h6 id="exception-36" tabindex="-1"><a class="header-anchor" href="#exception-36" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">NoClassDefFoundError</p><p>Can&#39;t find this Class in [<strong>CLASSLOADER</strong>]: <strong>CONTENT</strong> Generated by YukiHookAPI#ReflectionTool</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u901A\u8FC7 <code>String.toClass(...)</code> \u6216 <code>classOf&lt;...&gt;()</code> \u627E\u4E0D\u5230\u9700\u8981\u67E5\u627E\u7684 <code>Class</code> \u5BF9\u8C61\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:#96D0FF;">&quot;com.demo.Test&quot;</span><span style="color:#ADBAC7;">.toClass()</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u68C0\u67E5\u5F53\u524D\u5B57\u7B26\u4E32\u6216\u5B9E\u4F53\u5339\u914D\u5230\u7684 <code>Class</code> \u662F\u5426\u5B58\u5728\u4E8E\u5F53\u524D <code>ClassLoader</code>\uFF0C\u5E76\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-37" tabindex="-1"><a class="header-anchor" href="#exception-37" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>ClassLoader [<strong>CLASSLOADER</strong>] is not a DexClassLoader</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u4F7F\u7528 <code>ClassLoader.searchClass</code> \u6216 <code>PackageParam.searchClass</code> \u67E5\u627E <code>Class</code> \u4F46\u662F\u5F53\u524D <code>ClassLoader</code> \u5E76\u4E0D\u7EE7\u627F\u4E8E <code>BaseDexClassLoader</code>\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u79CD\u60C5\u51B5\u57FA\u672C\u4E0D\u5B58\u5728\uFF0C\u9664\u975E\u5F53\u524D APP \u5F15\u7528\u4E86\u975E ART \u5E73\u53F0\u7684\u53EF\u6267\u884C\u6587\u4EF6 (\u4F46\u662F\u8FD9\u79CD\u60C5\u51B5\u8FD8\u662F\u4E0D\u4F1A\u5B58\u5728) \u6216\u5F53\u524D <code>ClassLoader</code> \u4E3A\u7A7A\u3002</p><h6 id="exception-38" tabindex="-1"><a class="header-anchor" href="#exception-38" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Failed to got SystemContext</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u88AB Hook \u7684\u5BBF\u4E3B\u5185\u8C03\u7528\u4E86 <code>systemContext</code> \u4F46\u5E76\u672A\u6210\u529F\u83B7\u53D6\u5230\u5B9E\u4F8B\u5BF9\u8C61\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;">encase {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u8C03\u7528\u4E86\u6B64\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">    systemContext...</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u79CD\u60C5\u51B5\u4E0D\u5E94\u8BE5\u5B58\u5728\uFF0C\u7531\u4E8E <code>systemContext</code> \u901A\u8FC7\u53CD\u5C04\u4ECE <code>ActivityThread</code> \u4E2D\u5F97\u5230\uFF0C\u9664\u975E\u7CFB\u7EDF\u8FDB\u7A0B\u53D1\u751F\u5F02\u5E38\uFF0C\u5426\u5219\u83B7\u53D6\u5230\u7684\u5BF9\u8C61\u4E0D\u4F1A\u4E3A\u7A7A\u3002</p><h6 id="exception-39" tabindex="-1"><a class="header-anchor" href="#exception-39" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>App is dead, You cannot call to appContext</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><blockquote><p>\u7B2C\u4E00\u79CD\u60C5\u51B5</p></blockquote><p>\u5728\u88AB Hook \u7684\u5BBF\u4E3B\u5185\u8C03\u7528\u4E86 <code>ModuleApplication</code> \u7684 <code>appContext</code>\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;">encase {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u8C03\u7528\u4E86\u6B64\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#F69D50;">ModuleApplication</span><span style="color:#ADBAC7;">.appContext...</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></div><blockquote><p>\u7B2C\u4E8C\u79CD\u60C5\u51B5</p></blockquote><p>\u4F7F\u7528 <code>ModuleApplication</code> \u65F6\u8C03\u7528\u4E86 <code>appContext</code> \u4F46\u662F APP \u53EF\u80FD\u5DF2\u7ECF\u88AB\u9500\u6BC1\u6216\u6CA1\u6709\u6B63\u786E\u542F\u52A8\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;">// \u8C03\u7528\u4E86\u6B64\u53D8\u91CF\u4F46\u662F APP \u53EF\u80FD\u5DF2\u88AB\u9500\u6BC1\u6216\u6CA1\u6709\u6B63\u786E\u542F\u52A8</span></span>
<span class="line"><span style="color:#F69D50;">ModuleApplication</span><span style="color:#ADBAC7;">.appContext...</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><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><blockquote><p>\u7B2C\u4E00\u79CD\u60C5\u51B5</p></blockquote><p>\u4F60\u53EA\u80FD\u5728\u6A21\u5757\u5185\u4F7F\u7528 <code>ModuleApplication</code> \u7684 <code>appContext</code>\uFF0C\u5728\u5BBF\u4E3B\u5185\u8BF7\u4F7F\u7528 <code>PackageParam</code> \u4E2D\u7684 <code>appContext</code>\uFF0C\u8BF7\u786E\u8BA4\u4F60\u4F7F\u7528\u7684\u662F\u5426\u6B63\u786E\u3002</p><blockquote><p>\u7B2C\u4E8C\u79CD\u60C5\u51B5</p></blockquote><p>\u8FD9\u79CD\u60C5\u51B5\u57FA\u672C\u4E0D\u5B58\u5728\uFF0C\u7531\u4E8E <code>appContext</code> \u662F\u5728 <code>onCreate</code> \u4E2D\u88AB\u8D4B\u503C\u7684\uFF0C\u9664\u975E\u9047\u5230\u591A\u8FDB\u7A0B\u5E76\u53D1\u542F\u52A8\u6216 APP \u6CA1\u6709\u542F\u52A8\u5B8C\u6210\u524D\u88AB\u53CD\u5C04\u8C03\u7528\u4E86\u7236\u7C7B\u7684 <code>onCreate</code> \u65B9\u6CD5\u3002</p><h6 id="exception-40" tabindex="-1"><a class="header-anchor" href="#exception-40" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>YukiHookModulePrefs not allowed in Custom Hook API</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 Hook \u81EA\u8EAB APP(\u975E Xposed \u6A21\u5757) \u4E2D\u4F7F\u7528\u4E86 <code>YukiHookModulePrefs</code>\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;">MyApplication</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Application</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;">attachBaseContext</span><span style="color:#ADBAC7;">(base</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Context?</span><span style="color:#ADBAC7;">) {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#F69D50;">YukiHookAPI</span><span style="color:#ADBAC7;">.encase(base) {</span></span>
<span class="line"><span style="color:#ADBAC7;">            </span><span style="color:#768390;">// \u2757\u4E0D\u80FD\u5728\u8FD9\u79CD\u60C5\u51B5\u4E0B\u4F7F\u7528 prefs</span></span>
<span class="line"><span style="color:#ADBAC7;">            prefs.getBoolean(</span><span style="color:#96D0FF;">&quot;test_data&quot;</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:#6CB6FF;">super</span><span style="color:#ADBAC7;">.attachBaseContext(base)</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u4F60\u53EA\u80FD\u5728 <a href="../config/xposed-using">\u4F5C\u4E3A Xposed \u6A21\u5757\u4F7F\u7528</a> \u65F6\u4F7F\u7528 <code>YukiHookModulePrefs</code>\uFF0C\u5728 Hook \u81EA\u8EAB APP \u4E2D\u8BF7\u4F7F\u7528\u539F\u751F\u7684 <code>Sp</code> \u5B58\u50A8\u3002</p><h6 id="exception-41" tabindex="-1"><a class="header-anchor" href="#exception-41" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Cannot load the XSharedPreferences, maybe is your Hook Framework not support it</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 (Xposed) \u5BBF\u4E3B\u73AF\u5883\u4F7F\u7528\u4E86 <code>YukiHookModulePrefs</code> \u4F46\u662F\u65E0\u6CD5\u5F97\u5230 <code>XSharedPreferences</code> \u5BF9\u8C61\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;">encase {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u8C03\u7528\u4E86\u6B64\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">    prefs...</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u4E00\u822C\u60C5\u51B5\u4E0B\u4E0D\u4F1A\u53D1\u751F\u6B64\u95EE\u9898\uFF0C\u82E5\u6301\u7EED\u65E0\u6CD5\u83B7\u53D6 <code>XSharedPreferences</code> \u5BF9\u8C61\u5219\u53EF\u80FD\u662F\u4F60\u4F7F\u7528\u7684 Hook Framework \u4E0D\u652F\u6301\u6B64\u529F\u80FD\u6216\u81EA\u8EAB\u5B58\u5728\u9519\u8BEF\u3002</p><h6 id="exception-42" tabindex="-1"><a class="header-anchor" href="#exception-42" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>YukiHookDataChannel not allowed in Custom Hook API</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 Hook \u81EA\u8EAB APP(\u975E Xposed \u6A21\u5757) \u4E2D\u4F7F\u7528\u4E86 <code>YukiHookDataChannel</code>\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;">MyApplication</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Application</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;">attachBaseContext</span><span style="color:#ADBAC7;">(base</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Context?</span><span style="color:#ADBAC7;">) {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#F69D50;">YukiHookAPI</span><span style="color:#ADBAC7;">.encase(base) {</span></span>
<span class="line"><span style="color:#ADBAC7;">            </span><span style="color:#768390;">// \u2757\u4E0D\u80FD\u5728\u8FD9\u79CD\u60C5\u51B5\u4E0B\u4F7F\u7528 dataChannel</span></span>
<span class="line"><span style="color:#ADBAC7;">            dataChannel.wait(key </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;test_data&quot;</span><span style="color:#ADBAC7;">) {</span></span>
<span class="line"><span style="color:#ADBAC7;">                </span><span style="color:#768390;">// ...</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 style="color:#6CB6FF;">super</span><span style="color:#ADBAC7;">.attachBaseContext(base)</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><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u4F60\u53EA\u80FD\u5728 <a href="../config/xposed-using">\u4F5C\u4E3A Xposed \u6A21\u5757\u4F7F\u7528</a> \u65F6\u4F7F\u7528 <code>YukiHookDataChannel</code>\u3002</p><h6 id="exception-43" tabindex="-1"><a class="header-anchor" href="#exception-43" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>YukiHookDataChannel only support used on an Activity, but this current context is &quot;<strong>CLASSNAME</strong>&quot;</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u6A21\u5757\u7684\u975E <code>Activity</code> \u73AF\u5883\u4E2D\u4F7F\u7528\u4E86 <code>YukiHookDataChannel</code>\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u4F60\u53EA\u80FD\u5728 <code>Activity</code> \u6216 <code>Fragment</code> \u4E2D\u4F7F\u7528 <code>YukiHookDataChannel</code>\u3002</p><h6 id="exception-44" tabindex="-1"><a class="header-anchor" href="#exception-44" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Xposed modulePackageName load failed, please reset and rebuild it</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 Hook \u8FC7\u7A0B\u4E2D\u4F7F\u7528 <code>YukiHookModulePrefs</code> \u6216 <code>YukiHookDataChannel</code> \u65F6\u65E0\u6CD5\u8BFB\u53D6\u88C5\u8F7D\u65F6\u7684 <code>modulePackageName</code> \u5BFC\u81F4\u4E0D\u80FD\u786E\u5B9A\u81EA\u8EAB\u6A21\u5757\u7684\u5305\u540D\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u4ED4\u7EC6\u9605\u8BFB <a href="../config/xposed-using#modulepackagename-%E5%8F%82%E6%95%B0">\u8FD9\u91CC</a> \u7684\u5E2E\u52A9\u6587\u6863\uFF0C\u6B63\u786E\u914D\u7F6E\u6A21\u5757\u7684 Hook \u5165\u53E3\u7C7B\u5305\u540D\u3002</p><h6 id="exception-45" tabindex="-1"><a class="header-anchor" href="#exception-45" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>YukiHookModulePrefs missing Context instance</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u6A21\u5757\u4E2D\u4F7F\u7528\u4E86 <code>YukiHookModulePrefs</code> \u5B58\u50A8\u6570\u636E\u4F46\u5E76\u672A\u4F20\u5165 <code>Context</code> \u5B9E\u4F8B\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;">MainActivity</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">AppCompatActivity</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;">// \u2757\u9519\u8BEF\u7684\u4F7F\u7528\u65B9\u6CD5</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u6784\u9020\u65B9\u6CD5\u5DF2\u5728 API 1.0.88 \u53CA\u4EE5\u540E\u7684\u7248\u672C\u4E2D\u8BBE\u7F6E\u4E3A private</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#F69D50;">YukiHookModulePrefs</span><span style="color:#ADBAC7;">().getBoolean(</span><span style="color:#96D0FF;">&quot;test_data&quot;</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>
<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><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u5728 <code>Activity</code> \u4E2D\u63A8\u8350\u4F7F\u7528 <code>modulePrefs</code> \u65B9\u6CD5\u6765\u88C5\u8F7D <code>YukiHookModulePrefs</code>\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;">MainActivity</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">AppCompatActivity</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;">// \u2705 \u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5</span></span>
<span class="line"><span style="color:#ADBAC7;">        modulePrefs.getBoolean(</span><span style="color:#96D0FF;">&quot;test_data&quot;</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>
<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><h6 id="exception-46" tabindex="-1"><a class="header-anchor" href="#exception-46" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Key-Value type <strong>TYPE</strong> is not allowed</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u4F7F\u7528 <code>YukiHookModulePrefs</code> \u7684 <code>get</code> \u6216 <code>put</code> \u65B9\u6CD5\u6216 <code>YukiHookDataChannel</code> \u7684 <code>wait</code> \u6216 <code>put</code> \u65B9\u6CD5\u65F6\u4F20\u5165\u4E86\u4E0D\u652F\u6301\u7684\u5B58\u50A8\u7C7B\u578B\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p><code>YukiHookModulePrefs</code> \u652F\u6301\u7684\u7C7B\u578B\u53EA\u6709 <code>String</code>\u3001<code>Set&lt;String&gt;</code>\u3001<code>Int</code>\u3001<code>Float</code>\u3001<code>Long</code>\u3001<code>Boolean</code>\uFF0C\u8BF7\u4F20\u5165\u652F\u6301\u7684\u7C7B\u578B\u3002</p><p><code>YukiHookDataChannel</code> \u652F\u6301\u7684\u7C7B\u578B\u4E3A <code>Intent.putExtra</code> \u9650\u5236\u7684\u7C7B\u578B\uFF0C\u8BF7\u4F20\u5165\u652F\u6301\u7684\u7C7B\u578B\u3002</p><h6 id="exception-47" tabindex="-1"><a class="header-anchor" href="#exception-47" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>YukiHookDataChannel cannot used in zygote</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>loadZygote</code> \u4E2D\u4F7F\u7528\u4E86 <code>YukiHookDataChannel</code>\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;">loadZygote {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u8C03\u7528\u4E86\u6B64\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">    dataChannel...</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p><code>YukiHookDataChannel</code> \u53EA\u80FD\u5728 <code>loadSystem</code>\u3001<code>loadApp</code> \u4E2D\u4F7F\u7528\u3002</p><h6 id="exception-48" tabindex="-1"><a class="header-anchor" href="#exception-48" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Custom Hooking Members is empty</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>MemberHookCreator</code> \u4E2D\u8C03\u7528 <code>members()</code> \u4F46\u662F\u672A\u8BBE\u7F6E\u9700\u8981 Hook \u7684 <code>Member</code> \u5B9E\u4F8B\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;">    </span><span style="color:#768390;">// \u62EC\u53F7\u91CC\u7684\u65B9\u6CD5\u53C2\u6570\u88AB\u7559\u7A7A\u4E86</span></span>
<span class="line"><span style="color:#ADBAC7;">    members()</span></span>
<span class="line"><span style="color:#ADBAC7;">    afterHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// ...</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u82E5\u8981\u4F7F\u7528 <code>members()</code> \u8BBE\u7F6E\u81EA\u5B9A\u4E49 Hook \u65B9\u6CD5\uFF0C\u4F60\u5FC5\u987B\u4FDD\u8BC1\u5176\u65B9\u6CD5\u53C2\u6570\u91CC\u7684 <code>Member</code> \u6570\u7EC4\u5BF9\u8C61\u4E0D\u80FD\u4E3A\u7A7A\u3002</p><h6 id="exception-49" tabindex="-1"><a class="header-anchor" href="#exception-49" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>HookParam Method args index must be &gt;= 0</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>HookParam</code> \u4E2D\u8C03\u7528 <code>args().last()</code> \u4F46\u662F\u76EE\u6807 <code>param</code> \u4E3A\u7A7A\u6216 <code>args</code> \u4E2D\u7684 <code>index</code> \u8BBE\u7F6E\u4E86\u5C0F\u4E8E 0 \u7684\u6570\u503C\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;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">    afterHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u5047\u8BBE param \u662F\u7A7A\u7684</span></span>
<span class="line"><span style="color:#ADBAC7;">        args().last()...</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u8BBE\u7F6E\u4E86\u5C0F\u4E8E 0 \u7684 index</span></span>
<span class="line"><span style="color:#ADBAC7;">        args(index </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">-</span><span style="color:#6CB6FF;">5</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>
<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><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u786E\u8BA4\u4F60 Hook \u7684\u76EE\u6807\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u7684\u65B9\u6CD5\u53C2\u6570\u6570\u91CF\u662F\u5426\u4E0D\u4E3A\u7A7A\uFF0C\u4E14\u4E0D\u80FD\u5BF9 <code>args</code> \u7684\u4E0B\u6807\u8BBE\u7F6E\u5C0F\u4E8E 0 \u7684\u6570\u503C\u3002</p><h6 id="exception-50" tabindex="-1"><a class="header-anchor" href="#exception-50" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>HookParam instance got null! Is this a static member?</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>HookParam</code> \u4E2D\u8C03\u7528 <code>instance</code> \u53D8\u91CF\u6216 <code>instance</code> \u65B9\u6CD5\u4F46\u83B7\u53D6\u4E0D\u5230\u5F53\u524D\u5B9E\u4F8B\u7684\u5BF9\u8C61\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;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">    afterHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u8C03\u7528\u4E86\u6B64\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">        instance...</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u8C03\u7528\u4E86\u6B64\u65B9\u6CD5</span></span>
<span class="line"><span style="color:#ADBAC7;">        instance</span><span style="color:#F47067;">&lt;</span><span style="color:#6CB6FF;">Any</span><span style="color:#F47067;">&gt;</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>
<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><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u786E\u8BA4\u4F60 Hook \u7684\u65B9\u6CD5\u662F\u5426\u4E3A\u9759\u6001\u7C7B\u578B\uFF0C\u9759\u6001\u7C7B\u578B\u7684\u65B9\u6CD5\u6CA1\u6709\u5B9E\u4F8B\uFF0C\u4E0D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD\uFF0C\u82E5\u975E\u9759\u6001\u65B9\u6CD5\uFF0C\u8BF7\u68C0\u67E5\u5B9E\u4F8B\u662F\u5426\u5DF2\u7ECF\u9500\u6BC1\u3002</p><h6 id="exception-51" tabindex="-1"><a class="header-anchor" href="#exception-51" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Current hooked Member args is null</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>HookParam</code> \u4E2D\u8C03\u7528 <code>args</code> \u53D8\u91CF\u4F46\u83B7\u53D6\u4E0D\u5230\u5F53\u524D\u5B9E\u4F8B\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u7684\u53C2\u6570\u6570\u7EC4\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;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">    afterHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u8C03\u7528\u4E86\u6B64\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">        args...</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u79CD\u95EE\u9898\u4E00\u822C\u4E0D\u4F1A\u53D1\u751F\uFF0C\u771F\u7684\u53D1\u751F\u4E86\u6B64\u95EE\u9898\uFF0C\u8BF7\u643A\u5E26\u8BE6\u7EC6\u65E5\u5FD7\u8FDB\u884C\u53CD\u9988\u3002</p><h6 id="exception-52" tabindex="-1"><a class="header-anchor" href="#exception-52" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Current hooked Member is null</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>HookParam</code> \u4E2D\u8C03\u7528 <code>member</code> \u53D8\u91CF\u4F46\u83B7\u53D6\u4E0D\u5230\u5F53\u524D\u5B9E\u4F8B\u7684\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u5B9E\u4F8B\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;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">    afterHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u8C03\u7528\u4E86\u6B64\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">        member...</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u79CD\u95EE\u9898\u4E00\u822C\u4E0D\u4F1A\u53D1\u751F\uFF0C\u771F\u7684\u53D1\u751F\u4E86\u6B64\u95EE\u9898\uFF0C\u8BF7\u643A\u5E26\u8BE6\u7EC6\u65E5\u5FD7\u8FDB\u884C\u53CD\u9988\u3002</p><h6 id="exception-53" tabindex="-1"><a class="header-anchor" href="#exception-53" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Current hooked Member is not a Method</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>HookParam</code> \u4E2D\u8C03\u7528 <code>method</code> \u53D8\u91CF\u4F46\u83B7\u53D6\u4E0D\u5230\u5F53\u524D\u5B9E\u4F8B\u7684\u65B9\u6CD5\u5B9E\u4F8B\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;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">    afterHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u8C03\u7528\u4E86\u6B64\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">        method...</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u786E\u8BA4\u4F60 Hook \u7684\u65B9\u6CD5\u662F\u6784\u9020\u65B9\u6CD5\u8FD8\u662F\u666E\u901A\u65B9\u6CD5\u5E76\u4F7F\u7528\u5BF9\u5E94\u7C7B\u578B\u7684\u65B9\u6CD5\u83B7\u53D6\u6307\u5B9A\u7684\u5B9E\u4F8B\uFF0C\u82E5\u4E0D\u77E5\u9053\u5B57\u8282\u7801\u7684\u7C7B\u578B\u53EF\u4EE5\u76F4\u63A5\u4F7F\u7528 <code>member</code> \u6765\u83B7\u53D6\u3002</p><h6 id="exception-54" tabindex="-1"><a class="header-anchor" href="#exception-54" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Current hooked Member is not a Constructor</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>HookParam</code> \u4E2D\u8C03\u7528 <code>constructor</code> \u53D8\u91CF\u4F46\u83B7\u53D6\u4E0D\u5230\u5F53\u524D\u5B9E\u4F8B\u7684\u65B9\u6CD5\u5B9E\u4F8B\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;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">    afterHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u8C03\u7528\u4E86\u6B64\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#DCBDFB;">constructor</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>
<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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u786E\u8BA4\u4F60 Hook \u7684\u65B9\u6CD5\u662F\u666E\u901A\u65B9\u6CD5\u8FD8\u662F\u6784\u9020\u65B9\u6CD5\u5E76\u4F7F\u7528\u5BF9\u5E94\u7C7B\u578B\u7684\u65B9\u6CD5\u83B7\u53D6\u6307\u5B9A\u7684\u5B9E\u4F8B\uFF0C\u82E5\u4E0D\u77E5\u9053\u5B57\u8282\u7801\u7684\u7C7B\u578B\u53EF\u4EE5\u76F4\u63A5\u4F7F\u7528 <code>member</code> \u6765\u83B7\u53D6\u3002</p><h6 id="exception-55" tabindex="-1"><a class="header-anchor" href="#exception-55" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>HookParam instance cannot cast to <strong>TYPE</strong></p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>HookParam</code> \u4E2D\u8C03\u7528 <code>instance</code> \u65B9\u6CD5\u6307\u5B9A\u4E86\u9519\u8BEF\u7684\u7C7B\u578B\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;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">    afterHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u7C7B\u578B\u88AB cast \u4E3A Activity \u4F46\u5047\u8BBE\u5F53\u524D\u5B9E\u4F8B\u7684\u7C7B\u578B\u5E76\u975E\u6B64\u7C7B\u578B</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>
<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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u786E\u8BA4\u5F53\u524D Hook \u5B9E\u4F8B\u7684\u6B63\u786E\u7C7B\u578B\u5E76\u91CD\u65B0\u586B\u5199\u6CDB\u578B\u4E2D\u7684\u7C7B\u578B\uFF0C\u82E5\u4E0D\u80FD\u786E\u5B9A\u8BF7\u4F7F\u7528 <code>Any</code> \u6216\u76F4\u63A5\u4F7F\u7528 <code>instance</code> \u53D8\u91CF\u3002</p><h6 id="exception-56" tabindex="-1"><a class="header-anchor" href="#exception-56" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>HookParam Method args is empty, mabe not has args</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>HookParam</code> \u4E2D\u8C03\u7528 <code>ArgsModifyer.set</code> \u65B9\u6CD5\u4F46\u662F\u5F53\u524D\u5B9E\u4F8B\u7684\u65B9\u6CD5\u53C2\u6570\u6570\u7EC4\u4E3A\u7A7A\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;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">    afterHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u8C03\u7528\u4E86\u6B64\u65B9\u6CD5</span></span>
<span class="line"><span style="color:#ADBAC7;">        args(...).set(...)</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u786E\u8BA4\u4F60 Hook \u7684\u76EE\u6807\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u7684\u65B9\u6CD5\u53C2\u6570\u6570\u91CF\u662F\u5426\u4E0D\u4E3A\u7A7A\uFF0C\u5426\u5219\u4F60\u65E0\u6CD5\u4F7F\u7528\u6B64\u529F\u80FD\u3002</p><h6 id="exception-57" tabindex="-1"><a class="header-anchor" href="#exception-57" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>HookParam Method args index out of bounds, max is <strong>NUMBER</strong></p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>HookParam</code> \u4E2D\u8C03\u7528 <code>ArgsModifyer.set</code> \u65B9\u6CD5\u6307\u5B9A\u4E86\u8D85\u51FA\u65B9\u6CD5\u53C2\u6570\u4E0B\u6807\u7684\u6570\u7EC4\u5E8F\u53F7\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;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">    afterHook {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u4E0B\u6807\u4ECE 0 \u5F00\u59CB\uFF0C\u5047\u8BBE\u539F\u59CB\u7684\u53C2\u6570\u4E0B\u6807\u662F 5 \u4E2A\uFF0C\u4F46\u662F\u8FD9\u91CC\u586B\u5199\u4E86 6</span></span>
<span class="line"><span style="color:#ADBAC7;">        args(index </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">6</span><span style="color:#ADBAC7;">).set(...)</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u786E\u8BA4\u4F60 Hook \u7684\u76EE\u6807\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u7684\u65B9\u6CD5\u53C2\u6570\u4E2A\u6570\uFF0C\u5E76\u91CD\u65B0\u8BBE\u7F6E\u6570\u7EC4\u4E0B\u6807\u3002</p><h6 id="exception-58" tabindex="-1"><a class="header-anchor" href="#exception-58" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>PackageParam got null ClassLoader</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>PackageParam</code> \u4E2D\u8C03\u7528\u4E86 <code>appClassLoader</code> \u53D8\u91CF\u4F46\u662F\u65E0\u6CD5\u83B7\u53D6\u5230\u5B9E\u4F8B\u5BF9\u8C61\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;">encase {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u8C03\u7528\u4E86\u6B64\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">    appClassLoader...</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u79CD\u60C5\u51B5\u51E0\u4E4E\u4E0D\u5B58\u5728\uFF0C\u9664\u975E\u6A21\u5757\u88AB\u88C5\u8F7D\u7684\u5BBF\u4E3B\u6216\u76EE\u6807 Hook Framework \u81EA\u8EAB\u5B58\u5728\u95EE\u9898\uFF0C\u82E5\u771F\u7684\u53D1\u751F\u4E86\u6B64\u95EE\u9898\uFF0C\u8BF7\u643A\u5E26\u8BE6\u7EC6\u65E5\u5FD7\u8FDB\u884C\u53CD\u9988\u3002</p><h6 id="exception-59" tabindex="-1"><a class="header-anchor" href="#exception-59" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Current Hook Framework not support moduleAppResources</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>PackageParam</code> \u4E2D\u8C03\u7528\u4E86 <code>moduleAppResources</code> \u53D8\u91CF\u4F46\u662F\u65E0\u6CD5\u83B7\u53D6\u5230\u5B9E\u4F8B\u5BF9\u8C61\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;">encase {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u8C03\u7528\u4E86\u6B64\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">    moduleAppResources...</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p><code>moduleAppResources</code> \u9700\u8981\u5F53\u524D Hook Framework \u652F\u6301 <code>initZygote</code> \u529F\u80FD\uFF0C\u8BF7\u68C0\u67E5\u540E\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-60" tabindex="-1"><a class="header-anchor" href="#exception-60" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>VariousClass match failed of those <strong>CLASSES</strong></p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u4F7F\u7528 <code>VariousClass</code> \u521B\u5EFA\u4E0D\u786E\u5B9A\u7684 <code>Class</code> \u5BF9\u8C61\u65F6\u5168\u90E8\u7684 <code>Class</code> \u90FD\u6CA1\u6709\u88AB\u627E\u5230\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u68C0\u67E5\u5F53\u524D Hook \u7684\u5BBF\u4E3B\u5185\u662F\u5426\u5B58\u5728\u5176\u4E2D\u80FD\u591F\u5339\u914D\u7684 <code>Class</code> \u540E\uFF0C\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-61" tabindex="-1"><a class="header-anchor" href="#exception-61" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Cannot get hook class &quot;<strong>NAME</strong>&quot; cause <strong>THROWABLE</strong></p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>hook</code> \u65B9\u6CD5\u4F53\u975E <code>onPrepareHook</code> \u65B9\u6CD5\u5185\u8C03\u7528\u4E86 <code>instanceClass</code> \u53D8\u91CF\u4E14\u5F53\u524D Hook \u7684 <code>Class</code> \u4E0D\u5B58\u5728\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:#F69D50;">TargetClass</span><span style="color:#ADBAC7;">.hook {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u53EF\u80FD\u7684\u60C5\u51B5\u4E3A\u5728\u975E onPrepareHook \u65B9\u6CD5\u4F53\u5185\u8C03\u7528\u4E86 instanceClass \u53D8\u91CF\u7528\u4E8E\u6253\u5370\u65E5\u5FD7</span></span>
<span class="line"><span style="color:#ADBAC7;">    loggerD(msg </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;$instanceClass hook start&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 class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u5728 <code>hook</code> \u5185\u76F4\u63A5\u4F7F\u7528 <code>instanceClass</code> \u662F\u5F88\u5371\u9669\u7684\uFF0C\u82E5 Class \u4E0D\u5B58\u5728\u5219\u4F1A\u76F4\u63A5\u5BFC\u81F4 Hook \u8FDB\u7A0B\u201C\u6B7B\u6389\u201D\u3002</p><p>\u8BE6\u60C5\u8BF7\u53C2\u8003 <a href="../guide/example#%E7%8A%B6%E6%80%81%E7%9B%91%E5%90%AC">\u72B6\u6001\u76D1\u542C</a>\u3002</p><h6 id="exception-62" tabindex="-1"><a class="header-anchor" href="#exception-62" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>LayoutInflatedParam View instance got null</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u5E03\u5C40 Hook \u56DE\u8C03\u4E2D\u8C03\u7528\u4E86 <code>currentView</code> \u4F46\u6CA1\u53D6\u5230\u5B9E\u4F8B\u5BF9\u8C61\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;">injectResource {</span></span>
<span class="line"><span style="color:#ADBAC7;">    conditions {</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;activity_main&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">        layout()</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">    injectAsLayout {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u8C03\u7528\u4E86\u6B64\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">        currentView...</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u79CD\u60C5\u51B5\u57FA\u672C\u4E0A\u4E0D\u5B58\u5728\uFF0C\u9664\u975E\u88AB Hook \u7684\u5BBF\u4E3B\u5F53\u524D <code>Activity</code> \u5DF2\u7ECF\u9500\u6BC1\u6216 Hook Framework \u81EA\u8EAB\u5B58\u5728\u95EE\u9898\u3002</p><h6 id="exception-63" tabindex="-1"><a class="header-anchor" href="#exception-63" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>XResForwarder is invalid</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>YukiResForwarder</code> \u4E2D\u8C03\u7528\u4E86 <code>resources</code> \u4F46\u6CA1\u53D6\u5230\u5B9E\u4F8B\u5BF9\u8C61\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;">// \u8C03\u7528\u4E86\u6B64\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">moduleAppResources.fwd(...).resources</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><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u79CD\u60C5\u51B5\u57FA\u672C\u4E0A\u4E0D\u5B58\u5728\uFF0C\u9664\u975E Hook Framework \u81EA\u8EAB\u5B58\u5728\u95EE\u9898\u3002</p><h6 id="exception-64" tabindex="-1"><a class="header-anchor" href="#exception-64" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>paramTypes is empty, please use emptyParam() instead</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u65F6\u4FDD\u7559\u4E86\u7A7A\u7684 <code>param</code> \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;">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;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u62EC\u53F7\u5185\u6CA1\u6709\u586B\u5199\u4EFB\u4F55\u53C2\u6570</span></span>
<span class="line"><span style="color:#ADBAC7;">    param()</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><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u82E5\u8981\u6807\u8BC6\u6B64\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u6CA1\u6709\u53C2\u6570\uFF0C\u4F60\u53EF\u4EE5\u6709\u5982\u4E0B\u8BBE\u7F6E\u65B9\u6CD5\u3002</p><p>\u7B2C\u4E00\u79CD\uFF0C\u8BBE\u7F6E <code>emptyParam</code> (\u63A8\u8350)</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;">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;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    emptyParam()</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></div><p>\u7B2C\u4E8C\u79CD\uFF0C\u8BBE\u7F6E <code>paramCount = 0</code></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;">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;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    paramCount </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">0</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></div><h6 id="exception-65" tabindex="-1"><a class="header-anchor" href="#exception-65" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Invalid YukiHookCallback type</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p><code>YukiHookAPI</code> \u7684\u6838\u5FC3 Hook \u529F\u80FD\u53D1\u751F\u6545\u969C\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u79CD\u60C5\u51B5\u57FA\u672C\u4E0A\u4E0D\u5B58\u5728\uFF0C\u82E5\u53D1\u751F\u4E0A\u8FF0\u95EE\u9898\uFF0C\u786E\u5B9A\u5E76\u975E\u81EA\u5DF1\u7684\u4EE3\u7801\u53D1\u751F\u7684\u95EE\u9898\u540E\uFF0C\u53EF\u63D0\u4EA4\u65E5\u5FD7\u8FDB\u884C\u53CD\u9988\u3002</p><h6 id="exception-66" tabindex="-1"><a class="header-anchor" href="#exception-66" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>ModuleContextThemeWrapper already loaded</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>Context</code> \u4E2D\u4F7F\u7528 <code>applyModuleTheme</code> \u65B9\u6CD5\u65F6\u91CD\u590D\u8FDB\u884C\u8C03\u7528\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;">// \u5047\u8BBE\u8FD9\u5C31\u662F\u5F53\u524D\u7684 Context \u5BF9\u8C61</span></span>
<span class="line"><span style="color:#ADBAC7;">context.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;">).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></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u5728 <code>Context</code> \u4E2D\u53EA\u80FD\u521B\u5EFA\u4E00\u6B21 <code>ModuleContextThemeWrapper</code>\uFF0C\u8BF7\u68C0\u67E5\u4EE3\u7801\u662F\u5426\u6709\u5FAA\u73AF\u8C03\u7528\u95EE\u9898\u3002</p><h6 id="exception-67" tabindex="-1"><a class="header-anchor" href="#exception-67" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Cannot create classes cache for &quot;android&quot;, please remove &quot;name&quot; param</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u7CFB\u7EDF\u6846\u67B6 (android) \u5BBF\u4E3B\u4F7F\u7528\u4E86 <code>DexClassFinder</code> \u7684\u7F13\u5B58\u529F\u80FD <code>searchClass(name = ...)</code>\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;">loadSystem {</span></span>
<span class="line"><span style="color:#ADBAC7;">    searchClass(name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;test&quot;</span><span style="color:#ADBAC7;">) {</span></span>
<span class="line"><span style="color:#ADBAC7;">        from(...)</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">    }.get()</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></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u7531\u4E8E\u7F13\u5B58\u4F1A\u5C06\u627E\u5230\u7684 <code>Class</code> \u540D\u79F0\u5B58\u5165 <code>SharedPreferences</code>\uFF0C\u4F46\u662F\u7CFB\u7EDF\u6846\u67B6\u4E0D\u5B58\u5728 data \u76EE\u5F55\uFF0C\u6240\u4EE5\u8BF7\u4E0D\u8981\u5728\u7CFB\u7EDF\u6846\u67B6\u4E2D\u4F7F\u7528\u6B64\u529F\u80FD\u3002</p>`,534),p=[l];function c(i,t){return n(),e("div",null,p)}const d=s(o,[["render",c],["__file","api-exception.html.vue"]]);export{d as default};
