-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #159 from GuoXiCheng/dev-c
Dev c
- Loading branch information
Showing
8 changed files
with
1,886 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { withMermaid } from "vitepress-plugin-mermaid"; | ||
import { defineConfig } from "vitepress"; | ||
export default defineConfig( | ||
withMermaid({ | ||
// 站点级选项 | ||
title: "SKIP", | ||
description: "Just playing around.", | ||
base: "/", | ||
themeConfig: { | ||
outline: { | ||
level: "deep", | ||
}, | ||
nav: [ | ||
{ text: "首页", link: "/" }, | ||
{ text: "指南", link: "/guide/intro/what-is-skip" }, | ||
{ text: "下载", link: "/download/app-download/index" }, | ||
], | ||
sidebar: { | ||
"/guide/": [ | ||
{ | ||
text: "简介", | ||
items: [ | ||
{ | ||
text: "什么是 SKIP", | ||
link: "/guide/intro/what-is-skip", | ||
}, | ||
], | ||
}, | ||
{ | ||
text: "使用方法", | ||
items: [ | ||
{ | ||
text: "启用无障碍服务", | ||
link: "/guide/usage/enable-accessibility-service", | ||
}, | ||
{ | ||
text: "后台进程保活", | ||
link: "/guide/usage/background-process-keep-alive", | ||
}, | ||
], | ||
}, | ||
{ | ||
text: "贡献指南", | ||
items: [ | ||
{ | ||
text: "核心逻辑", | ||
link: "/guide/contributing/core-logic", | ||
}, | ||
{ | ||
text: "配置文件", | ||
link: "/guide/contributing/config-file", | ||
}, | ||
{ | ||
text: "布局查看", | ||
link: "/guide/contributing/layout-view", | ||
}, | ||
], | ||
}, | ||
], | ||
"/download/": [ | ||
{ | ||
text: "下载 APP", | ||
items: [ | ||
{ | ||
text: "下载方式", | ||
link: "/download/app-download/index", | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
}) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# 配置文件 | ||
|
||
配置文件是一个 YAML 文件,用于根据不同的 App 应用不同的配置。 | ||
|
||
配置文件位置:[配置文件](https://github.com/GuoXiCheng/SKIP/blob/main/app/src/main/assets/skip_config_v2.yaml) | ||
|
||
## 配置文件选项 | ||
|
||
### packageName(必填) | ||
|
||
应用包名称。 | ||
|
||
在 SKIP 的应用白名单中,可以查看应用的包名。 | ||
|
||
### skipTexts (选填) | ||
|
||
根据文本匹配,当节点的文本**包含**指定字符串时,执行点击动作。可以配置多组。 | ||
|
||
在手机屏幕上看到的文本是什么就可以填什么,但是实际节点 text = null 时,会失效。 | ||
|
||
```yaml | ||
- packageName: com.xxx.xxx | ||
skipTexts: | ||
- text: 跳过广告 | ||
length: 4 | ||
``` | ||
|
||
### skipIds (选填) | ||
|
||
根据 id 匹配,当节点的 id **等于**指定字符串时,执行点击动作。可以配置多组。 | ||
|
||
id 需要使用 Android 布局分析工具查询,但实际节点 id = null 时,不可用。 | ||
|
||
```yaml | ||
- packageName: com.xxx.xxx | ||
skipIds: | ||
- id: com.xxx.xxx:id/view_count_down | ||
``` | ||
|
||
### skipBounds(选填) | ||
|
||
根据 bounds 匹配,当所设定的 bounds **包含**节点的 bounds 时,执行点击动作。可以配置多组。 | ||
|
||
一般可交互的节点都会具有 bounds,需要使用 Android 布局分析工具查询。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 核心逻辑 | ||
|
||
## 实现原理 | ||
|
||
利用 Android 无障碍服务,获取当前窗口对象,遍历窗口节点,当节点符合指定条件时,执行点击的动作。 | ||
|
||
## 核心逻辑 | ||
|
||
主要分为以下几个步骤: | ||
|
||
```mermaid | ||
graph | ||
A[根据text查找节点] --> B{是否存在} | ||
B -- 是 --> C[点击节点] | ||
B -- 否 --> D[根据id查找节点] --> E{是否存在} | ||
E -- 是 --> C | ||
E -- 否 --> F[根据bounds查找节点] --> G{是否存在} | ||
G -- 是 --> C | ||
G -- 否 --> H[结束] | ||
classDef default color:#fff; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# 布局查看 | ||
|
||
使用布局查看器可以探查屏幕节点的布局结构,例如使用[web-editor](https://github.com/alibaba/web-editor)或 Android Studio 的布局查看器。 | ||
|
||
## 应用布局参考图 | ||
|
||
当选中想要的目标节点时,会显示该节点的布局结构,参考如下: | ||
|
||
![应用布局参考图](/layout-reference.png) | ||
|
||
### 配置 skipTexts 和 skipIds | ||
|
||
text 呈现的值,可以对应到配置文件中的 text | ||
|
||
resourceId 呈现的值,可以对应到配置文件中的 id | ||
|
||
### 配置 skipBounds | ||
|
||
skipBounds 的值是需要计算得到的,可能长得像这样 | ||
|
||
```yaml | ||
- packageName: com.xxx.xxx | ||
skipBounds: | ||
- bound: 1223,196,1384,308 | ||
resolution: 1440,3024 | ||
``` | ||
|
||
其中的 1440,3024 是你当前手机屏幕的最大宽高。 | ||
|
||
其中的 1223,196,1384,308 分别表示一个节点在屏幕中的: left,top,right,bottom | ||
|
||
参考上图中 rect 的信息: left=x,top=y,right=x+width,bottom=y+height | ||
|
||
![Android屏幕节点布局](/android-rect.png) |
Oops, something went wrong.