import{_ as s,o,c as a,a as n}from"./app.f643a53b.js";const e={},l=n(`<h1 id="packageparam-class" tabindex="-1"><a class="header-anchor" href="#packageparam-class" aria-hidden="true">#</a> PackageParam <span class="symbol">- class</span></h1><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">open</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">class</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">PackageParam</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">internal</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">constructor</span><span style="color:#ADBAC7;">(</span><span style="color:#F47067;">internal</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">var</span><span style="color:#ADBAC7;"> wrapper</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">PackageParamWrapper?</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0</code> <code>\u6DFB\u52A0</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u88C5\u8F7D Hook \u7684\u76EE\u6807 APP \u5165\u53E3\u5BF9\u8C61\u5B9E\u73B0\u7C7B\u3002</p></blockquote><h2 id="appclassloader-field" tabindex="-1"><a class="header-anchor" href="#appclassloader-field" aria-hidden="true">#</a> appClassLoader <span class="symbol">- field</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">var</span><span style="color:#ADBAC7;"> appClassLoader\uFF1A</span><span style="color:#F69D50;">ClassLoader</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0</code> <code>\u6DFB\u52A0</code></p><p><code>v1.1.5</code> <code>\u4FEE\u6539</code></p><p>\u53EF\u4EE5\u52A8\u6001\u4FEE\u6539\u6B64\u53D8\u91CF\u7684\u503C</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u83B7\u53D6\u3001\u8BBE\u7F6E\u5F53\u524D Hook APP \u7684 <code>ClassLoader</code>\u3002</p></blockquote><p>\u4F60\u53EF\u4EE5\u5728\u8FD9\u91CC\u624B\u52A8\u8BBE\u7F6E\u5F53\u524D Hook APP \u7684 <code>ClassLoader</code>\uFF0C\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u4F1A\u81EA\u52A8\u83B7\u53D6\u3002</p><div class="custom-container danger"><p class="custom-container-title">\u7279\u522B\u6CE8\u610F</p><p>\u5982\u679C\u8BBE\u7F6E\u4E86\u9519\u8BEF\u6216\u65E0\u6548\u7684 <strong>ClassLoader</strong> \u4F1A\u9020\u6210\u529F\u80FD\u5F02\u5E38\uFF0C\u8BF7\u8C28\u614E\u64CD\u4F5C\u3002</p></div><h2 id="appinfo-field" tabindex="-1"><a class="header-anchor" href="#appinfo-field" aria-hidden="true">#</a> appInfo <span class="symbol">- field</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> appInfo</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ApplicationInfo</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0</code> <code>\u6DFB\u52A0</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u83B7\u53D6\u5F53\u524D Hook APP \u7684 <code>ApplicationInfo</code>\u3002</p></blockquote><h2 id="appuserid-field" tabindex="-1"><a class="header-anchor" href="#appuserid-field" aria-hidden="true">#</a> appUserId <span class="symbol">- field</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> appUserId</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Int</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.1.0</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u83B7\u53D6\u5F53\u524D Hook APP \u7684\u7528\u6237 ID\u3002</p></blockquote><p>\u673A\u4E3B\u4E3A <code>0</code>\uFF0C\u5E94\u7528\u53CC\u5F00 (\u5206\u8EAB) \u6216\u5DE5\u4F5C\u8D44\u6599\u56E0\u7CFB\u7EDF\u73AF\u5883\u4E0D\u540C ID \u4E5F\u5404\u4E0D\u76F8\u540C\u3002</p><h2 id="appcontext-field" tabindex="-1"><a class="header-anchor" href="#appcontext-field" aria-hidden="true">#</a> appContext <span class="symbol">- field</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> appContext</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Application?</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.72</code> <code>\u65B0\u589E</code></p><p><code>v1.1.0</code> <code>\u4FEE\u6539</code></p><p>\u52A0\u5165\u53EF\u7A7A\u7C7B\u578B (\u7A7A\u5B89\u5168)</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u83B7\u53D6\u5F53\u524D Hook APP \u7684 <code>Application</code>\u3002</p></blockquote><div class="custom-container danger"><p class="custom-container-title">\u7279\u522B\u6CE8\u610F</p><p>\u9996\u6B21\u88C5\u8F7D\u53EF\u80FD\u662F\u7A7A\u7684\uFF0C\u8BF7\u5EF6\u8FDF\u4E00\u6BB5\u65F6\u95F4\u518D\u83B7\u53D6\u6216\u4F7F\u7528 <strong>onAppLifecycle</strong> \u76D1\u542C\u6765\u5B8C\u6210\u3002</p></div><h2 id="appresources-field" tabindex="-1"><a class="header-anchor" href="#appresources-field" aria-hidden="true">#</a> appResources <span class="symbol">- field</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> appResources\uFF1A</span><span style="color:#F69D50;">Resources?</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.80</code> <code>\u65B0\u589E</code></p><p><code>v1.1.0</code> <code>\u4FEE\u6539</code></p><p>\u52A0\u5165\u53EF\u7A7A\u7C7B\u578B (\u7A7A\u5B89\u5168)</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u83B7\u53D6\u5F53\u524D Hook APP \u7684 Resources\u3002</p></blockquote><div class="custom-container danger"><p class="custom-container-title">\u7279\u522B\u6CE8\u610F</p><p>\u4F60\u53EA\u80FD\u5728 <strong>HookResources.hook</strong> \u65B9\u6CD5\u4F53\u5185\u6216 <strong>appContext</strong> \u88C5\u8F7D\u5B8C\u6BD5\u65F6\u8FDB\u884C\u8C03\u7528\u3002</p></div><h2 id="systemcontext-field" tabindex="-1"><a class="header-anchor" href="#systemcontext-field" aria-hidden="true">#</a> systemContext <span class="symbol">- field</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> systemContext</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Context</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.1.0</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u83B7\u53D6\u5F53\u524D\u7CFB\u7EDF\u6846\u67B6\u7684 <code>Context</code>\u3002</p></blockquote><h2 id="processname-field" tabindex="-1"><a class="header-anchor" href="#processname-field" aria-hidden="true">#</a> processName <span class="symbol">- field</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> processName</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0</code> <code>\u6DFB\u52A0</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u83B7\u53D6\u5F53\u524D Hook APP \u7684\u8FDB\u7A0B\u540D\u79F0\u3002</p></blockquote><h2 id="packagename-field" tabindex="-1"><a class="header-anchor" href="#packagename-field" aria-hidden="true">#</a> packageName <span class="symbol">- field</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> packageName</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0</code> <code>\u6DFB\u52A0</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u83B7\u53D6\u5F53\u524D Hook APP \u7684\u5305\u540D\u3002</p></blockquote><h2 id="isfirstapplication-field" tabindex="-1"><a class="header-anchor" href="#isfirstapplication-field" aria-hidden="true">#</a> isFirstApplication <span class="symbol">- field</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> isFirstApplication</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0</code> <code>\u6DFB\u52A0</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u83B7\u53D6\u5F53\u524D Hook APP \u662F\u5426\u4E3A\u7B2C\u4E00\u4E2A <code>Application</code>\u3002</p></blockquote><h2 id="mainprocessname-field" tabindex="-1"><a class="header-anchor" href="#mainprocessname-field" aria-hidden="true">#</a> mainProcessName <span class="symbol">- field</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> mainProcessName</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.70</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u83B7\u53D6\u5F53\u524D Hook APP \u7684\u4E3B\u8FDB\u7A0B\u540D\u79F0\u3002</p></blockquote><p>\u5176\u5BF9\u5E94\u7684\u5C31\u662F <code>packageName</code>\u3002</p><h2 id="moduleappfilepath-field" tabindex="-1"><a class="header-anchor" href="#moduleappfilepath-field" aria-hidden="true">#</a> moduleAppFilePath <span class="symbol">- field</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> moduleAppFilePath</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.80</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u83B7\u53D6\u5F53\u524D Xposed \u6A21\u5757\u81EA\u8EAB APK \u6587\u4EF6\u8DEF\u5F84\u3002</p></blockquote><div class="custom-container danger"><p class="custom-container-title">\u7279\u522B\u6CE8\u610F</p><p>\u4F5C\u4E3A Hook API \u88C5\u8F7D\u65F6\u65E0\u6CD5\u4F7F\u7528\uFF0C\u4F1A\u83B7\u53D6\u5230\u7A7A\u5B57\u7B26\u4E32\u3002</p></div><h2 id="moduleappresources-field" tabindex="-1"><a class="header-anchor" href="#moduleappresources-field" aria-hidden="true">#</a> moduleAppResources <span class="symbol">- field</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> moduleAppResources</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiModuleResources</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.80</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u83B7\u53D6\u5F53\u524D Xposed \u6A21\u5757\u81EA\u8EAB <code>Resources</code>\u3002</p></blockquote><div class="custom-container danger"><p class="custom-container-title">\u7279\u522B\u6CE8\u610F</p><p>\u4F5C\u4E3A Hook API \u6216\u4E0D\u652F\u6301\u7684 Hook Framework \u88C5\u8F7D\u65F6\u65E0\u6CD5\u4F7F\u7528\uFF0C\u4F1A\u629B\u51FA\u5F02\u5E38\u3002</p></div><h2 id="prefs-field" tabindex="-1"><a class="header-anchor" href="#prefs-field" aria-hidden="true">#</a> prefs <span class="symbol">- field</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> prefs</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiHookPrefsBridge</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0</code> <code>\u6DFB\u52A0</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u521B\u5EFA <code>YukiHookPrefsBridge</code> \u5BF9\u8C61\u3002</p></blockquote><div class="custom-container danger"><p class="custom-container-title">\u7279\u522B\u6CE8\u610F</p><p>\u4F5C\u4E3A Hook API \u88C5\u8F7D\u65F6\u65E0\u6CD5\u4F7F\u7528\uFF0C\u4F1A\u629B\u51FA\u5F02\u5E38\u3002</p></div><h2 id="prefs-method" tabindex="-1"><a class="header-anchor" href="#prefs-method" aria-hidden="true">#</a> prefs <span class="symbol">- method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">prefs</span><span style="color:#ADBAC7;">(name</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span><span style="color:#ADBAC7;">)</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiHookPrefsBridge</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0</code> <code>\u6DFB\u52A0</code></p><p><code>v1.0.80</code> <code>\u4FEE\u6539</code></p><p>\u5C06\u65B9\u6CD5\u4F53\u8FDB\u884C inline</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u521B\u5EFA <code>YukiHookPrefsBridge</code> \u5BF9\u8C61\u3002</p></blockquote><p>\u4F60\u53EF\u4EE5\u901A\u8FC7 <code>name</code> \u6765\u81EA\u5B9A\u4E49 Sp \u5B58\u50A8\u7684\u540D\u79F0\u3002</p><div class="custom-container danger"><p class="custom-container-title">\u7279\u522B\u6CE8\u610F</p><p>\u4F5C\u4E3A Hook API \u88C5\u8F7D\u65F6\u65E0\u6CD5\u4F7F\u7528\uFF0C\u4F1A\u629B\u51FA\u5F02\u5E38\u3002</p></div><h2 id="datachannel-field" tabindex="-1"><a class="header-anchor" href="#datachannel-field" aria-hidden="true">#</a> dataChannel <span class="symbol">- field</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> dataChannel</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiHookDataChannel</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">NameSpace</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.88</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u83B7\u53D6 <code>YukiHookDataChannel</code> \u5BF9\u8C61\u3002</p></blockquote><div class="custom-container danger"><p class="custom-container-title">\u7279\u522B\u6CE8\u610F</p><p>\u4F5C\u4E3A Hook API \u88C5\u8F7D\u65F6\u65E0\u6CD5\u4F7F\u7528\uFF0C\u4F1A\u629B\u51FA\u5F02\u5E38\u3002</p></div><h2 id="resources-method" tabindex="-1"><a class="header-anchor" href="#resources-method" aria-hidden="true">#</a> resources <span class="symbol">- method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">resources</span><span style="color:#ADBAC7;">()</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">HookResources</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.80</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u83B7\u5F97\u5F53\u524D Hook APP \u7684 <code>YukiResources</code> \u5BF9\u8C61\u3002</p></blockquote><p>\u8BF7\u8C03\u7528 <code>HookResources.hook</code> \u65B9\u6CD5\u5F00\u59CB Hook\u3002</p><h2 id="refreshmoduleappresources-method" tabindex="-1"><a class="header-anchor" href="#refreshmoduleappresources-method" aria-hidden="true">#</a> refreshModuleAppResources <span class="symbol">- method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">refreshModuleAppResources</span><span style="color:#ADBAC7;">()</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.87</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u5237\u65B0\u5F53\u524D Xposed \u6A21\u5757\u81EA\u8EAB <code>Resources</code>\u3002</p></blockquote><h2 id="onapplifecycle-method" tabindex="-1"><a class="header-anchor" href="#onapplifecycle-method" aria-hidden="true">#</a> onAppLifecycle <span class="symbol">- method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">inline</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">onAppLifecycle</span><span style="color:#ADBAC7;">(isOnFailureThrowToApp</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span><span style="color:#ADBAC7;">, initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">AppLifecycle</span><span style="color:#ADBAC7;">.() </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.88</code> <code>\u65B0\u589E</code></p><p><code>v1.1.5</code> <code>\u4FEE\u6539</code></p><p>\u65B0\u589E <code>isOnFailureThrowToApp</code> \u53C2\u6570\uFF0C\u53EF\u9009\u62E9\u5C06\u5F02\u5E38\u5728 (Xposed) \u5BBF\u4E3B\u73AF\u5883\u6253\u5370\u800C\u4E0D\u662F\u629B\u51FA\u7ED9\u5BBF\u4E3B</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u76D1\u542C\u5F53\u524D Hook APP \u751F\u547D\u5468\u671F\u88C5\u8F7D\u4E8B\u4EF6\u3002</p></blockquote><div class="custom-container warning"><p class="custom-container-title">\u6CE8\u610F</p><p>\u5728 <strong>loadZygote</strong> \u4E2D\u4E0D\u4F1A\u88AB\u88C5\u8F7D\uFF0C\u4EC5\u4F1A\u5728 <strong>loadSystem</strong>\u3001<strong>loadApp</strong> \u4E2D\u88C5\u8F7D\u3002</p><p>\u4F5C\u4E3A Hook API \u88C5\u8F7D\u65F6\u8BF7\u4F7F\u7528\u539F\u751F\u7684 <strong>Application</strong> \u5B9E\u73B0\u751F\u547D\u5468\u671F\u76D1\u542C\u3002</p></div><h2 id="loadapp-method" tabindex="-1"><a class="header-anchor" href="#loadapp-method" aria-hidden="true">#</a> loadApp <span class="symbol">- method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">inline</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">loadApp</span><span style="color:#ADBAC7;">(name</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span><span style="color:#ADBAC7;">, initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">PackageParam</span><span style="color:#ADBAC7;">.() </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">loadApp</span><span style="color:#ADBAC7;">(name</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span><span style="color:#ADBAC7;">, hooker</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiBaseHooker</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">inline</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">loadApp</span><span style="color:#ADBAC7;">(</span><span style="color:#F47067;">vararg</span><span style="color:#ADBAC7;"> name</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span><span style="color:#ADBAC7;">, initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">PackageParam</span><span style="color:#ADBAC7;">.() </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">loadApp</span><span style="color:#ADBAC7;">(name</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span><span style="color:#ADBAC7;">, </span><span style="color:#F47067;">vararg</span><span style="color:#ADBAC7;"> hooker</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiBaseHooker</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">inline</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">loadApp</span><span style="color:#ADBAC7;">(isExcludeSelf</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span><span style="color:#ADBAC7;">, initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">PackageParam</span><span style="color:#ADBAC7;">.() </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">loadApp</span><span style="color:#ADBAC7;">(isExcludeSelf</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span><span style="color:#ADBAC7;">, hooker</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiBaseHooker</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">loadApp</span><span style="color:#ADBAC7;">(isExcludeSelf</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span><span style="color:#ADBAC7;">, </span><span style="color:#F47067;">vararg</span><span style="color:#ADBAC7;"> hooker</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiBaseHooker</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0</code> <code>\u6DFB\u52A0</code></p><p><code>v1.0.80</code> <code>\u4FEE\u6539</code></p><p>\u5C06\u65B9\u6CD5\u4F53\u8FDB\u884C inline</p><p><code>v1.1.4</code> <code>\u4FEE\u6539</code></p><p>\u65B0\u589E\u4E24\u4E2A\u65B9\u6CD5\uFF0C\u53EF\u4EE5\u540C\u65F6\u88C5\u8F7D\u591A\u4E2A APP \u4E0E\u5B50 Hooker</p><p><code>v1.1.5</code> <code>\u4FEE\u6539</code></p><p>\u65B0\u589E\u4E09\u4E2A\u65B9\u6CD5\uFF0C\u53EF\u4EE5\u4F7F\u7528\u53C2\u6570 <code>isExcludeSelf</code> \u6392\u9664\u6A21\u5757\u81EA\u8EAB</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u88C5\u8F7D\u5E76 Hook \u6307\u5B9A\u3001\u5168\u90E8\u5305\u540D\u7684 APP\u3002</p></blockquote><p><code>name</code> \u4E3A APP \u7684\u5305\u540D\uFF0C\u540E\u65B9\u7684\u4E24\u4E2A\u53C2\u6570\u4E00\u4E2A\u53EF\u4F5C\u4E3A <code>lambda</code> \u65B9\u6CD5\u4F53\u4F7F\u7528\uFF0C\u4E00\u4E2A\u53EF\u4EE5\u76F4\u63A5\u88C5\u8F7D\u5B50 Hooker\u3002</p><p>\u88C5\u8F7D\u5E76 Hook \u6307\u5B9A\u3001\u5168\u90E8\u5305\u540D\u7684 APP\u3002</p><p>\u82E5\u8981\u88C5\u8F7D APP Zygote \u4E8B\u4EF6\uFF0C\u8BF7\u4F7F\u7528 <code>loadZygote</code>\u3002</p><p>\u82E5\u8981 Hook \u7CFB\u7EDF\u6846\u67B6\uFF0C\u8BF7\u4F7F\u7528 <code>loadSystem</code>\u3002</p><p><strong>\u529F\u80FD\u793A\u4F8B</strong></p><p>\u4F60\u53EF\u4EE5\u4F7F\u7528 <code>loadApp</code> \u7684 <code>lambda</code> \u65B9\u6CD5\u4F53\u5F62\u5F0F\u6216\u76F4\u63A5\u88C5\u8F7D\u4E00\u4E2A Hooker\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// \u4F7F\u7528 lambda</span></span>
<span class="line"><span style="color:#ADBAC7;">loadApp(name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;com.example.test&quot;</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:#768390;">// \u4F7F\u7528 Hooker</span></span>
<span class="line"><span style="color:#ADBAC7;">loadApp(name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;com.example.test&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#F69D50;">CustomHooker</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 class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>\u82E5\u4E0D\u6307\u5B9A <code>name</code> \u53C2\u6570\uFF0C\u5219\u6B64\u65B9\u6CD5\u4F53\u9ED8\u8BA4\u4F1A\u8FC7\u6EE4\u5F53\u524D\u7CFB\u7EDF\u4E2D\u5168\u90E8\u53EF\u88AB Hook \u7684 APP\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// \u4F7F\u7528 lambda</span></span>
<span class="line"><span style="color:#ADBAC7;">loadApp {</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:#768390;">// \u4F7F\u7528 Hooker</span></span>
<span class="line"><span style="color:#ADBAC7;">loadApp(hooker </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">CustomHooker</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 class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>\u82E5\u8981\u5728\u5168\u90E8\u53EF\u88AB Hook \u7684 APP \u4E2D\u8FC7\u6EE4\u6389\u6A21\u5757\u81EA\u8EAB\uFF0C\u4F60\u53EA\u9700\u52A0\u5165 <code>isExcludeSelf = true</code>\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// \u4F7F\u7528 lambda</span></span>
<span class="line"><span style="color:#ADBAC7;">loadApp(isExcludeSelf </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">true</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:#768390;">// \u4F7F\u7528 Hooker</span></span>
<span class="line"><span style="color:#ADBAC7;">loadApp(isExcludeSelf </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">true</span><span style="color:#ADBAC7;">, hooker </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">CustomHooker</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 class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>\u82E5\u60F3\u8981\u540C\u65F6\u88C5\u8F7D\u591A\u4E2A\u9700\u8981 Hook \u7684 APP\uFF0C\u53EF\u4EE5\u76F4\u63A5\u4F7F\u7528\u5982\u4E0B\u65B9\u5F0F\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// \u540C\u65F6\u88C5\u8F7D\u591A\u4E2A\u9700\u8981 Hook \u7684 APP</span></span>
<span class="line"><span style="color:#ADBAC7;">loadApp(</span><span style="color:#96D0FF;">&quot;com.example.test&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;com.example.next&quot;</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></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>\u82E5\u60F3\u8981\u540C\u65F6\u88C5\u8F7D\u591A\u4E2A\u5B50 Hooker\uFF0C\u53EF\u4EE5\u76F4\u63A5\u4F7F\u7528\u5982\u4E0B\u65B9\u5F0F\uFF0C\u4F46\u6B64\u65F6\u53EA\u80FD\u6307\u5B9A\u4E00\u4E2A\u9700\u8981 Hook \u7684 APP\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// \u540C\u65F6\u88C5\u8F7D\u591A\u4E2A\u5B50 Hooker</span></span>
<span class="line"><span style="color:#ADBAC7;">loadApp(</span><span style="color:#96D0FF;">&quot;com.example.test&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#F69D50;">CustomHooker1</span><span style="color:#ADBAC7;">, </span><span style="color:#F69D50;">CustomHooker2</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><h2 id="loadzygote-method" tabindex="-1"><a class="header-anchor" href="#loadzygote-method" aria-hidden="true">#</a> loadZygote <span class="symbol">- method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">inline</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">loadZygote</span><span style="color:#ADBAC7;">(initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">PackageParam</span><span style="color:#ADBAC7;">.() </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">loadZygote</span><span style="color:#ADBAC7;">(hooker</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiBaseHooker</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">loadZygote</span><span style="color:#ADBAC7;">(</span><span style="color:#F47067;">vararg</span><span style="color:#ADBAC7;"> hooker</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiBaseHooker</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.80</code> <code>\u65B0\u589E</code></p><p><code>v1.1.4</code> <code>\u4FEE\u6539</code></p><p>\u65B0\u589E\u4E00\u4E2A\u65B9\u6CD5\uFF0C\u53EF\u4EE5\u540C\u65F6\u88C5\u8F7D\u591A\u4E2A\u5B50 Hooker</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u88C5\u8F7D APP Zygote \u4E8B\u4EF6\u3002</p></blockquote><p>\u65B9\u6CD5\u4E2D\u7684\u4E24\u4E2A\u53C2\u6570\u4E00\u4E2A\u53EF\u4F5C\u4E3A <code>lambda</code> \u65B9\u6CD5\u4F53\u4F7F\u7528\uFF0C\u4E00\u4E2A\u53EF\u4EE5\u76F4\u63A5\u88C5\u8F7D\u5B50 Hooker\u3002</p><h2 id="loadsystem-method" tabindex="-1"><a class="header-anchor" href="#loadsystem-method" aria-hidden="true">#</a> loadSystem <span class="symbol">- method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">inline</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">loadSystem</span><span style="color:#ADBAC7;">(initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">PackageParam</span><span style="color:#ADBAC7;">.() </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">loadSystem</span><span style="color:#ADBAC7;">(hooker</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiBaseHooker</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">loadSystem</span><span style="color:#ADBAC7;">(</span><span style="color:#F47067;">vararg</span><span style="color:#ADBAC7;"> hooker</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiBaseHooker</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.82</code> <code>\u65B0\u589E</code></p><p><code>v1.1.4</code> <code>\u4FEE\u6539</code></p><p>\u65B0\u589E\u4E00\u4E2A\u65B9\u6CD5\uFF0C\u53EF\u4EE5\u540C\u65F6\u88C5\u8F7D\u591A\u4E2A\u5B50 Hooker</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u88C5\u8F7D\u5E76 Hook \u7CFB\u7EDF\u6846\u67B6\u3002</p></blockquote><p>\u65B9\u6CD5\u4E2D\u7684\u4E24\u4E2A\u53C2\u6570\u4E00\u4E2A\u53EF\u4F5C\u4E3A <code>lambda</code> \u65B9\u6CD5\u4F53\u4F7F\u7528\uFF0C\u4E00\u4E2A\u53EF\u4EE5\u76F4\u63A5\u88C5\u8F7D\u5B50 Hooker\u3002</p><h2 id="withprocess-method" tabindex="-1"><a class="header-anchor" href="#withprocess-method" aria-hidden="true">#</a> withProcess <span class="symbol">- method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">inline</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">withProcess</span><span style="color:#ADBAC7;">(name</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span><span style="color:#ADBAC7;">, initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">PackageParam</span><span style="color:#ADBAC7;">.() </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">withProcess</span><span style="color:#ADBAC7;">(name</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span><span style="color:#ADBAC7;">, hooker</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiBaseHooker</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">withProcess</span><span style="color:#ADBAC7;">(</span><span style="color:#F47067;">vararg</span><span style="color:#ADBAC7;"> name</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span><span style="color:#ADBAC7;">, hooker</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiBaseHooker</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">withProcess</span><span style="color:#ADBAC7;">(name</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span><span style="color:#ADBAC7;">, </span><span style="color:#F47067;">vararg</span><span style="color:#ADBAC7;"> hooker</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiBaseHooker</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.70</code> <code>\u65B0\u589E</code></p><p><code>v1.1.4</code> <code>\u4FEE\u6539</code></p><p>\u65B0\u589E\u4E24\u4E2A\u65B9\u6CD5\uFF0C\u53EF\u4EE5\u540C\u65F6\u88C5\u8F7D\u591A\u4E2A\u8FDB\u7A0B\u4E0E\u5B50 Hooker</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u88C5\u8F7D\u5E76 Hook APP \u7684\u6307\u5B9A\u8FDB\u7A0B\u3002</p></blockquote><p><code>name</code> \u4E3A APP \u7684\u8FDB\u7A0B\u540D\u79F0\uFF0C\u540E\u65B9\u7684\u4E24\u4E2A\u53C2\u6570\u4E00\u4E2A\u53EF\u4F5C\u4E3A <code>lambda</code> \u65B9\u6CD5\u4F53\u4F7F\u7528\uFF0C\u4E00\u4E2A\u53EF\u4EE5\u76F4\u63A5\u88C5\u8F7D\u5B50 Hooker\u3002</p><h2 id="loadhooker-method" tabindex="-1"><a class="header-anchor" href="#loadhooker-method" aria-hidden="true">#</a> loadHooker <span class="symbol">- method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">loadHooker</span><span style="color:#ADBAC7;">(hooker</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiBaseHooker</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0</code> <code>\u6DFB\u52A0</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u88C5\u8F7D Hook \u5B50\u7C7B\u3002</p></blockquote><p>\u4F60\u53EF\u4EE5\u586B\u5165 <code>hooker</code> \u5728 Hooker \u4E2D\u7EE7\u7EED\u88C5\u8F7D Hooker\u3002</p><h2 id="searchclass-method" tabindex="-1"><a class="header-anchor" href="#searchclass-method" aria-hidden="true">#</a> searchClass <span class="symbol">- method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">inline</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">searchClass</span><span style="color:#ADBAC7;">(name</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span><span style="color:#ADBAC7;">, async</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span><span style="color:#ADBAC7;">, initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ClassConditions</span><span style="color:#ADBAC7;">)</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">DexClassFinder</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">Result</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.1.0</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u901A\u8FC7 <code>appClassLoader</code> \u6309\u6307\u5B9A\u6761\u4EF6\u67E5\u627E\u5E76\u5F97\u5230\u5F53\u524D Hook APP <strong>Dex</strong> \u4E2D\u7684 <code>Class</code>\u3002</p></blockquote><div class="custom-container danger"><p class="custom-container-title">\u7279\u522B\u6CE8\u610F</p><p>\u6B64\u65B9\u6CD5\u5728 <strong>Class</strong> \u6570\u91CF\u8FC7\u591A\u53CA\u67E5\u627E\u6761\u4EF6\u590D\u6742\u65F6\u4F1A\u975E\u5E38\u8017\u65F6\u3002</p><p>\u5EFA\u8BAE\u542F\u7528 <strong>async</strong> \u6216\u8BBE\u7F6E <strong>name</strong> \u53C2\u6570\uFF0C<strong>name</strong> \u53C2\u6570\u5C06\u5728 Hook APP (\u5BBF\u4E3B) \u4E0D\u540C\u7248\u672C\u4E2D\u81EA\u52A8\u8FDB\u884C\u672C\u5730\u7F13\u5B58\u4EE5\u63D0\u5347\u6548\u7387\u3002</p><p>\u6B64\u529F\u80FD\u5C1A\u5728\u8BD5\u9A8C\u9636\u6BB5\uFF0C\u6027\u80FD\u4E0E\u7A33\u5B9A\u6027\u53EF\u80FD\u4ECD\u7136\u5B58\u5728\u95EE\u9898\uFF0C\u4F7F\u7528\u8FC7\u7A0B\u9047\u5230\u95EE\u9898\u8BF7\u5411\u6211\u4EEC\u62A5\u544A\u5E76\u5E2E\u52A9\u6211\u4EEC\u6539\u8FDB\u3002</p></div><h2 class="deprecated">String+VariousClass.clazz - i-ext-field</h2><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0</code> <code>\u6DFB\u52A0</code></p><p><code>v1.1.0</code> <code>\u4F5C\u5E9F</code></p><p>\u8BF7\u8F6C\u79FB\u5230 <code>toClass(...)</code> \u65B9\u6CD5</p><h2 class="deprecated">String.hasClass - i-ext-field</h2><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0</code> <code>\u6DFB\u52A0</code></p><p><code>v1.1.0</code> <code>\u4F5C\u5E9F</code></p><p>\u8BF7\u8F6C\u79FB\u5230 <code>hasClass(...)</code> \u65B9\u6CD5</p><h2 id="string-variousclass-toclass-i-ext-method" tabindex="-1"><a class="header-anchor" href="#string-variousclass-toclass-i-ext-method" aria-hidden="true">#</a> String+VariousClass.toClass <span class="symbol">- i-ext-method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> String.</span><span style="color:#DCBDFB;">toClass</span><span style="color:#ADBAC7;">(loader</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;">, initialize</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span><span style="color:#ADBAC7;">)</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Class</span><span style="color:#F47067;">&lt;*&gt;</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">inline</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">&lt;</span><span style="color:#DCBDFB;">reified</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">T</span><span style="color:#F47067;">&gt;</span><span style="color:#ADBAC7;"> String.</span><span style="color:#DCBDFB;">toClass</span><span style="color:#ADBAC7;">(loader</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;">, initialize</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span><span style="color:#ADBAC7;">)</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Class</span><span style="color:#F47067;">&lt;</span><span style="color:#F69D50;">T</span><span style="color:#F47067;">&gt;</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> VariousClass.</span><span style="color:#DCBDFB;">toClass</span><span style="color:#ADBAC7;">(loader</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;">, initialize</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span><span style="color:#ADBAC7;">)</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Class</span><span style="color:#F47067;">&lt;*&gt;</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.1.0</code> <code>\u65B0\u589E</code></p><p><code>v1.1.5</code> <code>\u4FEE\u6539</code></p><p>\u65B0\u589E\u6CDB\u578B\u8FD4\u56DE\u503C <code>Class&lt;T&gt;</code> \u65B9\u6CD5</p><p>\u65B0\u589E <code>initialize</code> \u53C2\u6570</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u901A\u8FC7\u5B57\u7B26\u4E32\u7C7B\u540D\u3001<code>VariousClass</code> \u8F6C\u6362\u4E3A <code>loader</code> \u4E2D\u7684\u5B9E\u4F53\u7C7B\u3002</p></blockquote><p>\u9ED8\u8BA4\u4F7F\u7528\u5F53\u524D <code>appClassLoader</code> \u88C5\u8F7D\u76EE\u6807 <code>Class</code>\u3002</p><p><strong>\u529F\u80FD\u793A\u4F8B</strong></p><p>\u4F60\u53EF\u4EE5\u8F7B\u677E\u5730\u5C06 <code>String</code> \u7C7B\u578B\u7684 <code>Class</code> \u5305\u540D\u8F6C\u4E3A <code>Class</code> \u5B9E\u4F8B\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass&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>\u4F60\u8FD8\u53EF\u4EE5\u5411 <code>loader</code> \u53C2\u6570\u4F20\u5165\u4F60\u81EA\u5B9A\u4E49\u7684 <code>ClassLoader</code>\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> customClassLoader</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> ... </span><span style="color:#768390;">// \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader</span></span>
<span class="line"><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass&quot;</span><span style="color:#ADBAC7;">.toClass(customClassLoader)</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>\u4F60\u8FD8\u53EF\u4EE5\u6307\u5B9A <code>Class</code> \u7684\u76EE\u6807\u7C7B\u578B\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// \u6307\u5B9A\u7684 DemoClass \u5FC5\u987B\u5B58\u5728\u6216\u4E3A\u53EF\u8BBF\u95EE\u7684 stub</span></span>
<span class="line"><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass&quot;</span><span style="color:#ADBAC7;">.toClass</span><span style="color:#F47067;">&lt;</span><span style="color:#F69D50;">DemoClass</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>\u4F60\u8FD8\u53EF\u4EE5\u8BBE\u7F6E\u5728\u83B7\u53D6\u5230\u8FD9\u4E2A <code>Class</code> \u65F6\u662F\u5426\u81EA\u52A8\u6267\u884C\u5176\u9ED8\u8BA4\u7684\u9759\u6001\u65B9\u6CD5\u5757\uFF0C\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u4E0D\u4F1A\u6267\u884C\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// \u83B7\u53D6\u5E76\u6267\u884C DemoClass \u9ED8\u8BA4\u7684\u9759\u6001\u65B9\u6CD5\u5757</span></span>
<span class="line"><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass&quot;</span><span style="color:#ADBAC7;">.toClass(initialize </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">true</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>\u9ED8\u8BA4\u7684\u9759\u6001\u65B9\u6CD5\u5757\u5728 Java \u4E2D\u4F7F\u7528\u5982\u4E0B\u65B9\u5F0F\u5B9A\u4E49\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-java ext-java"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">public</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">class</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">DemoClass</span><span style="color:#ADBAC7;"> {</span></span>
<span class="line"></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#F47067;">static</span><span style="color:#ADBAC7;"> {</span></span>
<span class="line"><span style="color:#ADBAC7;">        </span><span style="color:#768390;">// \u8FD9\u91CC\u662F\u9759\u6001\u65B9\u6CD5\u5757\u7684\u5185\u5BB9</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;">public</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">DemoClass</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></code></pre></div><p>\u4F60\u8FD8\u53EF\u4EE5\u521B\u5EFA\u4E00\u4E2A <code>VariousClass</code>\uFF0C\u5E76\u8F6C\u6362\u4E3A\u5B9E\u4F53\u7C7B\u3002</p><p><code>VariousClass</code> \u4F1A\u679A\u4E3E\u6240\u6709\u8BBE\u7F6E\u7684 <code>Class</code> \u5E76\u6700\u7EC8\u83B7\u5F97\u7B2C\u4E00\u4E2A\u5B58\u5728\u7684 <code>Class</code>\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F69D50;">VariousClass</span><span style="color:#ADBAC7;">(</span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass1&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass2&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>\u540C\u6837\u5730\uFF0C\u4F60\u8FD8\u53EF\u4EE5\u5411 <code>loader</code> \u53C2\u6570\u4F20\u5165\u4F60\u81EA\u5B9A\u4E49\u7684 <code>ClassLoader</code>\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> customClassLoader</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> ... </span><span style="color:#768390;">// \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader</span></span>
<span class="line"><span style="color:#F69D50;">VariousClass</span><span style="color:#ADBAC7;">(</span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass1&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass2&quot;</span><span style="color:#ADBAC7;">).toClass(customClassLoader)</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><h2 id="string-variousclass-toclassornull-i-ext-method" tabindex="-1"><a class="header-anchor" href="#string-variousclass-toclassornull-i-ext-method" aria-hidden="true">#</a> String+VariousClass.toClassOrNull <span class="symbol">- i-ext-method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> String.</span><span style="color:#DCBDFB;">toClassOrNull</span><span style="color:#ADBAC7;">(loader</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;">, initialize</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span><span style="color:#ADBAC7;">)</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Class</span><span style="color:#F47067;">&lt;*&gt;</span><span style="color:#ADBAC7;">?</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">inline</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">&lt;</span><span style="color:#DCBDFB;">reified</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">T</span><span style="color:#F47067;">&gt;</span><span style="color:#ADBAC7;"> String.</span><span style="color:#DCBDFB;">toClassOrNull</span><span style="color:#ADBAC7;">(loader</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;">, initialize</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span><span style="color:#ADBAC7;">)</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Class</span><span style="color:#F47067;">&lt;</span><span style="color:#F69D50;">T</span><span style="color:#F47067;">&gt;</span><span style="color:#ADBAC7;">?</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> VariousClass.</span><span style="color:#DCBDFB;">toClassOrNull</span><span style="color:#ADBAC7;">(loader</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;">, initialize</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span><span style="color:#ADBAC7;">)</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Class</span><span style="color:#F47067;">&lt;*&gt;</span><span style="color:#ADBAC7;">?</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.1.0</code> <code>\u65B0\u589E</code></p><p><code>v1.1.5</code> <code>\u4FEE\u6539</code></p><p>\u65B0\u589E\u6CDB\u578B\u8FD4\u56DE\u503C <code>Class&lt;T&gt;</code> \u65B9\u6CD5</p><p>\u65B0\u589E <code>initialize</code> \u53C2\u6570</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u901A\u8FC7\u5B57\u7B26\u4E32\u7C7B\u540D\u3001<code>VariousClass</code> \u8F6C\u6362\u4E3A <code>loader</code> \u4E2D\u7684\u5B9E\u4F53\u7C7B\u3002</p></blockquote><p>\u9ED8\u8BA4\u4F7F\u7528\u5F53\u524D <code>appClassLoader</code> \u88C5\u8F7D\u76EE\u6807 <code>Class</code>\u3002</p><p>\u627E\u4E0D\u5230 <code>Class</code> \u4F1A\u8FD4\u56DE <code>null</code>\uFF0C\u4E0D\u4F1A\u629B\u51FA\u5F02\u5E38\u3002</p><p><strong>\u529F\u80FD\u793A\u4F8B</strong></p><p>\u7528\u6CD5\u8BF7\u53C2\u8003 <a href="#string-variousclass-toclass-i-ext-method">String+VariousClass.toClass</a> \u65B9\u6CD5\u3002</p><h2 id="string-hasclass-i-ext-method" tabindex="-1"><a class="header-anchor" href="#string-hasclass-i-ext-method" aria-hidden="true">#</a> String.hasClass <span class="symbol">- i-ext-method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> String.</span><span style="color:#DCBDFB;">hasClass</span><span style="color:#ADBAC7;">(loader</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;">)</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.1.0</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u901A\u8FC7\u5B57\u7B26\u4E32\u7C7B\u540D\u67E5\u627E\u662F\u5426\u5B58\u5728\u3002</p></blockquote><p>\u9ED8\u8BA4\u4F7F\u7528\u5F53\u524D <code>appClassLoader</code> \u88C5\u8F7D\u76EE\u6807 <code>Class</code>\u3002</p><p><strong>\u529F\u80FD\u793A\u4F8B</strong></p><p>\u4F60\u53EF\u4EE5\u8F7B\u677E\u7684\u4F7F\u7528\u6B64\u65B9\u6CD5\u5224\u65AD\u5B57\u7B26\u4E32\u4E2D\u7684\u7C7B\u662F\u5426\u5B58\u5728\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">if</span><span style="color:#ADBAC7;">(</span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass&quot;</span><span style="color:#ADBAC7;">.hasClass()) {</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></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>\u4F60\u8FD8\u53EF\u4EE5\u81EA\u5B9A\u4E49\u5176\u4E2D\u7684 <code>loader</code> \u53C2\u6570\uFF0C\u9ED8\u8BA4\u4E3A <code>appClassLoader</code>\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> customClassLoader</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> ... </span><span style="color:#768390;">// \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader</span></span>
<span class="line"><span style="color:#F47067;">if</span><span style="color:#ADBAC7;">(</span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass&quot;</span><span style="color:#ADBAC7;">.hasClass(customClassLoader)) {</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></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><h2 id="findclass-method" tabindex="-1"><a class="header-anchor" href="#findclass-method" aria-hidden="true">#</a> findClass <span class="symbol">- method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">findClass</span><span style="color:#ADBAC7;">(name</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span><span style="color:#ADBAC7;">, loader</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;">)</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">HookClass</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">findClass</span><span style="color:#ADBAC7;">(</span><span style="color:#F47067;">vararg</span><span style="color:#ADBAC7;"> name</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span><span style="color:#ADBAC7;">, loader</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;">)</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">VariousClass</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0</code> <code>\u6DFB\u52A0</code></p><p><code>v1.0.1</code> <code>\u4FEE\u6539</code></p><p>\u79FB\u9664\u4E86 <s><code>findClass(various: VariousClass)</code></s> \u65B9\u6CD5</p><p><code>v1.1.0</code> <code>\u4FEE\u6539</code></p><p>\u65B0\u589E <code>loader</code> \u53C2\u6570</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u901A\u8FC7\u5B8C\u6574\u5305\u540D+\u540D\u79F0\u67E5\u627E\u9700\u8981\u88AB Hook \u7684 <code>Class</code>\u3002</p></blockquote><div class="custom-container warning"><p class="custom-container-title">\u6CE8\u610F</p><p>\u4F7F\u7528\u6B64\u65B9\u6CD5\u4F1A\u5F97\u5230\u4E00\u4E2A <strong>HookClass</strong> \u4EC5\u7528\u4E8E Hook\uFF0C\u82E5\u60F3\u67E5\u627E <strong>Class</strong> \u8BF7\u4F7F\u7528 <a href="#string-variousclass-toclass-i-ext-method">toClass</a> \u529F\u80FD\u3002</p></div><p><strong>\u529F\u80FD\u793A\u4F8B</strong></p><p>\u4F60\u53EF\u4EE5\u4F7F\u7528\u4E09\u79CD\u65B9\u5F0F\u67E5\u627E\u4F60\u9700\u8981 Hook \u7684\u76EE\u6807 <code>Class</code>\u3002</p><p>\u4F60\u53EF\u4EE5\u76F4\u63A5\u5C06\u88AB\u67E5\u627E\u7684 <code>Class</code> \u5B8C\u6574\u5305\u540D+\u540D\u79F0\u586B\u5165 <code>name</code> \u4E2D\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">findClass(name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass&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>\u82E5\u4F60\u4E0D\u786E\u5B9A\u591A\u4E2A\u7248\u672C\u7684 <code>Class</code> \u4EE5\u53CA\u4E0D\u540C\u540D\u79F0\uFF0C\u4F60\u53EF\u4EE5\u5C06\u591A\u4E2A\u5B8C\u6574\u5305\u540D+\u540D\u79F0\u586B\u5165 <code>name</code> \u4E2D\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">findClass(</span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass1&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass2&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass3&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>\u4F60\u8FD8\u53EF\u4EE5\u521B\u5EFA\u4E00\u4E2A <code>VariousClass</code>\uFF0C\u5C06 <code>Class</code> \u7684\u5B8C\u6574\u5305\u540D+\u540D\u79F0\u586B\u5165 <code>VariousClass</code> \u7684 <code>name</code> \u4E2D\u5E76\u586B\u5165 <code>various</code> \u53C2\u6570\u4E2D\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> variousClass </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">VariousClass</span><span style="color:#ADBAC7;">(</span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass1&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass2&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass3&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>\u82E5\u4F60\u5F53\u524D\u9700\u8981\u67E5\u627E\u7684 <code>Class</code> \u4E0D\u5C5E\u4E8E <code>appClassLoader</code>\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528 <code>loader</code> \u53C2\u6570\u6307\u5B9A\u4F60\u8981\u88C5\u8F7D\u7684 <code>ClassLoader</code>\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> outsideLoader</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> ... </span><span style="color:#768390;">// \u5047\u8BBE\u8FD9\u5C31\u662F\u4F60\u7684 ClassLoader</span></span>
<span class="line"><span style="color:#ADBAC7;">findClass(name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;com.example.demo.OutsideClass&quot;</span><span style="color:#ADBAC7;">, loader </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> outsideLoader)</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>\u540C\u6837\u5730\uFF0C\u5728\u4E0D\u786E\u5B9A\u591A\u4E2A\u7248\u672C\u7684 <code>Class</code> \u4EE5\u53CA\u4E0D\u540C\u540D\u79F0\u65F6\uFF0C\u4E5F\u53EF\u4EE5\u4F7F\u7528 <code>loader</code> \u53C2\u6570\u6307\u5B9A\u4F60\u8981\u88C5\u8F7D\u7684 <code>ClassLoader</code>\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> outsideLoader</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> ... </span><span style="color:#768390;">// \u5047\u8BBE\u8FD9\u5C31\u662F\u4F60\u7684 ClassLoader</span></span>
<span class="line"><span style="color:#ADBAC7;">findClass(</span><span style="color:#96D0FF;">&quot;com.example.demo.OutsideClass1&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;com.example.demo.OutsideClass2&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;com.example.demo.OutsideClass3&quot;</span><span style="color:#ADBAC7;">, loader </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> outsideLoader)</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><h2 id="string-class-variousclass-hookclass-hook-i-ext-method" tabindex="-1"><a class="header-anchor" href="#string-class-variousclass-hookclass-hook-i-ext-method" aria-hidden="true">#</a> String+Class+VariousClass+HookClass.hook <span class="symbol">- i-ext-method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">inline</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> String.</span><span style="color:#DCBDFB;">hook</span><span style="color:#ADBAC7;">(initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiMemberHookCreator</span><span style="color:#ADBAC7;">.() </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiMemberHookCreator</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">Result</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">inline</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">Class</span><span style="color:#F47067;">&lt;*</span><span style="color:#ADBAC7;">&gt;.</span><span style="color:#DCBDFB;">hook</span><span style="color:#ADBAC7;">(isForceUseAbsolute</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span><span style="color:#ADBAC7;">, initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiMemberHookCreator</span><span style="color:#ADBAC7;">.() </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiMemberHookCreator</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">Result</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">inline</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> VariousClass.</span><span style="color:#DCBDFB;">hook</span><span style="color:#ADBAC7;">(initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiMemberHookCreator</span><span style="color:#ADBAC7;">.() </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiMemberHookCreator</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">Result</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">inline</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> HookClass.</span><span style="color:#DCBDFB;">hook</span><span style="color:#ADBAC7;">(initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiMemberHookCreator</span><span style="color:#ADBAC7;">.() </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiMemberHookCreator</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">Result</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0</code> <code>\u6DFB\u52A0</code></p><p><code>v1.0.1</code> <code>\u4FEE\u6539</code></p><p>\u65B0\u589E <code>VariousClass</code> \u7684\u76F4\u63A5\u8C03\u7528 <code>hook</code> \u65B9\u6CD5</p><p><code>v1.0.2</code> <code>\u4FEE\u6539</code></p><p>\u65B0\u589E <code>String</code> \u7684\u76F4\u63A5\u8C03\u7528 <code>hook</code> \u65B9\u6CD5</p><p><code>v1.0.3</code> <code>\u4FEE\u6539</code></p><p>\u65B0\u589E <code>YukiMemberHookCreator.Result</code> \u8FD4\u56DE\u503C</p><p><code>v1.0.70</code> <code>\u4FEE\u6539</code></p><p>\u65B0\u589E <code>isUseAppClassLoader</code> \u53C2\u6570</p><p><code>v1.0.80</code> <code>\u4FEE\u6539</code></p><p>\u5C06\u65B9\u6CD5\u4F53\u8FDB\u884C inline</p><p><code>v1.1.0</code> <code>\u4FEE\u6539</code></p><p>\u79FB\u9664\u4E86 <s><code>isUseAppClassLoader</code></s> \u53C2\u6570</p><p>\u6DFB\u52A0\u4E86 <code>isForceUseAbsolute</code> \u53C2\u6570\u5230 <code>Class.hook</code> \u65B9\u6CD5</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u8FD9\u662F\u4E00\u5207 Hook \u7684\u5165\u53E3\u521B\u5EFA\u65B9\u6CD5\uFF0CHook \u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u3002</p></blockquote><p><strong>\u529F\u80FD\u793A\u4F8B</strong></p><p>\u5982\u4F60\u6240\u89C1\uFF0CHook \u65B9\u6CD5\u4F53\u7684\u521B\u5EFA\u53EF\u4F7F\u7528 4 \u79CD\u65B9\u5F0F\u3002</p><p>\u901A\u8FC7\u5B57\u7B26\u4E32\u7C7B\u540D\u5F97\u5230 <code>HookClass</code> \u5B9E\u4F8B\u8FDB\u884C\u521B\u5EFA\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass&quot;</span><span style="color:#ADBAC7;">.hook {</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>
<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>\u901A\u8FC7 <code>findClass</code> \u5F97\u5230 <code>HookClass</code> \u5B9E\u4F8B\u8FDB\u884C\u521B\u5EFA\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">findClass(name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass&quot;</span><span style="color:#ADBAC7;">).hook {</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></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>\u4F7F\u7528 <code>stub</code> \u6216\u76F4\u63A5\u62FF\u5230 <code>Class</code> \u5B9E\u4F8B\u8FDB\u884C\u521B\u5EFA\u3002</p><p>\u9ED8\u8BA4\u60C5\u51B5\u4E0B API \u4F1A\u5C06 <code>Class</code> \u5B9E\u4F8B\u8F6C\u6362\u4E3A\u7C7B\u540D\u5E76\u7ED1\u5B9A\u5230 <code>appClassLoader</code>\uFF0C\u82E5\u5931\u8D25\uFF0C\u5219\u4F1A\u4F7F\u7528\u539F\u59CB <code>Class</code> \u5B9E\u4F8B\u76F4\u63A5\u8FDB\u884C Hook\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F69D50;">Stub</span><span style="color:#ADBAC7;">::</span><span style="color:#6CB6FF;">class</span><span style="color:#ADBAC7;">.java.hook {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// Your code 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>\u82E5\u5F53\u524D <code>Class</code> \u4E0D\u5728 <code>appClassLoader</code> \u4E14\u81EA\u52A8\u5339\u914D\u65E0\u6CD5\u627E\u5230\u8BE5 <code>Class</code>\uFF0C\u8BF7\u542F\u7528 <code>isForceUseAbsolute</code>\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F69D50;">YourClass</span><span style="color:#ADBAC7;">::</span><span style="color:#6CB6FF;">class</span><span style="color:#ADBAC7;">.java.hook(isForceUseAbsolute </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">true</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></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>\u4F7F\u7528 <code>VariousClass</code> \u5B9E\u4F8B\u8FDB\u884C\u521B\u5EFA\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F69D50;">VariousClass</span><span style="color:#ADBAC7;">(</span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass1&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass2&quot;</span><span style="color:#ADBAC7;">).hook {</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></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>\u6216\u8005\u76F4\u63A5\u4F7F\u7528\u53EF\u53D8\u5B57\u7B26\u4E32\u6570\u7EC4\u8FDB\u884C\u521B\u5EFA\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">findClass(</span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass1&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;com.example.demo.DemoClass2&quot;</span><span style="color:#ADBAC7;">).hook {</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></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><h2 id="hookresources-hook-i-ext-method" tabindex="-1"><a class="header-anchor" href="#hookresources-hook-i-ext-method" aria-hidden="true">#</a> HookResources.hook <span class="symbol">- i-ext-method</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">inline</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> HookResources.</span><span style="color:#DCBDFB;">hook</span><span style="color:#ADBAC7;">(initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiResourcesHookCreator</span><span style="color:#ADBAC7;">.() </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.80</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>Hook APP \u7684 Resources\u3002</p></blockquote><div class="custom-container danger"><p class="custom-container-title">\u7279\u522B\u6CE8\u610F</p><p>\u8BF7\u6CE8\u610F\u4F60\u9700\u8981\u786E\u4FDD\u5F53\u524D Hook Framework \u652F\u6301\u4E14 <strong>InjectYukiHookWithXposed.isUsingResourcesHook</strong> \u5DF2\u542F\u7528\u3002</p></div><p><strong>\u529F\u80FD\u793A\u4F8B</strong></p><p>Resources Hook \u4E3A\u56FA\u5B9A\u7528\u6CD5\uFF0C\u83B7\u53D6 <code>resources</code> \u5BF9\u8C61\uFF0C\u7136\u540E\u8C03\u7528 <code>hook</code> \u65B9\u6CD5\u5F00\u59CB Hook\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">resources().hook {</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></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div class="custom-container danger"><p class="custom-container-title">\u7279\u522B\u6CE8\u610F</p><p>\u8FD9\u662F\u56FA\u5B9A\u7528\u6CD5\uFF0C\u4E3A\u4E86\u9632\u6B62\u53D1\u751F\u95EE\u9898\uFF0C\u4F60\u4E0D\u53EF\u624B\u52A8\u5B9E\u73B0\u4EFB\u4F55 <strong>HookResources</strong> \u5B9E\u4F8B\u6267\u884C <strong>hook</strong> \u8C03\u7528\u3002</p></div><p>\u5C06 Resources \u7684 Hook \u8BBE\u7F6E\u4E3A\u8FD9\u6837\u662F\u4E3A\u4E86\u4E0E <code>findClass(...).hook</code> \u505A\u5230\u7EDF\u4E00\uFF0C\u4F7F\u5F97\u8C03\u7528\u8D77\u6765\u903B\u8F91\u4E0D\u4F1A\u6DF7\u4E71\u3002</p><h2 id="applifecycle-class" tabindex="-1"><a class="header-anchor" href="#applifecycle-class" aria-hidden="true">#</a> AppLifecycle <span class="symbol">- class</span></h2><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">inner </span><span style="color:#F47067;">class</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">AppLifecycle</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">internal</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">constructor</span><span style="color:#ADBAC7;">(</span><span style="color:#F47067;">private</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> isOnFailureThrowToApp</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.88</code> <code>\u65B0\u589E</code></p><p><code>v1.1.5</code> <code>\u4FEE\u6539</code></p><p>\u65B0\u589E <code>isOnFailureThrowToApp</code> \u53C2\u6570\uFF0C\u53EF\u9009\u62E9\u5C06\u5F02\u5E38\u5728 (Xposed) \u5BBF\u4E3B\u73AF\u5883\u6253\u5370\u800C\u4E0D\u662F\u629B\u51FA\u7ED9\u5BBF\u4E3B</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u5F53\u524D Hook APP \u7684\u751F\u547D\u5468\u671F\u5B9E\u4F8B\u5904\u7406\u7C7B\u3002</p></blockquote><h3 id="attachbasecontext-method" tabindex="-1"><a class="header-anchor" href="#attachbasecontext-method" aria-hidden="true">#</a> attachBaseContext <span class="symbol">- method</span></h3><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">attachBaseContext</span><span style="color:#ADBAC7;">(result</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> (baseContext</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Context</span><span style="color:#ADBAC7;">, hasCalledSuper</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Boolean</span><span style="color:#ADBAC7;">) </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.88</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u76D1\u542C\u5F53\u524D Hook APP \u88C5\u8F7D <code>Application.attachBaseContext</code>\u3002</p></blockquote><h3 id="oncreate-method" tabindex="-1"><a class="header-anchor" href="#oncreate-method" aria-hidden="true">#</a> onCreate <span class="symbol">- method</span></h3><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">onCreate</span><span style="color:#ADBAC7;">(initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Application</span><span style="color:#ADBAC7;">.() </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.88</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u76D1\u542C\u5F53\u524D Hook APP \u88C5\u8F7D <code>Application.onCreate</code>\u3002</p></blockquote><h3 id="onterminate-method" tabindex="-1"><a class="header-anchor" href="#onterminate-method" aria-hidden="true">#</a> onTerminate <span class="symbol">- method</span></h3><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">onTerminate</span><span style="color:#ADBAC7;">(initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Application</span><span style="color:#ADBAC7;">.() </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.88</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u76D1\u542C\u5F53\u524D Hook APP \u88C5\u8F7D <code>Application.onTerminate</code>\u3002</p></blockquote><h3 id="onlowmemory-method" tabindex="-1"><a class="header-anchor" href="#onlowmemory-method" aria-hidden="true">#</a> onLowMemory <span class="symbol">- method</span></h3><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">onLowMemory</span><span style="color:#ADBAC7;">(initiate</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Application</span><span style="color:#ADBAC7;">.() </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.88</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u76D1\u542C\u5F53\u524D Hook APP \u88C5\u8F7D <code>Application.onLowMemory</code>\u3002</p></blockquote><h3 id="ontrimmemory-method" tabindex="-1"><a class="header-anchor" href="#ontrimmemory-method" aria-hidden="true">#</a> onTrimMemory <span class="symbol">- method</span></h3><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">onTrimMemory</span><span style="color:#ADBAC7;">(result</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> (self</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Application</span><span style="color:#ADBAC7;">, level</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Int</span><span style="color:#ADBAC7;">) </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.88</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u76D1\u542C\u5F53\u524D Hook APP \u88C5\u8F7D <code>Application.onTrimMemory</code>\u3002</p></blockquote><h3 id="onconfigurationchanged-method" tabindex="-1"><a class="header-anchor" href="#onconfigurationchanged-method" aria-hidden="true">#</a> onConfigurationChanged <span class="symbol">- method</span></h3><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">onConfigurationChanged</span><span style="color:#ADBAC7;">(result</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> (self</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Application</span><span style="color:#ADBAC7;">, config</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Configuration</span><span style="color:#ADBAC7;">) </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.88</code> <code>\u65B0\u589E</code></p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u76D1\u542C\u5F53\u524D Hook APP \u88C5\u8F7D <code>Application.onConfigurationChanged</code>\u3002</p></blockquote><h3 id="registerreceiver-method" tabindex="-1"><a class="header-anchor" href="#registerreceiver-method" aria-hidden="true">#</a> registerReceiver <span class="symbol">- method</span></h3><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">registerReceiver</span><span style="color:#ADBAC7;">(</span><span style="color:#F47067;">vararg</span><span style="color:#ADBAC7;"> action</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">String</span><span style="color:#ADBAC7;">, result</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> (context</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Context</span><span style="color:#ADBAC7;">, intent</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Intent</span><span style="color:#ADBAC7;">) </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><div class="language-kotlin ext-kt"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">registerReceiver</span><span style="color:#ADBAC7;">(filter</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">IntentFilter</span><span style="color:#ADBAC7;">, result</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> (context</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Context</span><span style="color:#ADBAC7;">, intent</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Intent</span><span style="color:#ADBAC7;">) </span><span style="color:#F47067;">-&gt;</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Unit</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"></span></code></pre></div><p><strong>\u53D8\u66F4\u8BB0\u5F55</strong></p><p><code>v1.0.88</code> <code>\u65B0\u589E</code></p><p><code>v1.1.8</code> <code>\u4FEE\u6539</code></p><p>\u65B0\u589E\u76F4\u63A5\u4F7F\u7528 <code>IntentFilter</code> \u6CE8\u518C\u7CFB\u7EDF\u5E7F\u64AD\u76D1\u542C</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u6CE8\u518C\u7CFB\u7EDF\u5E7F\u64AD\u76D1\u542C\u3002</p></blockquote>`,436),p=[l];function c(r,t){return o(),a("div",null,p)}const i=s(e,[["render",c],["__file","PackageParam.html.vue"]]);export{i as default};
