import{_ as s,o as a,c as n,a as l}from"./app.f643a53b.js";const e={},o=l(`<h1 id="channeldata-class" tabindex="-1"><a class="header-anchor" href="#channeldata-class" aria-hidden="true">#</a> ChannelData <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;">data</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">class</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ChannelData</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 style="color:#F47067;">var</span><span style="color:#ADBAC7;"> key</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;">var</span><span style="color:#ADBAC7;"> value</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">T</span><span style="color:#ADBAC7;">?) </span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">Serializable</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>\u5B9E\u73B0\u4E86 <code>Serializable</code> \u63A5\u53E3</p><p><strong>\u529F\u80FD\u63CF\u8FF0</strong></p><blockquote><p>\u6570\u636E\u901A\u8BAF\u6865\u952E\u503C\u6784\u9020\u7C7B\u3002</p></blockquote><p>\u8FD9\u4E2A\u7C7B\u662F\u5BF9 <code>YukiHookDataChannel</code> \u7684\u4E00\u4E2A\u6269\u5C55\u7528\u6CD5\u3002</p><p><strong>\u529F\u80FD\u793A\u4F8B</strong></p><p>\u5EFA\u7ACB\u4E00\u4E2A\u6A21\u677F\u7C7B\u5B9A\u4E49\u6A21\u5757\u4E0E\u5BBF\u4E3B\u9700\u8981\u53D1\u9001\u7684\u952E\u503C\u6570\u636E\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;">object</span><span style="color:#ADBAC7;"> DataConst {</span></span>
<span class="line"></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">TEST_KV_DATA_1</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ChannelData</span><span style="color:#ADBAC7;">(</span><span style="color:#96D0FF;">&quot;test_data_1&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;defalut value&quot;</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">TEST_KV_DATA_2</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ChannelData</span><span style="color:#ADBAC7;">(</span><span style="color:#96D0FF;">&quot;test_data_2&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#6CB6FF;">0</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>\u952E\u503C\u6570\u636E\u5B9A\u4E49\u540E\uFF0C\u4F60\u5C31\u53EF\u4EE5\u65B9\u4FBF\u5730\u5728\u6A21\u5757\u548C\u5BBF\u4E3B\u4E2D\u8C03\u7528\u6240\u9700\u8981\u53D1\u9001\u7684\u6570\u636E\u3002</p><blockquote><p>\u6A21\u5757\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;">// \u4ECE\u6307\u5B9A\u5305\u540D\u7684\u5BBF\u4E3B\u83B7\u53D6</span></span>
<span class="line"><span style="color:#ADBAC7;">dataChannel(packageName </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;com.example.demo&quot;</span><span style="color:#ADBAC7;">).wait(</span><span style="color:#F69D50;">DataConst</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">TEST_KV_DATA_1</span><span style="color:#ADBAC7;">) { value </span><span style="color:#F47067;">-&gt;</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;">// \u53D1\u9001\u7ED9\u6307\u5B9A\u5305\u540D\u7684\u5BBF\u4E3B - \u672A\u586B\u5199 value \u65F6\u5C06\u4F7F\u7528\u6A21\u677F\u63D0\u4F9B\u7684\u9ED8\u8BA4\u503C</span></span>
<span class="line"><span style="color:#ADBAC7;">dataChannel(packageName </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;com.example.demo&quot;</span><span style="color:#ADBAC7;">).put(</span><span style="color:#F69D50;">DataConst</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">TEST_KV_DATA_1</span><span style="color:#ADBAC7;">, value </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;sending value&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 class="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><blockquote><p>\u5BBF\u4E3B\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;">// \u4ECE\u6A21\u5757\u83B7\u53D6</span></span>
<span class="line"><span style="color:#ADBAC7;">dataChannel.wait(</span><span style="color:#F69D50;">DataConst</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">TEST_KV_DATA_1</span><span style="color:#ADBAC7;">) { value </span><span style="color:#F47067;">-&gt;</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;">// \u53D1\u9001\u7ED9\u6A21\u5757 - \u672A\u586B\u5199 value \u65F6\u5C06\u4F7F\u7528\u6A21\u677F\u63D0\u4F9B\u7684\u9ED8\u8BA4\u503C</span></span>
<span class="line"><span style="color:#ADBAC7;">dataChannel.put(</span><span style="color:#F69D50;">DataConst</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">TEST_KV_DATA_1</span><span style="color:#ADBAC7;">, value </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;sending value&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 class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>\u4F60\u4F9D\u7136\u53EF\u4EE5\u4E0D\u4F7F\u7528\u6A21\u677F\u5B9A\u4E49\u7684\u9ED8\u8BA4\u503C\uFF0C\u968F\u65F6\u4FEE\u6539\u4F60\u7684\u9ED8\u8BA4\u503C\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// \u83B7\u53D6 - \u6B64\u65F6 value \u53D6\u5230\u7684\u9ED8\u8BA4\u503C\u5C06\u4F1A\u662F 2 - \u5E76\u4E0D\u662F\u6A21\u677F\u63D0\u4F9B\u7684 0</span></span>
<span class="line"><span style="color:#ADBAC7;">dataChannel.wait(</span><span style="color:#F69D50;">DataConst</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">TEST_KV_DATA_2</span><span style="color:#ADBAC7;">, value </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">2</span><span style="color:#ADBAC7;">) { value </span><span style="color:#F47067;">-&gt;</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>`,21),p=[o];function c(t,r){return a(),n("div",null,p)}const d=s(e,[["render",c],["__file","ChannelData.html.vue"]]);export{d as default};
