import{_ as e,o as s,c as n,a as o}from"./app.f643a53b.js";const a={},l=o(`<h1 id="api-exception-handling" tabindex="-1"><a class="header-anchor" href="#api-exception-handling" aria-hidden="true">#</a> API Exception Handling</h1><blockquote><p>Exceptions are the main problems often encountered in the development process. Here are some common exceptions that may be encountered during the use of <code>YukiHookAPI</code> and how to deal with them.</p></blockquote><p>The exception description here will only synchronize the latest API version, and the exception of the older API version will not be described again, please always keep the API version up-to-date.</p><h2 id="non-blocking-exceptions" tabindex="-1"><a class="header-anchor" href="#non-blocking-exceptions" aria-hidden="true">#</a> Non-Blocking Exceptions</h2><blockquote><p>These exceptions will not cause the app to stop running (FC), but will print <code>E</code> level logs on the console, and may also stop continuing to execute related functions.</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 any available Hook APIs in current environment! Aborted</p></div><p><strong>Abnormal</strong></p><p>Your Hook Framework is not working or did not successfully load the current Hook API.</p><p><strong>Solution</strong></p><p>Please make sure you have loaded the <code>encase</code> method of <code>YukiHookAPI</code> in the correct place. For details, please refer to <a href="../config/xposed-using">Use as Xposed Module Configs</a> and <a href="../config/api-using">Use as Hook API Configs</a>.</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>Abnormal</strong></p><p>You try to load the <code>encase</code> method in the <code>onInit</code> or <code>onXposedEvent</code> method of the Hook entry class that implements <code>IYukiHookXposedInit</code>.</p><blockquote><p>The following example</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;">object</span><span style="color:#ADBAC7;"> HookEntry </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 Wrong usage</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 Wrong usage</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>Solution</strong></p><p>Please load the <code>encase</code> method in the <code>onHook</code> method.</p><blockquote><p>The following example</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;">object</span><span style="color:#ADBAC7;"> HookEntry </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;">// Only the configs method can be loaded here</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 Correct usage</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>An exception occurred in the Hooking Process of YukiHookAPI</p></div><p><strong>Abnormal</strong></p><p><code>YukiHookAPI</code> exception occurred while loading Xposed entry method.</p><p><strong>Solution</strong></p><p>This is an exception summary.</p><p>If any exception occurs in your current Hook Process (Hook Process crashes), it will be printed to the console using this method.</p><p>Please trace the stack where the exception occurred to locate your code problem.</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>An exception occurred when hooking internal function</p></div><p><strong>Abnormal</strong></p><p><code>YukiHookAPI</code> throws an exception during its own initialization hook.</p><p><strong>Solution</strong></p><p>Usually, this kind of error does not happen easily. If this error occurs, you can directly submit the log for feedback.</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 try to load hook entry class failed</p></div><p><strong>Abnormal</strong></p><p><code>YukiHookAPI</code> encountered an unhandled exception or the entry class could not be found when trying to load the hook entry class <code>onInit</code> or <code>onHook</code> method.</p><p><strong>Solution</strong></p><p>Usually, this kind of error does not occur easily.</p><p>If this error occurs, please check the log printed on the console to locate the problem.</p><p>After confirming that the problem is not caused by your own code, you can submit the log for feedback.</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>An exception occurred when YukiHookAPI loading Xposed Module</p></div><p><strong>Abnormal</strong></p><p><code>YukiHookAPI</code> encountered an unhandled exception when trying to load a Xposed Module using the Xposed native interface.</p><p><strong>Solution</strong></p><p>Usually, this kind of error does not occur easily.</p><p>If this error occurs, please check the log printed on the console to locate the problem.</p><p>After confirming that the problem is not caused by your own code, you can submit the log for feedback.</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>Failed to execute method &quot;<strong>NAME</strong>&quot;, maybe your Hook Framework not support Resources Hook</p></div><p><strong>Abnormal</strong></p><p><code>YukiHookAPI</code> An error occurred while trying to do a Resources Hook.</p><p><strong>Solution</strong></p><p>Please double check the error log for details.</p><p>If a <code>Resources$NotFoundException</code> occurs, you may be looking for an incorrect Resources Id.</p><p>If <code>ClassNotFound</code> or <code>NoClassDefFoundError</code> occurs, it may be that Hook Framework does not support Resources Hook.</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>HookClass [<strong>NAME</strong>] not found</p></div><p><strong>Abnormal</strong></p><p>The <code>Class</code> currently being hooked was not found.</p><p><strong>Solution</strong></p><p>Please check if the target <code>Class</code> exists, to ignore this error use the <code>ignoredHookClassNotFoundFailure</code> method.</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>Hook Member [<strong>NAME</strong>] failed</p></div><p><strong>Abnormal</strong></p><p>An error occurred while hooking the target method, constructor.</p><p><strong>Solution</strong></p><p>This problem is usually caused by Hook Framework.</p><p>Please check the corresponding log content.</p><p>If the problem persists, please bring detailed logs for feedback.</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 with a finding error by <strong>CLASS</strong></p></div><p><strong>Abnormal</strong></p><p>After the Hook is executed, the <code>member</code> of the Hook is <code>null</code> and the target Hook method and constructed class have been set.</p><p><strong>Solution</strong></p><p>Please check the previous error log before this error occurs, maybe there is an error that the method and constructor cannot be found when searching for methods and constructors.</p><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 Member cannot be non-null by <strong>CLASS</strong></p></div><p><strong>Abnormal</strong></p><p>After the Hook is executed, the <code>member</code> of the Hook is <code>null</code> and the target Hook method and constructed class are not set.</p><blockquote><p>The following example</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;">// There are no search conditions for methods and constructors that require hooks</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>Solution</strong></p><p>Please confirm that you have correctly set the method to be hooked and the way to find the constructor before hooking.</p><blockquote><p>The following example</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 Examples of correct usage</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-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>Hooked method return type match failed, required [<strong>TYPE</strong>] but got [<strong>TYPE</strong>]</p></div><p><strong>Abnormal</strong></p><p><code>HookParam.result</code> is set in the Hook callback method body or <code>replaceHook</code> is used but the return value type of the hooked method does not match the original return value type.</p><blockquote><p>The following example</p></blockquote><p>Suppose this is the method being Hooked.</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>Below is an error case.</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;Scenario 1&gt; Set the wrong type, the original type is 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;Scenario 2&gt; Return the wrong type, the original type is 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;Scenario 3&gt; Use the wrong type directly, the original type is 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">Notice</p><p>If the above scenario occurs in <strong>beforeHook</strong> or <strong>afterHook</strong>, it will cause the Host App to throw an exception from <strong>XposedBridge</strong> (which will expose the fact of being Hooked).</p></div><p><strong>Solution</strong></p><p>Please confirm the correct return value type of the current Hook method, modify it and try again.</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>Hook initialization failed because got an Exception</p></div><p><strong>Abnormal</strong></p><p>An arbitrary exception occurred while preparing the Hook.</p><p><strong>Solution</strong></p><p>This is a reminder that an exception occurred during the Hook preparation stage, please carefully check what the specific exception is to re-determine the problem.</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>Try to hook <strong>NAME</strong>[<strong>NAME</strong>] got an Exception</p></div><p><strong>Abnormal</strong></p><p>An arbitrary exception occurred at the start of the Hook.</p><p><strong>Solution</strong></p><p>This is a reminder that an exception occurred at the beginning of the Hook, please check carefully what the specific exception is to re-determine the problem.</p><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>Method/Constructor/Field match type &quot;<strong>TYPE</strong>&quot; not allowed</p></div><p><strong>Abnormal</strong></p><p>A disallowed parameter type was set when looking up methods, constructors, and variables.</p><blockquote><p>The following example</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;">// Find a method</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 Invalid type example is set</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 Invalid type example is set</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;">// Find a variable</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 Invalid type example is set</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>Solution</strong></p><p>In the search, <code>param</code>, <code>returnType</code>, <code>type</code> only accept <code>Class</code>, <code>String</code>, <code>VariousClass</code> types, and parameter instances cannot be passed in.</p><blockquote><p>The following example</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;">// Find a method</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 Examples of correct usage</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 Examples of correct usage</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 The following scheme is also correct</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;">// Find a variable</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 Examples of correct usage</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-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>NoSuchMethod/NoSuchConstructor/NoSuchField happend in [<strong>NAME</strong>]</p></div><p><strong>Abnormal</strong></p><p>The target method, constructor, and variable were not found when looking for methods, constructors, and variables.</p><p><strong>Solution</strong></p><p>Please confirm that your search criteria can correctly match the specified methods, constructors and variables in the target <code>Class</code>.</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>Trying <strong>COUNT</strong> times and all failure by RemedyPlan</p></div><p><strong>Abnormal</strong></p><p>When using <code>RemedyPlan</code> to search for methods, constructors, and variables, the methods, constructors, and variables are still not found.</p><p><strong>Solution</strong></p><p>Please confirm the <code>RemedyPlan</code> parameter you set and the <code>Class</code> that exists in the Host App, and try again.</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>You must set a condition when finding a Method/Constructor/Field</p></div><p><strong>Abnormal</strong></p><p>No conditions are set when looking for methods, constructors, and variables.</p><blockquote><p>The following example</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;">// No conditions are set here</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>Solution</strong></p><p>Please complete your search criteria and try again.</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 Class in [<strong>CLASSLOADER</strong>]: <strong>CONTENT</strong> Generated by YukiHookAPI#ReflectionTool</p></div><p><strong>Abnormal</strong></p><p>The <code>Class</code> object to be searched for was not found via <code>ClassLoader.searchClass</code> or <code>PackageParam.searchClass</code>.</p><blockquote><p>The following example</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>Solution</strong></p><p>This is a security exception, please check the conditions you set, use the relevant tools to view the <code>Class</code> and bytecode object characteristics in the <strong>Dex</strong> and try again.</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>Can&#39;t find this Method/Constructor/Field in [<strong>CLASS</strong>]: <strong>CONTENT</strong> Generated by YukiHookAPI#ReflectionTool</p></div><p><strong>Abnormal</strong></p><p>The methods, constructors, and variables that need to be found cannot be found by specifying conditions.</p><blockquote><p>The following example</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>Solution</strong></p><p>This is a security exception, please check the conditions you set, use the relevant tools to view the bytecode object characteristics in the <code>Class</code>, and try again.</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>The number of VagueType must be at least less than the count of paramTypes</p></div><p><strong>Abnormal</strong></p><p>Incorrect use of <code>VagueType</code> in <code>Method</code>, <code>Constructor</code> lookup conditions.</p><blockquote><p>The following example</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;Scenario 1&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;Scenario 2&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>Solution</strong></p><p><code>VagueType</code> cannot be completely filled in method and constructor parameters. If there is such a requirement, please use <code>paramCount</code>.</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>Field match type class is not found</p></div><p><strong>Abnormal</strong></p><p>An instance of <code>Class</code> for <code>type</code> was not found in the lookup criteria set when looking up the variable.</p><blockquote><p>The following example</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;">// Assume that the Class of the type set here does not exist</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>Solution</strong></p><p>Please check if <code>Class</code> of <code>type</code> in the lookup condition exists and try again.</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 match returnType class is not found</p></div><p><strong>Abnormal</strong></p><p>An instance of <code>Class</code> of <code>returnType</code> was not found in the search criteria set when looking up the method.</p><blockquote><p>The following example</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;">// Assume that the Class of returnType set here does not exist</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>Solution</strong></p><p>Please check if <code>Class</code> of <code>returnType</code> in the lookup condition exists and try again.</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>Method/Constructor match paramType[<strong>INDEX</strong>] class is not found</p></div><p><strong>Abnormal</strong></p><p>The <code>Class</code> instance subscripted by the <code>index</code> number of <code>param</code> was not found in the search conditions set when searching for methods and constructors.</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;">// Assume that the Class with subscript &quot;No.1&quot; set here does not exist</span></span>
<span class="line"><span style="color:#ADBAC7;">    param(</span><span style="color:#F69D50;">StringClass</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>Solution</strong></p><p>Please check if the <code>Class</code> subscripted by the <code>index</code> number of <code>param</code> in the lookup condition exists and try again.</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>Invoke original Member [<strong>MEMBER</strong>] failed</p></div><p><strong>Abnormal</strong></p><p>An error occurred when using <code>HookParam.callOriginal</code>, <code>HookParam.invokeOriginal</code>, <code>method { ... }.get(...).original()</code> to call the original method without Hook.</p><p><strong>Solution</strong></p><p>Under normal circumstances, this error will basically not occur.</p><p>If this error occurs, it may be a problem with the currently used Hook Framework.</p><p>After troubleshooting your own code problems, please provide detailed logs for feedback.</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 condition name/type cannot be empty [<strong>TAG</strong>]</p></div><p><strong>Abnormal</strong></p><p>No conditions were set when looking for Resources.</p><blockquote><p>The following example</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;">// Case 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;">// No conditions are set here</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"><span style="color:#768390;">// Case 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;">// The type condition is missing here</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>Solution</strong></p><p>The Hook of Resources is not a Hook similar to a method.</p><p>It must have a complete name and type description in order to find it successfully.</p><p>Please complete the search conditions and try again.</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>Resources Hook type is invalid [<strong>TAG</strong>]</p></div><p><strong>Abnormal</strong></p><p>An exception of the wrong type occurred while Hooking Resources.</p><p><strong>Solution</strong></p><p><code>YukiHookAPI</code> will try to load Resources Hook in <code>initZygote</code> and <code>handleInitPackageResources</code>.</p><p>If all loading fails, this exception may occur.</p><p>The current Hook Framework needs to support and enable the Resources Hook function, please check and try again.</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>Resources Hook got an Exception [<strong>TAG</strong>]</p></div><p><strong>Abnormal</strong></p><p>An arbitrary exception occurred while Hooking Resources.</p><p><strong>Solution</strong></p><p>This is a summary of exceptions, please check down the log for the specific exception, such as the problem that the Resources Id cannot be found.</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>Received action &quot;<strong>ACTION</strong>&quot; failed</p></div><p><strong>Abnormal</strong></p><p>Callback broadcast event exception when using <code>YukiHookDataChannel</code>.</p><p><strong>Solution</strong></p><p>This exception is mostly caused by some related exceptions.</p><p>Please check whether there is any problem in your own code.</p><p>After troubleshooting your own code, please bring detailed logs to give feedback.</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>Received data type <strong>TYPE</strong> is not a vailed YukiHookDataChannel&#39;s data</p></div><p><strong>Abnormal</strong></p><p>When using <code>YukiHookDataChannel</code>, the callback broadcast received data that does not belong to <code>YukiHookDataChannel</code>.</p><p><strong>Solution</strong></p><p>In order to ensure data security, <code>YukiHookDataChannel</code> will wrap the sent data, any third-party broadcast events cannot be received by <code>YukiHookDataChannel</code>, please check whether your code is correct.</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>Unsupported segments data key of &quot;<strong>KEY</strong>&quot;&#39;s type</p></div><p><strong>Abnormal</strong></p><p>Callback broadcast received unsupported segments data type when using <code>YukiHookDataChannel</code>.</p><p><strong>Solution</strong></p><p>Under normal circumstances, this error cannot occur, because the segments data type supported by <code>YukiHookDataChannel</code> is fixed and will not change dynamically.</p><p>If this happens, please check whether the API-related code has been changed.</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>YukiHookDataChannel cannot merge this segments data key of &quot;<strong>KEY</strong>&quot;</p></div><p><strong>Abnormal</strong></p><p>When using <code>YukiHookDataChannel</code>, the callback broadcast received segments data that could not be processed, so the segments data could not be merged.</p><p><strong>Solution</strong></p><p>Under normal circumstances, this error will basically not occur, unless you receive broadcasts that are continuously sent or repeatedly sent (timing exceptions) or you set the wrong generic type when receiving data, after troubleshooting your own code problems, please bring detailed logs give feedback.</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>YukiHookDataChannel cannot calculate the byte size of the data key of &quot;<strong>KEY</strong>&quot; to be sent, so this data cannot be sent</p><p>If you want to lift this restriction, use the allowSendTooLargeData function when calling, but this may cause the app crash</p></div><p><strong>Abnormal</strong></p><p>Failed to calculate data size when sending broadcast data using <code>YukiHookDataChannel</code>.</p><p><strong>Solution</strong></p><p>Under normal circumstances, this error will basically not occur.</p><p>After troubleshooting your own code problems, please bring detailed logs for feedback.</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>YukiHookDataChannel cannot send this data key of &quot;<strong>KEY</strong>&quot; type <strong>TYPE</strong>, because it is too large (total <strong>TOTAL</strong> KB, limit <strong>LIMIT</strong> KB) and cannot be segmented</p><p><strong>SUGGESTION_MESSAGE</strong></p><p>If you want to lift this restriction, use the allowSendTooLargeData function when calling, but this may cause the app crash</p></div><p><strong>Abnormal</strong></p><p>When using <code>YukiHookDataChannel</code> to send broadcast data, the data is too large, but this data type does not support being sent in segments.</p><p><strong>Solution</strong></p><p>When the data you send exceeds the upper limit of the system broadcast, <code>YukiHookDataChannel</code> will send the data in segments by default, but only supports processing <strong>List</strong>, <strong>Map</strong>, <strong>Set</strong>, <strong>String</strong> automatic segmentation function for common types.</p><div class="custom-container tip"><p class="custom-container-title">Tips</p><p>If you still want to use this feature, please refer to <a href="../api/public/com/highcapable/yukihookapi/hook/xposed/channel/YukiHookDataChannel#allowsendtoolargedata-method">YukiHookDataChannel.NameSpace.allowSendTooLargeData</a> method.</p><p>But <u><strong>it is strongly recommended not to do this</strong></u>, <u><strong>this may cause the system to not allow too large data to be sent and cause the app crash</strong></u>.</p></div><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">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>Abnormal</strong></p><p>Sending a broadcast when using <code>YukiHookDataChannel</code> got an empty context instance.</p><p><strong>Solution</strong></p><p>Under normal circumstances, this error basically does not occur.</p><p>In the latest version, the problems that may occur when the host is used have been fixed.</p><p>If the latest version still has errors, after eliminating the problem of your own code, please bring detailed logs for feedback.</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">loggerE</p><p>Failed to inject module resources into [<strong>RESOURCES</strong>]</p></div><p><strong>Abnormal</strong></p><p>An exception occurred when injecting Module App&#39;s Resources using <code>injectModuleAppResources</code> in a (Xposed) Host environment.</p><p><strong>Solution</strong></p><p>Under normal circumstances, this error basically does not occur. After eliminating the problem of your own code, please bring detailed logs for feedback.</p><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">loggerE</p><p>You cannot inject module resources into yourself</p></div><p><strong>Abnormal</strong></p><p>Use <code>injectModuleAppResources</code> in the (Xposed) Host environment (the Module App&#39;s own Xposed Environment) to inject the Module App&#39;s own resources into itself.</p><p><strong>Solution</strong></p><p>Since the Module App itself can also be Hooked by itself, you cannot inject yourself into the Module App itself (you cannot recurse its own resources).</p><p>If you must obtain the resources of the Module App itself, please use it directly without any other operations.</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">loggerE</p><p>Activity Proxy initialization failed because got an Exception</p></div><p><strong>Abnormal</strong></p><p>An exception occurred when injecting a Module App&#39;s <code>Activity</code> using <code>registerModuleAppActivities</code> in a (Xposed) Host environment.</p><p><strong>Solution</strong></p><p>Please check the next error log after this error occurs.</p><p>Maybe some problems may have occurred in the configuration parameters.</p><p>If you cannot find the description of the relevant error log, after eliminating the problem of your own code, please bring the detailed log for feedback.</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">loggerE</p><p>Activity Proxy got an Exception in msg.what [<strong>WHAT</strong>]</p></div><p><strong>Abnormal</strong></p><p>An exception occurred when injecting a Module App&#39;s <code>Activity</code> using <code>registerModuleAppActivities</code> in a (Xposed) Host environment.</p><p><strong>Solution</strong></p><p>Under normal circumstances, this error basically does not occur, but according to the difference of the system version, no detailed testing has been done.</p><p>After eliminating the problem of your own code, please bring detailed logs for feedback.</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">loggerE</p><p>This proxy [<strong>TYPE</strong>] type is not allowed</p></div><p><strong>Abnormal</strong></p><p>Invalid parameters were filled in when injecting Module App&#39;s <code>Activity</code> using <code>registerModuleAppActivities</code> in a (Xposed) Host environment.</p><blockquote><p>The following example</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 The content filled in here is just an example</span></span>
<span class="line"><span style="color:#768390;">// And the proxy is filled with invalid parameters that cannot be understood</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 class="line-number"></div></div></div><p><strong>Solution</strong></p><p>The <code>proxy</code> parameter in the method only accepts <code>String</code>, <code>CharSequence</code>, <code>Class</code> types, please refer to the related usage method to fill in the method parameters correctly.</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">loggerE</p><p>Cound not got launch intent for package &quot;<strong>NAME</strong>&quot;</p></div><p><strong>Abnormal</strong></p><p>When injecting Module App&#39;s <code>Activity</code> using <code>registerModuleAppActivities</code> in a (Xposed) Host environment, the Host App&#39;s launching <code>Activity</code> cannot be found.</p><blockquote><p>The following example</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;">// Register directly with default parameters</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>Solution</strong></p><p>The default parameter (no parameter) can only be used for the app that can be launched.</p><p>If the app does not declare the startup entry <code>Activity</code>, you need to manually specify the <code>proxy</code> parameter of the method.</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">loggerE</p><p>Could not found &quot;<strong>NAME</strong>&quot; or Class is not a type of Activity</p></div><p><strong>Abnormal</strong></p><p>When injecting Module App&#39;s <code>Activity</code> with <code>registerModuleAppActivities</code> in a (Xposed) Host environment, the <code>Activity</code> filled with the parameter <code>proxy</code> cannot be found.</p><blockquote><p>The following example</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>Solution</strong></p><p>Please make sure that the <code>Activity</code> name you fill in really and effectively exists in the Host App, and the target <code>Class</code> extends <code>Activity</code>.</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">loggerE</p><p>You cannot register Activity Proxy into yourself</p></div><p><strong>Abnormal</strong></p><p>Use <code>registerModuleAppActivities</code> to inject the Module App&#39;s own <code>Activity</code> into itself in the (Xposed) Host environment (the Module App&#39;s own Xposed Environment).</p><p><strong>Solution</strong></p><p>Since the Module App itself can also be Hooked by itself, you cannot inject yourself into the Module App itself (you cannot recurse its own resources).</p><p>If you must obtain the resources of the Module App itself, please use it directly without any other operations.</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">loggerE</p><p>Activity Proxy only support for Android 7.0 (API 24) or higher</p></div><p><strong>Abnormal</strong></p><p>Use <code>registerModuleAppActivities</code> in the (Xposed) Host environment but the current system version does not meet the minimum requirements of Android 7.0 (API 24).</p><p><strong>Solution</strong></p><p>Activity Proxy only supports systems higher than or equal to Android 7.0 (API 24).</p><p>Please try to upgrade your system or make requirements for the minimum api version compatibility of the Module App, for example, set the minimum api to 24.</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">loggerE</p><p>An exception occurred during AppLifecycle event</p></div><p><strong>Abnormal</strong></p><p>Use <code>onAppLifecycle</code> in the (Xposed) Host environment to listen for exceptions during the Host App&#39;s lifecycle.</p><p><strong>Solution</strong></p><p>This exception is thrown in <code>onAppLifecycle</code>.</p><p>Since you set the parameter <code>isOnFailureThrowToApp = false</code>, the exception is not thrown in the Host App but printed in the (Xposed) Host environment.</p><p>This is not an API exception, please be careful check your own code for problems.</p><h2 id="blocking-exceptions" tabindex="-1"><a class="header-anchor" href="#blocking-exceptions" aria-hidden="true">#</a> Blocking Exceptions</h2><blockquote><p>These exceptions will directly cause the app to stop running (FC), at the same time print <code>E</code> level logs on the console, and also cause the Hook process to &quot;die&quot;.</p></blockquote><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>YukiHookAPI cannot support current Hook API or cannot find any available Hook APIs in current environment</p></div><p><strong>Abnormal</strong></p><p><code>YukiHookAPI</code> does not support the Hook API used by the current environment or there is no Hook API that can be called.</p><p><strong>Solution</strong></p><p>Please make sure you have loaded the <code>encase</code> method of <code>YukiHookAPI</code> in the correct place. For details, please refer to <a href="../config/xposed-using">Use as Xposed Module Configs</a> and <a href="../config/api-using">Use as Hook API Configs</a>.</p><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">UnsupportedOperationException</p><p>!!!DANGEROUS!!! Hook [<strong>CLASS</strong>] Class is a dangerous behavior! [<strong>CONTENT</strong>] [<strong>SOLVE</strong>]</p></div><p><strong>Abnormal</strong></p><p>You tried to hook a <code>Class</code> object in the list of dangerous behaviors, such as <code>Class</code>, <code>ClassLoader</code>, <code>Method</code>.</p><blockquote><p>The following example</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;Scenario 1&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;Scenario 2&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;Scenario 3&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>Solution</strong></p><p>These functions are internal to the system, <u><strong>they should not be hooked, may not be supported on some Hook Frameworks, and may cause other errors</strong></u>, please try to replace the hook point.</p><div class="custom-container tip"><p class="custom-container-title">Tips</p><p>If you still want to use this feature, please refer to <a href="../api/public/com/highcapable/yukihookapi/hook/core/YukiMemberHookCreator#usedangerousoperation-method">YukiMemberHookCreator.useDangerousOperation</a> method.</p><p>But <strong>It is strongly recommended not to do this, please do not report any problems, <u>all the consequences will be borne by yourself</u></strong>.</p></div><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">NoClassDefFoundError</p><p>Can&#39;t find this Class in [<strong>CLASSLOADER</strong>]: <strong>CONTENT</strong> Generated by YukiHookAPI#ReflectionTool</p></div><p><strong>Abnormal</strong></p><p>The <code>Class</code> object you were looking for was not found via <code>String.toClass(...)</code> or <code>classOf&lt;...&gt;()</code>.</p><blockquote><p>The following example</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>Solution</strong></p><p>Please check if the <code>Class</code> matched by the current string or entity exists in the current <code>ClassLoader</code> and try again.</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>ClassLoader [<strong>CLASSLOADER</strong>] is not a DexClassLoader</p></div><p><strong>Abnormal</strong></p><p>Use <code>ClassLoader.searchClass</code> or <code>PackageParam.searchClass</code> to find <code>Class</code> but currently <code>ClassLoader</code> does not extends <code>BaseDexClassLoader</code>.</p><p><strong>Solution</strong></p><p>This situation basically does not exist, unless the current app references a Non-ART platform executable (which not realistic) or the current <code>ClassLoader</code> is null.</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>Failed to got SystemContext</p></div><p><strong>Abnormal</strong></p><p><code>systemContext</code> was called in the Host App but the instance object was not successfully obtained.</p><blockquote><p>The following example</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;">// This variable is called</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>Solution</strong></p><p>This situation should not exist, since <code>systemContext</code> is obtained from <code>ActivityThread</code> through reflection, unless the system process fails, the obtained object will not be null.</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>App is dead, You cannot call to appContext</p></div><p><strong>Abnormal</strong></p><blockquote><p>The first case</p></blockquote><p>The <code>appContext</code> of the <code>ModuleApplication</code> is called within the Hook App.</p><blockquote><p>The following example</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;">// This variable is called</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>The second case</p></blockquote><p><code>appContext</code> was called when using <code>ModuleApplication</code> but the app may have been destroyed or not started correctly.</p><blockquote><p>The following example</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;">// This variable is called but the app may have been destroyed or not started correctly</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>Solution</strong></p><blockquote><p>The first case</p></blockquote><p>You can only use the <code>appContext</code> of <code>ModuleApplication</code> in the Module App, please use the <code>appContext</code> in the <code>PackageParam</code> in the Host App, please make sure you use it correctly.</p><blockquote><p>The second case</p></blockquote><p>This situation basically does not exist, because <code>appContext</code> is assigned in <code>onCreate</code>, unless the <code>onCreate</code> method of the parent class is called by reflection before multi-process concurrent startup or app is not started and completed.</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>YukiHookPrefsBridge not allowed in Custom Hook API</p></div><p><strong>Abnormal</strong></p><p><code>YukiHookPrefsBridge</code> is used in Hook&#39;s own app (not Xposed Module).</p><blockquote><p>The following example</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 Can&#39;t use prefs in this case</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>Solution</strong></p><p>You can only use <code>YukiHookPrefsBridge</code> when <a href="../config/xposed-using">Use as Xposed Module Configs</a>, please use the native <code>Sp</code> storage in the Hook&#39;s own app.</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>Cannot load the XSharedPreferences, maybe is your Hook Framework not support it</p></div><p><strong>Abnormal</strong></p><p>Using <code>YukiHookPrefsBridge</code> in (Xposed) Host environment but unable to get <code>XSharedPreferences</code> object.</p><blockquote><p>The following example</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;">// This variable is called</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>Solution</strong></p><p>Under normal circumstances, this problem does not occur.</p><p>If you continue to fail to obtain the <code>XSharedPreferences</code> object, it may be that the Hook Framework you are using does not support this function or has an error.</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>YukiHookDataChannel not allowed in Custom Hook API</p></div><p><strong>Abnormal</strong></p><p><code>YukiHookDataChannel</code> is used in Hook&#39;s own app (not Xposed Module).</p><blockquote><p>The following example</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 dataChannel cannot be used in this case</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>Solution</strong></p><p>You can only use <code>YukiHookDataChannel</code> when <a href="../config/xposed-using">Use as Xposed Module Configs</a>.</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>Xposed modulePackageName load failed, please reset and rebuild it</p></div><p><strong>Abnormal</strong></p><p>When using <code>YYukiHookPrefsBridge</code> or <code>YukiHookDataChannel</code> in the Hook process, the <code>modulePackageName</code> at load time cannot be read, resulting in the package name of the own Module App cannot be determined.</p><p><strong>Solution</strong></p><p>Please read the help document <a href="../config/xposed-using#modulepackagename-parameter">here</a> carefully, and configure the Module App&#39;s Hook entry class package name correctly.</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>YukiHookPrefsBridge missing Context instance</p></div><p><strong>Abnormal</strong></p><p><code>YukiHookPrefsBridge</code> is used in the Module App to store data but no <code>Context</code> instance is passed in.</p><blockquote><p>The following example</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 Wrong usage</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// Constructor has been set to private in API 1.0.88 and later</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#F69D50;">YukiHookPrefsBridge</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>Solution</strong></p><p>It is recommended to use the <code>prefs(...)</code> method to load <code>YukiHookPrefsBridge</code> in <code>Activity</code>.</p><blockquote><p>The following example</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 Correct usage</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>
<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-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>The Host App&#39;s Context has not yet initialized successfully, the native function cannot be used at this time</p></div><p><strong>Abnormal</strong></p><p>In the (Xposed) Host environment <code>PackageParam</code>, <code>YukiHookPrefsBridge</code> is used and the <code>native</code> method is called, but the lifecycle of the Host App is not initialized at this time.</p><blockquote><p>The following example</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;">// This method was called</span></span>
<span class="line"><span style="color:#ADBAC7;">    prefs.native()</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>Solution</strong></p><p>The <code>native</code> method requires an existing <code>Context</code> object to store data in, and you can use this method in listening to the Host App lifecycle state.</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>Key-Value type <strong>TYPE</strong> is not allowed</p></div><p><strong>Abnormal</strong></p><p>An unsupported storage type was passed in when using the <code>get</code> or <code>put</code> methods of <code>YukiHookPrefsBridge</code> or the <code>wait</code> or <code>put</code> methods of <code>YukiHookDataChannel</code>.</p><p><strong>Solution</strong></p><p>The supported types of <code>YukiHookPrefsBridge</code> are only <code>String</code>, <code>Set&lt;String&gt;</code>, <code>Int</code>, <code>Float</code>, <code>Long</code>, <code>Boolean</code>, please pass in the supported types.</p><p>The supported types of <code>YukiHookDataChannel</code> are the types restricted by <code>Intent.putExtra</code>, please pass in the supported types.</p><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>loadApp/loadZygote/loadSystem/withProcess method need a &quot;<strong>NAME</strong>&quot; param</p></div><p><strong>Abnormal</strong></p><p>The variable array variable parameter that needs to be filled is missing in <code>loadApp</code>, <code>loadZygote</code>, <code>loadSystem</code>, <code>withProcess</code>.</p><blockquote><p>The following example</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;Scenario 1&gt;</span></span>
<span class="line"><span style="color:#ADBAC7;">loadApp()</span></span>
<span class="line"><span style="color:#768390;">// &lt;Scenario 2&gt;</span></span>
<span class="line"><span style="color:#ADBAC7;">loadZygote()</span></span>
<span class="line"><span style="color:#768390;">// &lt;Scenario 3&gt;</span></span>
<span class="line"><span style="color:#ADBAC7;">loadSystem()</span></span>
<span class="line"><span style="color:#768390;">// &lt;Scenario 4&gt;</span></span>
<span class="line"><span style="color:#ADBAC7;">withProcess()</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><strong>Solution</strong></p><p>Please see the usage in <code>PackageParam</code> to use this function correctly.</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>YukiHookDataChannel cannot be used in zygote</p></div><p><strong>Abnormal</strong></p><p><code>YukiHookDataChannel</code> is used in <code>loadZygote</code>.</p><blockquote><p>The following example</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;">// This variable is called</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>Solution</strong></p><p><code>YukiHookDataChannel</code> can only be used in <code>loadSystem</code>, <code>loadApp</code>.</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>Custom Hooking Members is empty</p></div><p><strong>Abnormal</strong></p><p><code>members()</code> is called in <code>MemberHookCreator</code> but the <code>Member</code> instance that requires the Hook is not set.</p><blockquote><p>The following example</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;">// Method parameters in parentheses are left blank</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>Solution</strong></p><p>To use <code>members()</code> to set a custom Hook method, you must ensure that the <code>Member</code> array object in its method parameter cannot be empty.</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>HookParam Method args index must be &gt;= 0</p></div><p><strong>Abnormal</strong></p><p><code>args().last()</code> is called in <code>HookParam</code> but the target <code>param</code> is empty or the <code>index</code> in <code>args</code> is set to a value less than 0.</p><blockquote><p>The following example</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;">// Assume param is empty</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;">// Set an index less than 0</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>Solution</strong></p><p>Please make sure that the number of method parameters of the target method and constructor of your Hook is not empty, and the subscript of <code>args</code> cannot be set to a value less than 0.</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>HookParam instance got null! Is this a static member?</p></div><p><strong>Abnormal</strong></p><p>An object that calls an <code>instance</code> variable or <code>instance</code> method in a <code>HookParam</code> but cannot get the current instance.</p><blockquote><p>The following example</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;">// This variable is called</span></span>
<span class="line"><span style="color:#ADBAC7;">        instance...</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// This method is called</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>Solution</strong></p><p>Please confirm whether the method of your Hook is a static type.</p><p>The static type method has no instance and cannot use this function.</p><p>If it is not a static method, please check whether the instance has been destroyed.</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>Current hooked Member args is null</p></div><p><strong>Abnormal</strong></p><p>The <code>args</code> variable is called in <code>HookParam</code>, but the parameter array of the current instance method and constructor cannot be obtained.</p><blockquote><p>The following example</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;">// This variable is called</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>Solution</strong></p><p>This kind of problem generally does not occur.</p><p>If this problem does occur, please bring detailed logs for feedback.</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>Current hooked Member is null</p></div><p><strong>Abnormal</strong></p><p>Call the <code>member</code> variable in <code>HookParam</code> but cannot get the method and constructor instance of the current instance.</p><blockquote><p>The following example</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;">// This variable is called</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>Solution</strong></p><p>This kind of problem generally does not occur.</p><p>If this problem does occur, please bring detailed logs for feedback.</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>Current hooked Member is not a Method</p></div><p><strong>Abnormal</strong></p><p>Calling the <code>method</code> variable in <code>HookParam</code> but not getting the method instance of the current instance.</p><blockquote><p>The following example</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;">// This variable is called</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>Solution</strong></p><p>Please confirm whether the method of your Hook is a constructor or a common method and use the method of the corresponding type to obtain the specified instance.</p><p>If you do not know the type of the bytecode, you can directly use <code>member</code> to obtain it.</p><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>Current hooked Member is not a Constructor</p></div><p><strong>Abnormal</strong></p><p>A method instance for calling a <code>constructor</code> variable in a <code>HookParam</code> but not getting the current instance.</p><blockquote><p>The following example</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;">// This variable is called</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>Solution</strong></p><p>Please confirm whether the method of your Hook is a common method or a constructor method and use the method of the corresponding type to obtain the specified instance.</p><p>If you do not know the type of the bytecode, you can directly use <code>member</code> to obtain it.</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>HookParam instance cannot cast to <strong>TYPE</strong></p></div><p><strong>Abnormal</strong></p><p>Invoking the <code>instance</code> method in a <code>HookParam</code> specifies the wrong type.</p><blockquote><p>The following example</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;">// The type is cast to Activity</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// But assumes the current instance&#39;s type is not this type</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 class="line-number"></div></div></div><p><strong>Solution</strong></p><p>Please confirm the correct type of the current Hook instance and refill the type in the generic.</p><p>If you are not sure, please use <code>Any</code> or directly use the <code>instance</code> variable.</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>HookParam Method args is empty, mabe not has args</p></div><p><strong>Abnormal</strong></p><p>The <code>ArgsModifyer.set</code> method is called in <code>HookParam</code> but the method parameter array for the current instance is empty.</p><blockquote><p>The following example</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;">// This method is called</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>Solution</strong></p><p>Please make sure that the number of method parameters of the target method and constructor of your Hook is not empty, otherwise you cannot use this function.</p><h6 id="exception-68" tabindex="-1"><a class="header-anchor" href="#exception-68" 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>Abnormal</strong></p><p>Calling the <code>ArgsModifyer.set</code> method in <code>HookParam</code> specifies an array number beyond the subscript of the method parameter.</p><blockquote><p>The following example</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;">// The subscript starts from 0</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// Assuming the original parameter subscript is 5, but fill in 6 here</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 class="line-number"></div></div></div><p><strong>Solution</strong></p><p>Please confirm the target method of your Hook, the number of method parameters of the constructor, and reset the array subscript.</p><h6 id="exception-69" tabindex="-1"><a class="header-anchor" href="#exception-69" 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>Abnormal</strong></p><p>The <code>moduleAppResources</code> variable was called in <code>PackageParam</code> but the instance object could not be obtained.</p><blockquote><p>The following example</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;">// This variable is called</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>Solution</strong></p><p>This situation hardly exists, unless there is a problem with the target Hook Framework itself.</p><p>If this problem does occur, please provide feedback with detailed logs.</p><h6 id="exception-70" tabindex="-1"><a class="header-anchor" href="#exception-70" 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>Abnormal</strong></p><p>All <code>Class</code> were not found when creating indeterminate <code>Class</code> objects using <code>VariousClass</code>.</p><p><strong>Solution</strong></p><p>After checking whether there is a matching <code>Class</code> in the Host App of the current Hook, try again.</p><h6 id="exception-71" tabindex="-1"><a class="header-anchor" href="#exception-71" 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>Abnormal</strong></p><p>The <code>instanceClass</code> variable is called in the <code>hook</code> method body other than the <code>onPrepareHook</code> method and the <code>Class</code> of the current Hook does not exist.</p><blockquote><p>The following example</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;">// The possible case is that the instanceClass variable</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// Who is called in the body of the non-onPrepareHook method to print the log</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 class="line-number"></div></div></div><p><strong>Solution</strong></p><p>Using <code>instanceClass</code> directly in <code>hook</code> is very dangerous, if the Class does not exist, it will directly cause the Hook process to &quot;die&quot;.</p><p>For details, please refer to <a href="../guide/example#status-monitor">Status Monitor</a>.</p><h6 id="exception-72" tabindex="-1"><a class="header-anchor" href="#exception-72" 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>Abnormal</strong></p><p><code>currentView</code> was called in the layout hook callback but no instance object was obtained.</p><blockquote><p>The following example</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;">// This variable is called</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>Solution</strong></p><p>This situation basically does not exist, unless the current <code>Activity</code> of the Host App has been destroyed or there is a problem with the Hook Framework itself.</p><h6 id="exception-73" tabindex="-1"><a class="header-anchor" href="#exception-73" 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>Abnormal</strong></p><p><code>resources</code> was called in <code>YukiResForwarder</code> but no instance object was obtained.</p><blockquote><p>The following example</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;">// This variable is called</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>Solution</strong></p><p>This basically doesn&#39;t exist unless there is a problem with the Hook Framework itself.</p><h6 id="exception-74" tabindex="-1"><a class="header-anchor" href="#exception-74" 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>Abnormal</strong></p><p>The empty <code>param</code> method is preserved when looking up methods, constructors.</p><blockquote><p>The following example</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;">// No parameters are filled in parentheses</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>Solution</strong></p><p>To identify this method, the constructor has no parameters, you can have a setter method as follows.</p><p>The first way, set <code>emptyParam</code> (recommended)</p><blockquote><p>The following example</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>The second way, set <code>paramCount = 0</code></p><blockquote><p>The following example</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-75" tabindex="-1"><a class="header-anchor" href="#exception-75" 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>Abnormal</strong></p><p>The core Hook functionality of <code>YukiHookAPI</code> is broken.</p><p><strong>Solution</strong></p><p>This situation basically does not exist.</p><p>If the above problem occurs, after confirming that the problem is not in your own code, you can submit a log for feedback.</p><h6 id="exception-76" tabindex="-1"><a class="header-anchor" href="#exception-76" 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>Abnormal</strong></p><p>Called repeatedly when using the <code>applyModuleTheme</code> method in the <code>Context</code>.</p><blockquote><p>The following example</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;">// Assume this is the current Context object</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>Solution</strong></p><p>The <code>ModuleContextThemeWrapper</code> can only be created once in the <code>Context</code>, please check the code for loop call problems.</p><h6 id="exception-77" tabindex="-1"><a class="header-anchor" href="#exception-77" 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>Abnormal</strong></p><p>The <code>DexClassFinder</code> cache function <code>searchClass(name = ...)</code> is used in the System Framework (&quot;android&quot;) Host App.</p><blockquote><p>The following example</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>Solution</strong></p><p>Since the cache will store the found <code>Class</code> name in <code>SharedPreferences</code>, but the data directory does not exist in the System Framework, so please do not use this function in the System Framework.</p><h6 id="exception-78" tabindex="-1"><a class="header-anchor" href="#exception-78" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Target Class type cannot cast to <strong>TYPE</strong></p></div><p><strong>Abnormal</strong></p><p>Wrong type declared when converting string class name to target <code>Class</code> using <code>Class.toClass</code>, <code>Class.toClassOrNull</code>, <code>GenericClass.argument</code> methods.</p><p>The following uses the <code>Class.toClass</code> method as an example.</p><blockquote><p>The following example</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;">// Assume the target type is Activity but it was wrongly cast to WrongClass type</span></span>
<span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> clazz </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;android.app.Activity&quot;</span><span style="color:#ADBAC7;">.toClass</span><span style="color:#F47067;">&lt;</span><span style="color:#F69D50;">WrongClass</span><span style="color:#F47067;">&gt;</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>Solution</strong></p><blockquote><p>The following example</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;Solution 1&gt; Fill in the correct type</span></span>
<span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> clazz1 </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;android.app.Activity&quot;</span><span style="color:#ADBAC7;">.toClass</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:#768390;">// &lt;Solution 2&gt; Do not fill in the generic declaration</span></span>
<span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> clazz2 </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;android.app.Activity&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 class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Please ensure that the generic type declared after executing the method is the specified target <code>Class</code> type, and you do not need to fill in the generic declaration if the target type is not sure.</p>`,647),t=[l];function i(p,c){return s(),n("div",null,t)}const d=e(a,[["render",i],["__file","api-exception.html.vue"]]);export{d as default};
