@gkd-kit/docs 0.0.1720967433851 → 0.0.1721010127316
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vitepress/dist/404.html +5 -5
- package/.vitepress/dist/api/index.html +9 -9
- package/.vitepress/dist/api/interfaces/RawApp.html +9 -9
- package/.vitepress/dist/api/interfaces/RawAppGroup.html +10 -10
- package/.vitepress/dist/api/interfaces/RawAppRule.html +10 -10
- package/.vitepress/dist/api/interfaces/RawAppRuleProps.html +9 -9
- package/.vitepress/dist/api/interfaces/RawCategory.html +9 -9
- package/.vitepress/dist/api/interfaces/RawCommonProps.html +10 -10
- package/.vitepress/dist/api/interfaces/RawGlobalApp.html +9 -9
- package/.vitepress/dist/api/interfaces/RawGlobalGroup.html +10 -10
- package/.vitepress/dist/api/interfaces/RawGlobalRule.html +10 -10
- package/.vitepress/dist/api/interfaces/RawGlobalRuleProps.html +9 -9
- package/.vitepress/dist/api/interfaces/RawGroupProps.html +10 -10
- package/.vitepress/dist/api/interfaces/RawRuleProps.html +10 -10
- package/.vitepress/dist/api/interfaces/RawSubscription.html +10 -10
- package/.vitepress/dist/api/type-aliases/IArray.html +10 -10
- package/.vitepress/dist/api/type-aliases/Integer.html +10 -10
- package/.vitepress/dist/api/type-aliases/Position.html +10 -10
- package/.vitepress/dist/assets/{app.CtxXedBl.js → app._NUwu5zq.js} +1 -1
- package/.vitepress/dist/assets/chunks/@localSearchIndexroot.CRYI2S0q.js +1 -0
- package/.vitepress/dist/assets/chunks/VPLocalSearchBox.ChRMYY60.js +7 -0
- package/.vitepress/dist/assets/chunks/img.Op9kAQLN.js +1 -1
- package/.vitepress/dist/assets/chunks/{theme.BWoppEJO.js → theme.BHC57mj_.js} +1 -1
- package/.vitepress/dist/assets/{faq_index.md.WiIPZb5s.js → faq_index.md.DS3hLTvb.js} +1 -1
- package/.vitepress/dist/assets/{faq_index.md.WiIPZb5s.lean.js → faq_index.md.DS3hLTvb.lean.js} +1 -1
- package/.vitepress/dist/assets/{guide_index.md.BPAfG01R.js → guide_index.md.h68F7vCT.js} +1 -1
- package/.vitepress/dist/assets/{guide_index.md.BPAfG01R.lean.js → guide_index.md.h68F7vCT.lean.js} +1 -1
- package/.vitepress/dist/assets/{index.md.B8cacXgE.js → index.md.CBUdHLxJ.js} +1 -1
- package/.vitepress/dist/assets/{index.md.B8cacXgE.lean.js → index.md.CBUdHLxJ.lean.js} +1 -1
- package/.vitepress/dist/assets/{selector_example.md.EAifdJCw.js → selector_example.md.sK7toJjV.js} +1 -1
- package/.vitepress/dist/assets/{selector_example.md.EAifdJCw.lean.js → selector_example.md.sK7toJjV.lean.js} +1 -1
- package/.vitepress/dist/assets/{selector_index.md.9RatzoKL.js → selector_index.md.CzaAekVY.js} +1 -1
- package/.vitepress/dist/assets/{selector_index.md.9RatzoKL.lean.js → selector_index.md.CzaAekVY.lean.js} +1 -1
- package/.vitepress/dist/assets/{selector_node.md.B1BjBMjC.js → selector_node.md.Cw5xuLkD.js} +1 -1
- package/.vitepress/dist/assets/{selector_node.md.B1BjBMjC.lean.js → selector_node.md.Cw5xuLkD.lean.js} +1 -1
- package/.vitepress/dist/assets/{selector_optimize.md.C27ufCHJ.js → selector_optimize.md.BeNl8sFy.js} +1 -1
- package/.vitepress/dist/assets/{selector_optimize.md.C27ufCHJ.lean.js → selector_optimize.md.BeNl8sFy.lean.js} +1 -1
- package/.vitepress/dist/assets/{style.DjCrY-Ok.css → style.BgKKomK9.css} +1 -1
- package/.vitepress/dist/assets/{subscription_index.md.Cpomoc0V.js → subscription_index.md.ChWahFqu.js} +1 -1
- package/.vitepress/dist/assets/{subscription_index.md.Cpomoc0V.lean.js → subscription_index.md.ChWahFqu.lean.js} +1 -1
- package/.vitepress/dist/faq/index.html +11 -11
- package/.vitepress/dist/guide/index.html +11 -11
- package/.vitepress/dist/hashmap.json +1 -1
- package/.vitepress/dist/index.html +9 -9
- package/.vitepress/dist/selector/example.html +9 -9
- package/.vitepress/dist/selector/index.html +11 -11
- package/.vitepress/dist/selector/node.html +9 -9
- package/.vitepress/dist/selector/optimize.html +9 -9
- package/.vitepress/dist/subscription/index.html +10 -10
- package/package.json +1 -1
- package/.vitepress/dist/assets/chunks/@localSearchIndexroot.BPXxmyhH.js +0 -1
- package/.vitepress/dist/assets/chunks/VPLocalSearchBox.De6HPS3u.js +0 -7
package/.vitepress/dist/assets/{guide_index.md.BPAfG01R.lean.js → guide_index.md.h68F7vCT.lean.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as R,G as E,h as L,y as S,o as k,c as y,j as n,t as B,n as O,e as T,a as r,I as U}from"./chunks/framework.B8qPA-ia.js";import{_ as M}from"./chunks/ImageTable.vue_vue_type_script_setup_true_lang.C7KDRUg_.js";import"./chunks/img.Op9kAQLN.js";var f=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},j={exports:{}};(function(m,c){(function(u,s){s()})(f,function(){function u(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function s(e,t,i){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){_(o.response,t,i)},o.onerror=function(){console.error("could not download file")},o.send()}function h(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function d(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof f=="object"&&f.global===f?f:void 0,v=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),_=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!v?function(e,t,i){var o=a.URL||a.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener",typeof e=="string"?(l.href=e,l.origin===location.origin?d(l):h(l.href)?s(e,t,i):d(l,l.target="_blank")):(l.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(l.href)},4e4),setTimeout(function(){d(l)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(u(e,i),t);else if(h(e))s(e,t,i);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){d(o)})}}:function(e,t,i,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof e=="string")return s(e,t,i);var l=e.type==="application/octet-stream",A=/constructor/i.test(a.HTMLElement)||a.safari,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||l&&A||v)&&typeof FileReader<"u"){var w=new FileReader;w.onloadend=function(){var p=w.result;p=b?p:p.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=p:location=p,o=null},w.readAsDataURL(e)}else{var x=a.URL||a.webkitURL,g=x.createObjectURL(e);o?o.location=g:location.href=g,o=null,setTimeout(function(){x.revokeObjectURL(g)},4e4)}});a.saveAs=_.saveAs=_,m.exports=_})})(j);var D=j.exports;const F={"inline-flex":"","items-center":"","gap-10px":""},C={key:0,"animate-spin":"","size-16px":"",viewBox:"0 0 16 16",fill:"none"},G=n("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor","stroke-opacity":"0.25","stroke-width":"2","vector-effect":"non-scaling-stroke"},null,-1),$=n("path",{d:"M15 8a7.002 7.002 0 00-7-7",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","vector-effect":"non-scaling-stroke"},null,-1),H=[G,$],N=R({__name:"ApkDownloadButton",setup(m){const c=E(""),u=L(()=>(c.value.split("/").at(-1)||"").replace(".wasm",".apk")),s=E(!1),h=async()=>{if(!c.value||s.value)return;s.value=!0;const d=await fetch(c.value).then(a=>a.arrayBuffer()).then(a=>new File([a],u.value,{type:"application/vnd.android.package-archive"})).finally(()=>{s.value=!1});D.saveAs(d,u.value)};return S(async()=>{c.value=localStorage.getItem("apkUrl")||"";const a=await fetch("https://registry.npmmirror.com/@gkd-kit/app/latest/files"),v=await a.json();c.value=new URL(v.downloadUrl,a.url).href,localStorage.setItem("apkUrl",c.value)}),(d,a)=>(k(),y("div",F,[n("a",{class:O({"cursor-progress":s.value,"opacity-50":s.value,"cursor-pointer":!s.value}),onClick:h},B(u.value),3),s.value?(k(),y("svg",C,H)):T("",!0)]))}}),P=n("h1",{id:"title",tabindex:"-1"},[r("开始使用 "),n("a",{class:"header-anchor",href:"#title","aria-label":'Permalink to "开始使用 {#title}"'},"")],-1),K=n("h2",{id:"install",tabindex:"-1"},[r("下载安装 "),n("a",{class:"header-anchor",href:"#install","aria-label":'Permalink to "下载安装 {#install}"'},"")],-1),V=n("li",null,[n("p",null,[r("Github "),n("a",{href:"https://github.com/gkd-kit/gkd/releases/latest",target:"_blank",rel:"noreferrer"},"releases")])],-1),q=n("p",null,"下载完毕后, 在您的 Android 手机上安装并打开",-1),I=n("h2",{id:"usage",tabindex:"-1"},[r("授权使用 "),n("a",{class:"header-anchor",href:"#usage","aria-label":'Permalink to "授权使用 {#usage}"'},"")],-1),X=n("p",null,"打开后进入 GKD 的首页, 要想 GKD 正常工作需要授权无障碍权限",-1),z=n("p",null,[r("点击无障碍权限右侧的 "),n("code",null,"授权"),r(" 按钮即可前往设置的无障碍界面授权")],-1),J=n("p",null,"以 Xiaomi HyperOS 为例, 下面为完整的授权流程截图",-1),W=n("p",null,[r("如果您的手机的无障碍列表界面无法授权 GKD 或者显示 "),n("code",null,"受限制的设置(出于安全考虑,此设置目前不可用)")],-1),Q=n("p",null,"这是 Android13 的限制, 对于不在应用商店等可信任来源安装的应用不能直接开启无障碍权限",-1),Y=n("p",null,[r("您需要解除这个限制, 解除限制的方法在 "),n("a",{href:"/faq/"},"疑难解答")],-1),Z=n("p",null,"限制解除后, 重新按照上面的授权流程即可开启无障碍权限",-1),ae=JSON.parse('{"title":"开始使用","description":"","frontmatter":{},"headers":[],"relativePath":"guide/index.md","filePath":"guide/index.md","lastUpdated":
|
|
1
|
+
import{d as R,G as E,h as L,y as S,o as k,c as y,j as n,t as B,n as O,e as T,a as r,I as U}from"./chunks/framework.B8qPA-ia.js";import{_ as M}from"./chunks/ImageTable.vue_vue_type_script_setup_true_lang.C7KDRUg_.js";import"./chunks/img.Op9kAQLN.js";var f=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},j={exports:{}};(function(m,c){(function(u,s){s()})(f,function(){function u(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function s(e,t,i){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){_(o.response,t,i)},o.onerror=function(){console.error("could not download file")},o.send()}function h(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function d(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof f=="object"&&f.global===f?f:void 0,v=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),_=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!v?function(e,t,i){var o=a.URL||a.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener",typeof e=="string"?(l.href=e,l.origin===location.origin?d(l):h(l.href)?s(e,t,i):d(l,l.target="_blank")):(l.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(l.href)},4e4),setTimeout(function(){d(l)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(u(e,i),t);else if(h(e))s(e,t,i);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){d(o)})}}:function(e,t,i,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof e=="string")return s(e,t,i);var l=e.type==="application/octet-stream",A=/constructor/i.test(a.HTMLElement)||a.safari,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||l&&A||v)&&typeof FileReader<"u"){var w=new FileReader;w.onloadend=function(){var p=w.result;p=b?p:p.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=p:location=p,o=null},w.readAsDataURL(e)}else{var x=a.URL||a.webkitURL,g=x.createObjectURL(e);o?o.location=g:location.href=g,o=null,setTimeout(function(){x.revokeObjectURL(g)},4e4)}});a.saveAs=_.saveAs=_,m.exports=_})})(j);var D=j.exports;const F={"inline-flex":"","items-center":"","gap-10px":""},C={key:0,"animate-spin":"","size-16px":"",viewBox:"0 0 16 16",fill:"none"},G=n("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor","stroke-opacity":"0.25","stroke-width":"2","vector-effect":"non-scaling-stroke"},null,-1),$=n("path",{d:"M15 8a7.002 7.002 0 00-7-7",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","vector-effect":"non-scaling-stroke"},null,-1),H=[G,$],N=R({__name:"ApkDownloadButton",setup(m){const c=E(""),u=L(()=>(c.value.split("/").at(-1)||"").replace(".wasm",".apk")),s=E(!1),h=async()=>{if(!c.value||s.value)return;s.value=!0;const d=await fetch(c.value).then(a=>a.arrayBuffer()).then(a=>new File([a],u.value,{type:"application/vnd.android.package-archive"})).finally(()=>{s.value=!1});D.saveAs(d,u.value)};return S(async()=>{c.value=localStorage.getItem("apkUrl")||"";const a=await fetch("https://registry.npmmirror.com/@gkd-kit/app/latest/files"),v=await a.json();c.value=new URL(v.downloadUrl,a.url).href,localStorage.setItem("apkUrl",c.value)}),(d,a)=>(k(),y("div",F,[n("a",{class:O({"cursor-progress":s.value,"opacity-50":s.value,"cursor-pointer":!s.value}),onClick:h},B(u.value),3),s.value?(k(),y("svg",C,H)):T("",!0)]))}}),P=n("h1",{id:"title",tabindex:"-1"},[r("开始使用 "),n("a",{class:"header-anchor",href:"#title","aria-label":'Permalink to "开始使用 {#title}"'},"")],-1),K=n("h2",{id:"install",tabindex:"-1"},[r("下载安装 "),n("a",{class:"header-anchor",href:"#install","aria-label":'Permalink to "下载安装 {#install}"'},"")],-1),V=n("li",null,[n("p",null,[r("Github "),n("a",{href:"https://github.com/gkd-kit/gkd/releases/latest",target:"_blank",rel:"noreferrer"},"releases")])],-1),q=n("p",null,"下载完毕后, 在您的 Android 手机上安装并打开",-1),I=n("h2",{id:"usage",tabindex:"-1"},[r("授权使用 "),n("a",{class:"header-anchor",href:"#usage","aria-label":'Permalink to "授权使用 {#usage}"'},"")],-1),X=n("p",null,"打开后进入 GKD 的首页, 要想 GKD 正常工作需要授权无障碍权限",-1),z=n("p",null,[r("点击无障碍权限右侧的 "),n("code",null,"授权"),r(" 按钮即可前往设置的无障碍界面授权")],-1),J=n("p",null,"以 Xiaomi HyperOS 为例, 下面为完整的授权流程截图",-1),W=n("p",null,[r("如果您的手机的无障碍列表界面无法授权 GKD 或者显示 "),n("code",null,"受限制的设置(出于安全考虑,此设置目前不可用)")],-1),Q=n("p",null,"这是 Android13 的限制, 对于不在应用商店等可信任来源安装的应用不能直接开启无障碍权限",-1),Y=n("p",null,[r("您需要解除这个限制, 解除限制的方法在 "),n("a",{href:"/faq/"},"疑难解答")],-1),Z=n("p",null,"限制解除后, 重新按照上面的授权流程即可开启无障碍权限",-1),ae=JSON.parse('{"title":"开始使用","description":"","frontmatter":{},"headers":[],"relativePath":"guide/index.md","filePath":"guide/index.md","lastUpdated":1721010099000}'),ee={name:"guide/index.md"},se=Object.assign(ee,{setup(m){return(c,u)=>(k(),y("div",null,[P,K,n("ul",null,[n("li",null,[n("p",null,[r("镜像加速 "),U(N)])]),V]),q,I,X,z,J,U(M,{images:[["0001.png","0002.png","0003.png","0004.png"],["0005.png","0006.png","0007.png","0008.png"]]}),W,Q,Y,Z]))}});export{ae as __pageData,se as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e,o as a}from"./chunks/framework.B8qPA-ia.js";const p=JSON.parse('{"title":"GKD","titleTemplate":"自定义屏幕点击应用","description":"","frontmatter":{"layout":"home","title":"GKD","titleTemplate":"自定义屏幕点击应用","hero":{"name":"GKD","text":"自定义屏幕点击应用","tagline":"基于无障碍+选择器+订阅规则","actions":[{"theme":"brand","text":"开始使用","link":"/guide/"},{"theme":"alt","text":"选择器","link":"/selector/"},{"theme":"alt","text":"订阅规则","link":"/subscription/"},{"theme":"alt","text":"快照审查","link":"https://i.gkd.li/"},{"theme":"alt","text":"疑难解答","link":"/faq/"}]},"features":[{"title":"🐔 开放源代码","details":"任何人均可审查源代码, 确保安全性和质量"},{"title":"🐋 选择器","details":"一种能联系节点上下文信息的的查询语法, 更容易也更精确找到目标节点"},{"title":"🎤 订阅规则","details":"您可编写本地订阅满足自己需求, 远程订阅能让您直接使用大众维护的开源规则"},{"title":"🏀 快照审查","details":"捕获的快照可通过审查工具测试选择器帮助自定义规则, 也可直接分享快照寻求别人的帮助"}]},"headers":[],"relativePath":"index.md","filePath":"index.md","lastUpdated":
|
|
1
|
+
import{_ as t,c as e,o as a}from"./chunks/framework.B8qPA-ia.js";const p=JSON.parse('{"title":"GKD","titleTemplate":"自定义屏幕点击应用","description":"","frontmatter":{"layout":"home","title":"GKD","titleTemplate":"自定义屏幕点击应用","hero":{"name":"GKD","text":"自定义屏幕点击应用","tagline":"基于无障碍+选择器+订阅规则","actions":[{"theme":"brand","text":"开始使用","link":"/guide/"},{"theme":"alt","text":"选择器","link":"/selector/"},{"theme":"alt","text":"订阅规则","link":"/subscription/"},{"theme":"alt","text":"快照审查","link":"https://i.gkd.li/"},{"theme":"alt","text":"疑难解答","link":"/faq/"}]},"features":[{"title":"🐔 开放源代码","details":"任何人均可审查源代码, 确保安全性和质量"},{"title":"🐋 选择器","details":"一种能联系节点上下文信息的的查询语法, 更容易也更精确找到目标节点"},{"title":"🎤 订阅规则","details":"您可编写本地订阅满足自己需求, 远程订阅能让您直接使用大众维护的开源规则"},{"title":"🏀 快照审查","details":"捕获的快照可通过审查工具测试选择器帮助自定义规则, 也可直接分享快照寻求别人的帮助"}]},"headers":[],"relativePath":"index.md","filePath":"index.md","lastUpdated":1721010099000}'),i={name:"index.md"};function l(n,s,d,o,r,c){return a(),e("div")}const x=t(i,[["render",l]]);export{p as __pageData,x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e,o as a}from"./chunks/framework.B8qPA-ia.js";const p=JSON.parse('{"title":"GKD","titleTemplate":"自定义屏幕点击应用","description":"","frontmatter":{"layout":"home","title":"GKD","titleTemplate":"自定义屏幕点击应用","hero":{"name":"GKD","text":"自定义屏幕点击应用","tagline":"基于无障碍+选择器+订阅规则","actions":[{"theme":"brand","text":"开始使用","link":"/guide/"},{"theme":"alt","text":"选择器","link":"/selector/"},{"theme":"alt","text":"订阅规则","link":"/subscription/"},{"theme":"alt","text":"快照审查","link":"https://i.gkd.li/"},{"theme":"alt","text":"疑难解答","link":"/faq/"}]},"features":[{"title":"🐔 开放源代码","details":"任何人均可审查源代码, 确保安全性和质量"},{"title":"🐋 选择器","details":"一种能联系节点上下文信息的的查询语法, 更容易也更精确找到目标节点"},{"title":"🎤 订阅规则","details":"您可编写本地订阅满足自己需求, 远程订阅能让您直接使用大众维护的开源规则"},{"title":"🏀 快照审查","details":"捕获的快照可通过审查工具测试选择器帮助自定义规则, 也可直接分享快照寻求别人的帮助"}]},"headers":[],"relativePath":"index.md","filePath":"index.md","lastUpdated":
|
|
1
|
+
import{_ as t,c as e,o as a}from"./chunks/framework.B8qPA-ia.js";const p=JSON.parse('{"title":"GKD","titleTemplate":"自定义屏幕点击应用","description":"","frontmatter":{"layout":"home","title":"GKD","titleTemplate":"自定义屏幕点击应用","hero":{"name":"GKD","text":"自定义屏幕点击应用","tagline":"基于无障碍+选择器+订阅规则","actions":[{"theme":"brand","text":"开始使用","link":"/guide/"},{"theme":"alt","text":"选择器","link":"/selector/"},{"theme":"alt","text":"订阅规则","link":"/subscription/"},{"theme":"alt","text":"快照审查","link":"https://i.gkd.li/"},{"theme":"alt","text":"疑难解答","link":"/faq/"}]},"features":[{"title":"🐔 开放源代码","details":"任何人均可审查源代码, 确保安全性和质量"},{"title":"🐋 选择器","details":"一种能联系节点上下文信息的的查询语法, 更容易也更精确找到目标节点"},{"title":"🎤 订阅规则","details":"您可编写本地订阅满足自己需求, 远程订阅能让您直接使用大众维护的开源规则"},{"title":"🏀 快照审查","details":"捕获的快照可通过审查工具测试选择器帮助自定义规则, 也可直接分享快照寻求别人的帮助"}]},"headers":[],"relativePath":"index.md","filePath":"index.md","lastUpdated":1721010099000}'),i={name:"index.md"};function l(n,s,d,o,r,c){return a(),e("div")}const x=t(i,[["render",l]]);export{p as __pageData,x as default};
|
package/.vitepress/dist/assets/{selector_example.md.EAifdJCw.js → selector_example.md.sK7toJjV.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,c as a,o as t,a4 as r}from"./chunks/framework.B8qPA-ia.js";const u=JSON.parse('{"title":"选择示例","description":"","frontmatter":{},"headers":[],"relativePath":"selector/example.md","filePath":"selector/example.md","lastUpdated":
|
|
1
|
+
import{_ as e,c as a,o as t,a4 as r}from"./chunks/framework.B8qPA-ia.js";const u=JSON.parse('{"title":"选择示例","description":"","frontmatter":{},"headers":[],"relativePath":"selector/example.md","filePath":"selector/example.md","lastUpdated":1721010099000}'),o={name:"selector/example.md"},l=r('<h1 id="title" tabindex="-1">选择示例 <a class="header-anchor" href="#title" aria-label="Permalink to "选择示例 {#title}""></a></h1><p>一些选择器及其相关作用说明</p><h2 id="e-1" tabindex="-1">选择根节点 <a class="header-anchor" href="#e-1" aria-label="Permalink to "选择根节点 {#e-1}""></a></h2><ul><li><code>[parent=null]</code></li><li><code>[depth=0]</code></li></ul><h2 id="e-2" tabindex="-1">选择子节点 <a class="header-anchor" href="#e-2" aria-label="Permalink to "选择子节点 {#e-2}""></a></h2><p>选择一个 ImageView 节点, 并要求其父节点是 LinearLayout</p><p><a href="https://i.gkd.li/i/16076188?gkd=TGluZWFyTGF5b3V0ID4gSW1hZ2VWaWV3" target="_blank" rel="noreferrer"><code>LinearLayout > ImageView</code></a></p>',7),i=[l];function c(d,n,s,_,h,p){return t(),a("div",null,i)}const f=e(o,[["render",c]]);export{u as __pageData,f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,c as a,o as t,a4 as r}from"./chunks/framework.B8qPA-ia.js";const u=JSON.parse('{"title":"选择示例","description":"","frontmatter":{},"headers":[],"relativePath":"selector/example.md","filePath":"selector/example.md","lastUpdated":
|
|
1
|
+
import{_ as e,c as a,o as t,a4 as r}from"./chunks/framework.B8qPA-ia.js";const u=JSON.parse('{"title":"选择示例","description":"","frontmatter":{},"headers":[],"relativePath":"selector/example.md","filePath":"selector/example.md","lastUpdated":1721010099000}'),o={name:"selector/example.md"},l=r("",7),i=[l];function c(d,n,s,_,h,p){return t(),a("div",null,i)}const f=e(o,[["render",c]]);export{u as __pageData,f as default};
|
package/.vitepress/dist/assets/{selector_index.md.9RatzoKL.js → selector_index.md.CzaAekVY.js}
RENAMED
|
@@ -9,4 +9,4 @@ import{d as x,G as u,a5 as y,h as k,o as r,c as p,a6 as b,a7 as _,j as t,t as m,
|
|
|
9
9
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> matches</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'TextView[text~="</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\\\\\\\\\\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"]'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
10
10
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>实现和上面相同的结果, 即用 <code>=</code> 匹配一个 <code>\\</code> 字符, 最终规则应该写成</p><div class="language-json5 vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json5</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
|
11
11
|
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> matches</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'TextView[text="</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"]'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
12
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>类似的问题 <a href="https://github.com/gkd-kit/gkd/issues/603" target="_blank" rel="noreferrer">gkd-kit/gkd#603</a></p>`,37),at=JSON.parse('{"title":"选择器","description":"","frontmatter":{},"headers":[],"relativePath":"selector/index.md","filePath":"selector/index.md","lastUpdated":
|
|
12
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>类似的问题 <a href="https://github.com/gkd-kit/gkd/issues/603" target="_blank" rel="noreferrer">gkd-kit/gkd#603</a></p>`,37),at=JSON.parse('{"title":"选择器","description":"","frontmatter":{},"headers":[],"relativePath":"selector/index.md","filePath":"selector/index.md","lastUpdated":1721010099000}'),X={name:"selector/index.md"},dt=Object.assign(X,{setup(h){return(l,s)=>(r(),p("div",null,[E,C,q,t("div",F,[e(f)]),T,t("table",A,[B,t("tbody",null,[t("tr",null,[w,V,t("td",S,[e(a(d),{src:"0020.png",width:"250"})]),P]),t("tr",null,[j,J,t("td",I,[e(a(d),{src:"0021.png",width:"250"})]),$]),t("tr",null,[D,W,t("td",K,[e(a(d),{src:"0022.png",width:"250"})]),z]),t("tr",null,[N,L,t("td",G,[e(a(d),{src:"0023.png",width:"250"})]),M]),t("tr",null,[O,R,t("td",Z,[e(a(d),{src:"0024.png",width:"250"})]),Q])])]),U,e(a(d),{src:"0025.png"}),H]))}});export{at as __pageData,dt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as x,G as u,a5 as y,h as k,o as r,c as p,a6 as b,a7 as _,j as t,t as m,n as v,k as a,I as e,a4 as i}from"./chunks/framework.B8qPA-ia.js";import{G as d}from"./chunks/img.Op9kAQLN.js";const f=x({__name:"IdentifierField",setup(h){const l=u(""),s=/^[_a-zA-Z][a-zA-Z0-9_]*$/,n=y(l,300),o=k(()=>n.value!=="null"&&n.value!=="true"&&n.value!=="false"&&s.test(n.value));return(Y,c)=>(r(),p("div",null,[b(t("input",{placeholder:"请输入标识符测试是否合法",type:"text","onUpdate:modelValue":c[0]||(c[0]=g=>l.value=g),class:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"},null,512),[[_,l.value]]),t("div",{"mt-4px":"",class:v({"color-red":!o.value,"opacity-0":!a(n)||!l.value})},m(o.value?"合法标识符✅":"非法标识符❌"),3)]))}}),E=i("",32),C=t("table",null,[t("thead",null,[t("tr",null,[t("th",{colspan:"2"},[t("div",{"text-center":""},"值表达式")]),t("th",null,"示例")])]),t("tbody",null,[t("tr",null,[t("td",{rowspan:"3"},"变量"),t("td",null,"标识符"),t("td",null,[t("code",null," a ")])]),t("tr",null,[t("td",null,"成员表达式"),t("td",null,[t("code",null,"a.b")])]),t("tr",null,[t("td",null,"调用表达式"),t("td",null,[t("code",null,"a(b,c)")])]),t("tr",null,[t("td",{rowspan:"4"},"字面量"),t("td",null,"null"),t("td",null,[t("code",null,"null")])]),t("tr",null,[t("td",null,"boolean"),t("td",null,[t("code",null,"false")])]),t("tr",null,[t("td",null,"int"),t("td",null,[t("code",null,"114514")])]),t("tr",null,[t("td",null,"string"),t("td",null,[t("code",null,"'ikun'")])])])],-1),q=i("",11),F={class:"vp-raw"},T=i("",34),A={tabindex:"0"},B=t("thead",null,[t("tr",null,[t("th",{style:{"text-align":"center"}},"操作符"),t("th",{style:{"text-align":"center"}},"名称"),t("th",{style:{"text-align":"center"}},"图例"),t("th",{style:{"text-align":"center"}},"选择器")])],-1),w=t("td",{style:{"text-align":"center"}},"+",-1),V=t("td",{style:{"text-align":"center"}},"前置兄弟节点",-1),S={style:{"text-align":"center"}},P=t("td",{style:{"text-align":"center"}},[t("a",{href:"https://i.gkd.li/i/14045424?gkd=KiArIFtfaWQ9MzNd",target:"_blank",rel:"noreferrer"},"* + [_id=33]")],-1),j=t("td",{style:{"text-align":"center"}},"-",-1),J=t("td",{style:{"text-align":"center"}},"后置兄弟节点",-1),I={style:{"text-align":"center"}},$=t("td",{style:{"text-align":"center"}},[t("a",{href:"https://i.gkd.li/i/14045424?gkd=KiAtIFtfaWQ9MzJd",target:"_blank",rel:"noreferrer"},"* - [_id=32]")],-1),D=t("td",{style:{"text-align":"center"}},">",-1),W=t("td",{style:{"text-align":"center"}},"祖先节点",-1),K={style:{"text-align":"center"}},z=t("td",{style:{"text-align":"center"}},[t("a",{href:"https://i.gkd.li/i/14045424?gkd=KiA-IFtfaWQ9OTBd",target:"_blank",rel:"noreferrer"},"* > [_id=90]")],-1),N=t("td",{style:{"text-align":"center"}},"<",-1),L=t("td",{style:{"text-align":"center"}},"直接子节点",-1),G={style:{"text-align":"center"}},M=t("td",{style:{"text-align":"center"}},[t("a",{href:"https://i.gkd.li/i/14045424?gkd=KiA8IFtfaWQ9ODld",target:"_blank",rel:"noreferrer"},"* < [_id=89]")],-1),O=t("td",{style:{"text-align":"center"}},"<<",-1),R=t("td",{style:{"text-align":"center"}},"子孙节点(深度先序)",-1),Z={style:{"text-align":"center"}},Q=t("td",{style:{"text-align":"center"}},[t("a",{href:"https://i.gkd.li/i/14045424?gkd=KiA8PDIgW19pZD0yOV0",target:"_blank",rel:"noreferrer"},"* <<2 [_id=29]")],-1),U=i("",36),H=i("",37),at=JSON.parse('{"title":"选择器","description":"","frontmatter":{},"headers":[],"relativePath":"selector/index.md","filePath":"selector/index.md","lastUpdated":
|
|
1
|
+
import{d as x,G as u,a5 as y,h as k,o as r,c as p,a6 as b,a7 as _,j as t,t as m,n as v,k as a,I as e,a4 as i}from"./chunks/framework.B8qPA-ia.js";import{G as d}from"./chunks/img.Op9kAQLN.js";const f=x({__name:"IdentifierField",setup(h){const l=u(""),s=/^[_a-zA-Z][a-zA-Z0-9_]*$/,n=y(l,300),o=k(()=>n.value!=="null"&&n.value!=="true"&&n.value!=="false"&&s.test(n.value));return(Y,c)=>(r(),p("div",null,[b(t("input",{placeholder:"请输入标识符测试是否合法",type:"text","onUpdate:modelValue":c[0]||(c[0]=g=>l.value=g),class:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"},null,512),[[_,l.value]]),t("div",{"mt-4px":"",class:v({"color-red":!o.value,"opacity-0":!a(n)||!l.value})},m(o.value?"合法标识符✅":"非法标识符❌"),3)]))}}),E=i("",32),C=t("table",null,[t("thead",null,[t("tr",null,[t("th",{colspan:"2"},[t("div",{"text-center":""},"值表达式")]),t("th",null,"示例")])]),t("tbody",null,[t("tr",null,[t("td",{rowspan:"3"},"变量"),t("td",null,"标识符"),t("td",null,[t("code",null," a ")])]),t("tr",null,[t("td",null,"成员表达式"),t("td",null,[t("code",null,"a.b")])]),t("tr",null,[t("td",null,"调用表达式"),t("td",null,[t("code",null,"a(b,c)")])]),t("tr",null,[t("td",{rowspan:"4"},"字面量"),t("td",null,"null"),t("td",null,[t("code",null,"null")])]),t("tr",null,[t("td",null,"boolean"),t("td",null,[t("code",null,"false")])]),t("tr",null,[t("td",null,"int"),t("td",null,[t("code",null,"114514")])]),t("tr",null,[t("td",null,"string"),t("td",null,[t("code",null,"'ikun'")])])])],-1),q=i("",11),F={class:"vp-raw"},T=i("",34),A={tabindex:"0"},B=t("thead",null,[t("tr",null,[t("th",{style:{"text-align":"center"}},"操作符"),t("th",{style:{"text-align":"center"}},"名称"),t("th",{style:{"text-align":"center"}},"图例"),t("th",{style:{"text-align":"center"}},"选择器")])],-1),w=t("td",{style:{"text-align":"center"}},"+",-1),V=t("td",{style:{"text-align":"center"}},"前置兄弟节点",-1),S={style:{"text-align":"center"}},P=t("td",{style:{"text-align":"center"}},[t("a",{href:"https://i.gkd.li/i/14045424?gkd=KiArIFtfaWQ9MzNd",target:"_blank",rel:"noreferrer"},"* + [_id=33]")],-1),j=t("td",{style:{"text-align":"center"}},"-",-1),J=t("td",{style:{"text-align":"center"}},"后置兄弟节点",-1),I={style:{"text-align":"center"}},$=t("td",{style:{"text-align":"center"}},[t("a",{href:"https://i.gkd.li/i/14045424?gkd=KiAtIFtfaWQ9MzJd",target:"_blank",rel:"noreferrer"},"* - [_id=32]")],-1),D=t("td",{style:{"text-align":"center"}},">",-1),W=t("td",{style:{"text-align":"center"}},"祖先节点",-1),K={style:{"text-align":"center"}},z=t("td",{style:{"text-align":"center"}},[t("a",{href:"https://i.gkd.li/i/14045424?gkd=KiA-IFtfaWQ9OTBd",target:"_blank",rel:"noreferrer"},"* > [_id=90]")],-1),N=t("td",{style:{"text-align":"center"}},"<",-1),L=t("td",{style:{"text-align":"center"}},"直接子节点",-1),G={style:{"text-align":"center"}},M=t("td",{style:{"text-align":"center"}},[t("a",{href:"https://i.gkd.li/i/14045424?gkd=KiA8IFtfaWQ9ODld",target:"_blank",rel:"noreferrer"},"* < [_id=89]")],-1),O=t("td",{style:{"text-align":"center"}},"<<",-1),R=t("td",{style:{"text-align":"center"}},"子孙节点(深度先序)",-1),Z={style:{"text-align":"center"}},Q=t("td",{style:{"text-align":"center"}},[t("a",{href:"https://i.gkd.li/i/14045424?gkd=KiA8PDIgW19pZD0yOV0",target:"_blank",rel:"noreferrer"},"* <<2 [_id=29]")],-1),U=i("",36),H=i("",37),at=JSON.parse('{"title":"选择器","description":"","frontmatter":{},"headers":[],"relativePath":"selector/index.md","filePath":"selector/index.md","lastUpdated":1721010099000}'),X={name:"selector/index.md"},dt=Object.assign(X,{setup(h){return(l,s)=>(r(),p("div",null,[E,C,q,t("div",F,[e(f)]),T,t("table",A,[B,t("tbody",null,[t("tr",null,[w,V,t("td",S,[e(a(d),{src:"0020.png",width:"250"})]),P]),t("tr",null,[j,J,t("td",I,[e(a(d),{src:"0021.png",width:"250"})]),$]),t("tr",null,[D,W,t("td",K,[e(a(d),{src:"0022.png",width:"250"})]),z]),t("tr",null,[N,L,t("td",G,[e(a(d),{src:"0023.png",width:"250"})]),M]),t("tr",null,[O,R,t("td",Z,[e(a(d),{src:"0024.png",width:"250"})]),Q])])]),U,e(a(d),{src:"0025.png"}),H]))}});export{at as __pageData,dt as default};
|
package/.vitepress/dist/assets/{selector_node.md.B1BjBMjC.js → selector_node.md.Cw5xuLkD.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as d,o as e,a4 as o}from"./chunks/framework.B8qPA-ia.js";const u=JSON.parse('{"title":"属性方法","description":"","frontmatter":{},"headers":[],"relativePath":"selector/node.md","filePath":"selector/node.md","lastUpdated":
|
|
1
|
+
import{_ as t,c as d,o as e,a4 as o}from"./chunks/framework.B8qPA-ia.js";const u=JSON.parse('{"title":"属性方法","description":"","frontmatter":{},"headers":[],"relativePath":"selector/node.md","filePath":"selector/node.md","lastUpdated":1721010099000}'),r={name:"selector/node.md"},c=o('<h1 id="title" tabindex="-1">属性方法 <a class="header-anchor" href="#title" aria-label="Permalink to "属性方法 {#title}""></a></h1><p>此章节介绍各个类型可用的属性及其方法</p><h2 id="null" tabindex="-1">null <a class="header-anchor" href="#null" aria-label="Permalink to "null""></a></h2><div class="note custom-block github-alert"><p class="custom-block-title">提示</p><p><code>null</code> 无任何属性方法, 并且属性方法当调用者或者参数是 <code>null</code> 时, 均返回 <code>null</code></p></div><p>当 <code>name</code> 是 <code>null</code> 时, <code>name.length</code> 为 <code>null</code></p><p>当 <code>parent</code> 是 <code>null</code> 时, <code>parent.getChild(0)</code> 为 <code>null</code></p><p>当 <code>index</code> 是 <code>null</code> 时, <code>parent.getChild(index)</code> 为 <code>null</code></p><h2 id="boolean" tabindex="-1">boolean <a class="header-anchor" href="#boolean" aria-label="Permalink to "boolean""></a></h2><table tabindex="0"><thead><tr><th>方法名</th><th>参数</th><th>返回类型</th><th>描述</th></tr></thead><tbody><tr><td>toInt</td><td></td><td><code>int</code></td><td>转为 0 或 1</td></tr></tbody></table><h2 id="int" tabindex="-1">int <a class="header-anchor" href="#int" aria-label="Permalink to "int""></a></h2><table tabindex="0"><thead><tr><th>方法名</th><th>参数</th><th>返回类型</th><th>描述</th></tr></thead><tbody><tr><td>toString</td><td></td><td><a href="#string"><code>string</code></a></td><td>转为10进制字符串</td></tr><tr><td>toString</td><td><code>int</code></td><td><code>string</code></td><td>转为对应进制的字符串</td></tr><tr><td>plus</td><td><code>int</code></td><td><code>string</code></td><td>加上</td></tr><tr><td>minus</td><td><code>int</code></td><td><code>string</code></td><td>减去</td></tr><tr><td>times</td><td><code>int</code></td><td><code>string</code></td><td>乘以</td></tr><tr><td>div</td><td><code>int</code></td><td><code>string</code></td><td>除以</td></tr><tr><td>rem</td><td><code>int</code></td><td><code>string</code></td><td>取余</td></tr></tbody></table><h2 id="string" tabindex="-1">string <a class="header-anchor" href="#string" aria-label="Permalink to "string""></a></h2><table tabindex="0"><thead><tr><th>标识符</th><th>属性类型</th><th>描述</th></tr></thead><tbody><tr><td>length</td><td><a href="#int"><code>int</code></a></td><td>字符串长度</td></tr></tbody></table><table tabindex="0"><thead><tr><th>方法名</th><th>参数</th><th>返回类型</th><th>描述</th></tr></thead><tbody><tr><td>get</td><td><a href="#int"><code>int</code></a></td><td><code>string</code></td><td>获取对应索引字符串</td></tr><tr><td>at</td><td><code>int</code></td><td><code>string</code></td><td>同上,但是参数传负数时从最后一个字符取</td></tr><tr><td>substring</td><td><code>int</code></td><td><code>string</code></td><td>截取指定索引到结尾字符串</td></tr><tr><td>substring</td><td><code>int</code>,<code>int</code></td><td><code>string</code></td><td>截取指定间隔字符串</td></tr><tr><td>toInt</td><td></td><td><code>int</code></td><td>转为10进制数字</td></tr><tr><td>toInt</td><td><code>int</code></td><td><code>int</code></td><td>转为指定进制的数字</td></tr><tr><td>indexOf</td><td><code>string</code></td><td><code>int</code></td><td>查找指定字符串的索引</td></tr><tr><td>indexOf</td><td><code>string</code>,<code>int</code></td><td><code>int</code></td><td>从指定索引开始查找指定字符串的索引</td></tr></tbody></table><h2 id="node" tabindex="-1">node <a class="header-anchor" href="#node" aria-label="Permalink to "node""></a></h2><div class="important custom-block github-alert"><p class="custom-block-title">重要提示</p><p>此类型下以 _ 开头的属性只能在网页快照调试工具上使用, 真机不可用</p></div><table tabindex="0"><thead><tr><th>标识符</th><th>属性类型</th><th>描述</th></tr></thead><tbody><tr><td>_id</td><td><a href="#int"><code>int</code></a></td><td></td></tr><tr><td>_pid</td><td><code>int</code></td><td></td></tr><tr><td>id</td><td><a href="#string"><code>string</code></a></td><td></td></tr><tr><td>vid</td><td><code>string</code></td><td></td></tr><tr><td>name</td><td><code>string</code></td><td></td></tr><tr><td>text</td><td><code>string</code></td><td></td></tr><tr><td>desc</td><td><code>string</code></td><td></td></tr><tr><td>clickable</td><td><code>boolean</code></td><td></td></tr><tr><td>focusable</td><td><code>boolean</code></td><td></td></tr><tr><td>checkable</td><td><code>boolean</code></td><td></td></tr><tr><td>checked</td><td><code>boolean</code></td><td></td></tr><tr><td>editable</td><td><code>boolean</code></td><td></td></tr><tr><td>longClickable</td><td><code>boolean</code></td><td></td></tr><tr><td>visibleToUser</td><td><code>boolean</code></td><td></td></tr><tr><td>left</td><td><code>int</code></td><td></td></tr><tr><td>top</td><td><code>int</code></td><td></td></tr><tr><td>right</td><td><code>int</code></td><td></td></tr><tr><td>bottom</td><td><code>int</code></td><td></td></tr><tr><td>width</td><td><code>int</code></td><td></td></tr><tr><td>height</td><td><code>int</code></td><td></td></tr><tr><td>childCount</td><td><code>int</code></td><td></td></tr><tr><td>index</td><td><code>int</code></td><td></td></tr><tr><td>depth</td><td><code>int</code></td><td></td></tr><tr><td>parent</td><td><a href="#node"><code>node</code></a></td><td>获取父节点</td></tr></tbody></table><table tabindex="0"><thead><tr><th>方法名</th><th>参数</th><th>返回类型</th><th>描述</th></tr></thead><tbody><tr><td>getChild</td><td>int</td><td><a href="#node"><code>node</code></a></td><td>获取指定索引的子节点</td></tr></tbody></table><h2 id="context" tabindex="-1">context <a class="header-anchor" href="#context" aria-label="Permalink to "context""></a></h2><p>context 具有 <a href="#node">node</a> 的所有属性方法, 下面只介绍额外属性方法</p><table tabindex="0"><thead><tr><th>标识符</th><th>属性类型</th><th>描述</th></tr></thead><tbody><tr><td>prev</td><td><a href="#context"><code>context</code></a></td><td>右侧属性选择器的节点上下文 <br> 最右侧的 prev=null</td></tr></tbody></table><p>例 <code>FrameLayout[prev.name$='ImageView'] > ImageView</code> 中的 prev 就是 FrameLayout 右侧的 ImageView</p><table tabindex="0"><thead><tr><th>方法名</th><th>参数</th><th>返回类型</th><th>描述</th></tr></thead><tbody><tr><td>getPrev</td><td>int</td><td><a href="#context"><code>context</code></a></td><td>快捷获取深层 prev <br> getPrev(0) -> prev <br> getPrev(1) -> prev.prev <br> getPrev(2) -> prev.prev.prev</td></tr></tbody></table>',23),a=[c];function n(i,h,l,s,b,p){return e(),d("div",null,a)}const m=t(r,[["render",n]]);export{u as __pageData,m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as d,o as e,a4 as o}from"./chunks/framework.B8qPA-ia.js";const u=JSON.parse('{"title":"属性方法","description":"","frontmatter":{},"headers":[],"relativePath":"selector/node.md","filePath":"selector/node.md","lastUpdated":
|
|
1
|
+
import{_ as t,c as d,o as e,a4 as o}from"./chunks/framework.B8qPA-ia.js";const u=JSON.parse('{"title":"属性方法","description":"","frontmatter":{},"headers":[],"relativePath":"selector/node.md","filePath":"selector/node.md","lastUpdated":1721010099000}'),r={name:"selector/node.md"},c=o("",23),a=[c];function n(i,h,l,s,b,p){return e(),d("div",null,a)}const m=t(r,[["render",n]]);export{u as __pageData,m as default};
|
package/.vitepress/dist/assets/{selector_optimize.md.C27ufCHJ.js → selector_optimize.md.BeNl8sFy.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,c as o,o as t,a4 as c}from"./chunks/framework.B8qPA-ia.js";const b=JSON.parse('{"title":"查询优化","description":"","frontmatter":{},"headers":[],"relativePath":"selector/optimize.md","filePath":"selector/optimize.md","lastUpdated":
|
|
1
|
+
import{_ as e,c as o,o as t,a4 as c}from"./chunks/framework.B8qPA-ia.js";const b=JSON.parse('{"title":"查询优化","description":"","frontmatter":{},"headers":[],"relativePath":"selector/optimize.md","filePath":"selector/optimize.md","lastUpdated":1721010099000}'),d={name:"selector/optimize.md"},i=c('<h1 id="title" tabindex="-1">查询优化 <a class="header-anchor" href="#title" aria-label="Permalink to "查询优化 {#title}""></a></h1><p>一些关于查询优化的说明</p><h2 id="query-root" tabindex="-1">查找根节点 <a class="header-anchor" href="#query-root" aria-label="Permalink to "查找根节点 {#query-root}""></a></h2><p>选择器通过满足下列格式的属性选择器标识根节点</p><ul><li><code>[parent=null]</code></li><li><code>A[id='xxx'][parent=null][text='xxx']</code></li></ul><p>即只需存在一个 <code>[parent=null]</code> 就满足条件, 以下是对此的优化</p><h3 id="enforce" tabindex="-1">主动查询 <a class="header-anchor" href="#enforce" aria-label="Permalink to "主动查询 {#enforce}""></a></h3><p>一般的选择器如 <code>LinearLayout > TextView</code>, 选择器需要从 根节点/事件节点 使用深度先序顺序遍历子孙节点并判断是否满足条件</p><p>如果屏幕上有 n 个节点, 判断逻辑需要运行 n 次</p><p>但是如果选择器是类似 <code>TextView <3 LinearLayout <2 [parent=null]</code>, 由于在右侧标明了从根节点查找</p><p>因此上面的 <code>深度先序顺序遍历子孙节点</code> 将省略, 只进行一次判断, 不需要判断 n 次</p><p>但是如果你在子查询里使用 <code><<n</code>, 例如 <code>TextView <<n [parent=null]</code></p><p>根据上面说明的优化, 虽然也只有一次判断, 但是由于 <code><<n</code> 导致内部的子判断也是 n 次, 实际上没有优化判断次数</p><p>实际上, 在初始匹配节点是 根节点 的情况下, <code>TextView</code> 和 <code>@TextView <<n [parent=null]</code> 完全等价</p><h3 id="ancestor" tabindex="-1">祖先节点 <a class="header-anchor" href="#ancestor" aria-label="Permalink to "祖先节点 {#ancestor}""></a></h3><p>在示例 <code>A <3 [parent=null] >n TextView</code> 中, 选择器找到 <code>TextView</code> 后, 根据 <code>>n</code> 表示任意祖先节点</p><p>在默认情况下, 如果 <code>TextView</code> 的层级很深, 那必然需要多次调用 获取父节点 才能最终匹配</p><p>但是如果左侧的选择器是 <code>[parent=null] >n</code>, 这表示找到根节点, 选择器此时不会去执行多次调用 获取父节点</p><p>在 GKD 内部, 根节点可以直接通过 API 获取, 因此 <code>[parent=null] >n</code> 只需要调用一次方法</p><h2 id="fast-query" tabindex="-1">快速查询 <a class="header-anchor" href="#fast-query" aria-label="Permalink to "快速查询 {#fast-query}""></a></h2><div class="tip custom-block github-alert"><p class="custom-block-title">提示</p><p>此优化需要设置 <a href="/api/interfaces/RawCommonProps#fastquery">fastQuery</a> 来启用</p></div><p>一般情况下, 选择器 <code>[vid="name"]</code> 需要从 根节点/事件节点 使用深度先序顺序遍历子孙节点并判断是否满足条件</p><p>但是 Android 提供了如下两个快速获取节点的 Api</p><ul><li><a href="https://developer.android.google.cn/reference/android/view/accessibility/AccessibilityNodeInfo#findAccessibilityNodeInfosByViewId(java.lang.String)" target="_blank" rel="noreferrer">findAccessibilityNodeInfosByViewId</a></li><li><a href="https://developer.android.google.cn/reference/android/view/accessibility/AccessibilityNodeInfo#findAccessibilityNodeInfosByText(java.lang.String)" target="_blank" rel="noreferrer">findAccessibilityNodeInfosByText</a></li></ul><p>这使得可以通过 <code>id</code>/<code>vid</code>/<code>text</code> 直接获取子孙节点</p><p>对此我们需要规定符合特定条件的选择器来调用这些 Api 从而跳过手动遍历子孙节点</p><p>所有 <code>末尾属性选择器</code>的<code>第一个属性选择表达式</code>符合下面的结构之一</p><ul><li><code>[id='abc']</code></li><li><code>[vid='abc']</code></li><li><code>[text='abc']</code></li><li><code>[text^='abc']</code></li><li><code>[text*='abc']</code></li><li><code>[text$='abc']</code></li></ul><p>或者使用 <code>||</code> 将它们连接形成的逻辑表达式也符合条件, 即如下格式</p><ul><li><code>[id='abc' || id='abc2']</code></li><li><code>[id='abc' || vid='abc' || text='abc' || text^='abc' || text*='abc' || text$='abc']</code></li></ul><p>这些规定的格式都是为了提取 <code>id</code>/<code>vid</code>/<code>text</code> 来调用上面的两个 Android Api</p><p>下面给出实际示例: ✅ 表示符合格式, ❎ 表示不符合格式</p><ul><li><code>A > B + C[id='x'][childCount=2]</code> ✅</li><li><code>A > B + C[childCount=2][id='x']</code> ❎</li><li><code>A > B + C[id='x' || text='manbaout' || text*='ikun'][childCount=2]</code> ✅</li><li><code>A > B + C[childCount=2][id='x' || text='manbaout' || text*='ikun']</code> ❎</li></ul><p>这样一个选择器只能在右侧使用快速查询, 为了在中间的子选择器也能使用</p><p>额外规定如果属性选择器如果符合上面格式并且右侧是 <code><<n</code>, 也能在局部使用快速查找</p><p>示例 <code>A > B + C[id='x'][childCount=2] <<n D</code> 中的 <code>C[id='x'][childCount=2] <<n</code> 可以使用局部快速查找</p><div class="tip custom-block github-alert"><p class="custom-block-title">提示</p><p>实际上从根节点开始匹配的选择器如 <code>A > B</code> 都可等价为 <code>A > @B <<n [parent=null]</code></p></div><p>下面给出满足局部查询优化的示例: ✅ 表示符合格式, ❎ 表示不符合格式</p><ul><li><code>A > B + C[id='x'][childCount=2] <<n D</code> ✅</li><li><code>A > B + C[childCount=2][id='x'] <<n D</code> ❎</li></ul><p>上面介绍的是只有一个局部选择器的情况, 下面给出多个局部快速查找的的示例</p><p>如 <code>A > C[id='x'] <<n D[id='y'] <<n E</code>, 其中的 <code>C[id='x'] <<n</code> 和 <code>D[id='y'] <<n</code> 都可以使用局部快速查找</p><hr><p>以 <a href="https://i.gkd.li/i/16201605?gkd=W3ZpZD0iaW1hZ2UiXSA8PG4gW3ZpZD0icmVjeWNsZXJWaWV3Il0gPDxuIFt2aWQ9ImNvbnRlbnRfbGF5b3V0Il0" target="_blank" rel="noreferrer"><code>[vid="image"] <<n [vid="recyclerView"] <<n [vid="content_layout"]</code></a> 为例</p><p>上面的选择器存在 3 个快速查找优化</p><ul><li><code>[vid="content_layout"]</code> 从 根节点 优化查询找到 <code>content_layout</code></li><li><code>[vid="recyclerView"]</code> 从 <code>content_layout</code> 优化查询找到 <code>recyclerView</code></li><li><code>[vid="image"]</code> 从 <code>recyclerView</code> 优化查询找到 <code>image</code></li></ul><p>也就是只需要调用 <code>findAccessibilityNodeInfosByViewId</code> 3 次即可得到目标节点</p><p>如果是从根节点开始查询, 根据快照内的 选择器路径视图</p><ul><li><code>[vid="content_layout"]</code> 从 根节点 需要 7 次找到 <code>content_layout</code></li><li><code>[vid="recyclerView"]</code> 从 <code>content_layout</code> 需要 48 次找到 <code>recyclerView</code></li><li><code>[vid="image"]</code> 从 <code>recyclerView</code> 需要 44 次找到 <code>image</code></li></ul>',48),l=[i];function a(n,r,p,u,s,h){return t(),o("div",null,l)}const f=e(d,[["render",a]]);export{b as __pageData,f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,c as o,o as t,a4 as c}from"./chunks/framework.B8qPA-ia.js";const b=JSON.parse('{"title":"查询优化","description":"","frontmatter":{},"headers":[],"relativePath":"selector/optimize.md","filePath":"selector/optimize.md","lastUpdated":
|
|
1
|
+
import{_ as e,c as o,o as t,a4 as c}from"./chunks/framework.B8qPA-ia.js";const b=JSON.parse('{"title":"查询优化","description":"","frontmatter":{},"headers":[],"relativePath":"selector/optimize.md","filePath":"selector/optimize.md","lastUpdated":1721010099000}'),d={name:"selector/optimize.md"},i=c("",48),l=[i];function a(n,r,p,u,s,h){return t(),o("div",null,l)}const f=e(d,[["render",a]]);export{b as __pageData,f as default};
|