Skip to content

Commit

Permalink
Merge pull request #159 from GuoXiCheng/dev-c
Browse files Browse the repository at this point in the history
Dev c
  • Loading branch information
GuoXiCheng committed Jun 7, 2024
2 parents 947d708 + 21efe44 commit e518045
Show file tree
Hide file tree
Showing 8 changed files with 1,886 additions and 202 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ SKIP 是一款免费开源的安卓应用,旨在利用 Android 无障碍服务
## 使用说明

- 点击屏幕中心按钮跳转无障碍服务界面,打开无障碍服务即可
- 源代码透明公开,0项隐私权限申请,完全免费无套路,下载请戳 👉 [SKIP Docs](https://guoxicheng.top/projects/SKIP-Docs/)
- 源代码透明公开,0 项隐私权限申请,完全免费无套路,下载请戳 👉 [SKIP Docs](https://skip.guoxicheng.top/)
- 目前小米/红米手机完美运行,其他品牌手机请自行测试
- 如果对你有帮助的话可以给颗小星星,感谢支持

## 如何贡献

- 应用市场APP种类繁多,情况各异,无法保证完全适配
- 如有问题可以提交issue,或者参考 👉 [贡献指南](https://guoxicheng.top/projects/SKIP-Docs/contribute.html)
- 应用市场 APP 种类繁多,情况各异,无法保证完全适配
- 如有问题可以提交 issue。

## Star History

Expand All @@ -27,4 +27,3 @@ SKIP 是一款免费开源的安卓应用,旨在利用 Android 无障碍服务
## 许可证

[MIT License](https://github.com/GuoXiCheng/SKIP/blob/main/LICENSE)

43 changes: 0 additions & 43 deletions docs/.vitepress/config.js

This file was deleted.

74 changes: 74 additions & 0 deletions docs/.vitepress/config.mts
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",
},
],
},
],
},
},
})
);
44 changes: 44 additions & 0 deletions docs/guide/contributing/config-file.md
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 布局分析工具查询。
22 changes: 22 additions & 0 deletions docs/guide/contributing/core-logic.md
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;
```
34 changes: 34 additions & 0 deletions docs/guide/contributing/layout-view.md
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)
Loading

0 comments on commit e518045

Please sign in to comment.