# guoxicheng/skip architecture

> Architecture diagram of the GitHub repository guoxicheng/skip, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/guoxicheng/skip
- Repository: https://github.com/guoxicheng/skip

## Overview

1. **Repository shape**
   - This is a multi-part project centered on an Android app called **SKIP**, plus a **documentation site** and a small **TypeScript tooling/scripts** area.
   - The Android app is the core runtime; the docs and scripts support release, configuration validation, and user guidance.

2. **Primary product boundary: Android app**
   - The app lives under `app/` and is built with **Kotlin + Android Gradle**.
   - It uses a fairly standard layered pattern: **UI (Compose-based screens/buttons/dialogs)** → **ViewModels** → **Repositories** → **platform/network/storage services**.
   - Shared model types are in `dataclass/`, which define the data passed between layers.

3. **Core user-facing purpose**
   - SKIP’s main job is to use Android **Accessibility Services** to detect and interact with splash-screen ad UI, especially “skip” buttons.
   - The top-level app flow is oriented around enabling accessibility, keeping the app alive in the background, configuring rules, and inspecting UI nodes when needed.

4. **System services and runtime persistence**
   - The architectural center of the app is in `service/`:
     - `MyAccessibilityService` is the main automation entry point.
     - `MyForegroundService` and `FloatingWindowService` keep the process alive and provide overlay behavior.
     - `InspectService` and `AccessibilityInspectRepository/ViewModel` support inspection/debugging of accessibility trees.
   - These services are the bridge between the Android system and the app’s rule/config logic.

5. **Main screen flows**
   - `ui/main/` is the landing area, with buttons and dialogs for:
     - enabling accessibility,
     - showing the tutorial,
     - showing the disclaimer.
   - `ui/alive/` manages background survival features such as a notification bar and backstage mode.
   - `ui/about/` exposes update/config-related actions and app metadata.

6. **Inspection and debugging subsystem**
   - `ui/inspect/` and `service/InspectService` form a separate inspection workflow for analyzing accessible nodes.
   - `ui/record/` stores and browses captured inspection records, including screenshots or node snapshots.
   - The `capture/` zip files in the repo appear to be sample inspection artifacts, likely used for testing or documentation.
   - This subsystem is distinct from the “automatic skip” path and is more for debugging rules and layout behavior.

7. **Whitelist and app selection**
   - `ui/whitelist/` manages which apps are eligible for SKIP behavior.
   - It includes:
     - a paged app list,
     - search/filtering,
     - a system-app visibility toggle.
   - This is an important control boundary: automation is not applied globally without user curation.

8. **Configuration and rules pipeline**
   - The app ships with built-in config files in `app/src/main/assets/`:
     - `skip_config.yaml`,
     - `skip_config_v2.yaml`,
     - `skip_config_v3.yaml`,
     - `skip_config_v3.json`.
   - `data/config/` handles loading and reading these rule sets, while `ConfigViewModel` and related repositories feed the UI.
   - The README also advertises a hosted subscription URL, so config is designed to be **updatable externally** rather than hardcoded only in the APK.

9. **Versioning and auto-update flow**
   - `data/version/` and `ui/settings/update/` provide update/version checks.
   - `data/download/` handles APK download, suggesting the app can fetch a newer release directly from the network.
   - `MyApiNetwork`, `ServiceCreator`, and `MyApiService` isolate network access from the rest of the app.
   - This makes update checks and downloads a separate concern from the accessibility automation logic.

10. **Persistence and local state**
   - `util/DataStoreUtils.kt` indicates local preference/state persistence via Android DataStore.
   - Settings features such as theme switching, strict mode, recent items, tips, and auto-update likely persist user preferences here.
   - `util/NetworkUtils.kt`, `AccessibilityStateUtils.kt`, and `DebounceHelper.kt` are cross-cutting helpers used across UI and service flows.

11. **UI architecture style**
   - The app is organized into feature folders with repeated patterns:
     - `Activity` as entry point,
     - `ViewModel` for state,
     - `Repository` for business/data access,
     - reusable UI components under `ui/components/`.
   - The theme system is separated in `ui/theme/`, and resource icons/layouts are in standard Android resource folders.
   - This keeps screen logic modular even though the app is behavior-heavy and service-driven.

12. **Docs site as a companion subsystem**
   - The `docs/` directory is a VitePress site documenting installation, usage, accessibility setup, white-listing, keep-alive behavior, and advanced custom config/layout inspection.
   - It also contains interactive Vue components and a small IndexedDB-based file utility layer for browsing inspection content.
   - This documentation is not just marketing; it supports the app’s most complex runtime behaviors and rule format.

13. **Release/tooling pipeline**
   - `scripts/` is a TypeScript toolchain used to validate YAML/config and release-related files.
   - The tests under `scripts/__tests__/` include many malformed examples, which indicates the project has strict schema validation for config files and packaged APK assets.
   - The `.github/workflows/deploy.yml` workflow suggests automated deployment, likely for docs or release artifacts.

14. **High-level data flow**
   - User input starts in Compose screens.
   - ViewModels call repositories to read/write DataStore, load config, check versions, or trigger downloads.
   - Accessibility services consume the selected config rules and the current app’s node tree to decide whether/how to interact.
   - Inspection/recording paths capture UI structure for later analysis, and the docs/scripts help maintain and validate those artifacts.

15. **What to draw as the main architectural boundaries**
   - Draw three major zones:
     - **Android runtime app**: UI, services, repositories, config, persistence.
     - **External data sources**: hosted config subscription, version/download endpoint, Android system accessibility/overlay APIs.
     - **Supporting ecosystem**: docs site and release/config validation scripts.
   - The most important dependency direction is from **UI/settings/config** into the **accessibility service layer**, because the app’s core function depends on those rules being available to the service at runtime.

Main entry points: [`app/src/main/java/com/android/skip/data/config/ConfigLoadRepository.kt`](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/data/config/ConfigLoadRepository.kt) (Config data), [`app/src/main/java/com/android/skip/service/MyAccessibilityService.kt`](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/service/MyAccessibilityService.kt) (Accessibility service), [`app/src/main/java/com/android/skip/data/version/ApkVersionRepository.kt`](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/data/version/ApkVersionRepository.kt) (Update data), [`app/src/main/java/com/android/skip/service/AccessibilityInspectRepository.kt`](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/service/AccessibilityInspectRepository.kt) (Inspection core)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_android_app["Android app"]
  node_app_shell["App shell<br/>Android app<br/>[MyApp.kt]"]
  node_main_ui["Main screen<br/>Compose UI<br/>[MainActivity.kt]"]
  node_alive_ui["Keep alive<br/>UI/runtime<br/>[AliveActivity.kt]"]
  node_about_ui["About screen<br/>UI/settings<br/>[AboutActivity.kt]"]
  node_settings_ui["Settings<br/>UI/preferences"]
  node_whitelist_ui["Whitelist<br/>UI/control"]
  node_inspect_ui["Inspect UI<br/>UI/debug<br/>[InspectActivity.kt]"]
  node_record_ui["Records<br/>UI/history"]
  node_config_data[("Config data<br/>Rules/data")]
  node_version_download[("Update data<br/>Version/download")]
  node_network_api["API client<br/>Network<br/>[ServiceCreator.kt]"]
  node_persistence_utils["Local state<br/>Persistence/helpers<br/>[DataStoreUtils.kt]"]
  node_automation_service{{"Accessibility service<br/>Android service"}}
  node_runtime_services{{"Runtime services<br/>Android services"}}
  node_inspection_core[("Inspection core<br/>Service/viewmodel")]
  node_shared_models["Shared models<br/>Kotlin data"]
end

subgraph group_docs_site["Docs site"]
  node_docs_content["Docs content<br/>VitePress site<br/>[index.md]"]
  node_docs_inspect["Inspect docs<br/>Vue/docs<br/>[index.md]"]
end

subgraph group_tooling["Tooling"]
  node_scripts_validation["Config checks<br/>TS validation<br/>[yaml-check.ts]"]
  node_scripts_release["Release scripts<br/>TS tooling<br/>[release-file.ts]"]
end

subgraph group_external["External systems"]
  node_android_system(("Android system<br/>OS APIs"))
  node_remote_services(("Remote endpoints<br/>Hosted config/update"))
end

node_app_shell -->|"launches"| node_main_ui
node_main_ui -->|"enable skip"| node_automation_service
node_main_ui -->|"prefs"| node_persistence_utils
node_settings_ui -->|"stores"| node_persistence_utils
node_whitelist_ui -->|"stores"| node_persistence_utils
node_about_ui -->|"checks update"| node_version_download
node_about_ui -->|"loads config"| node_config_data
node_alive_ui -->|"controls"| node_runtime_services
node_inspect_ui -->|"captures trees"| node_inspection_core
node_record_ui -->|"browses"| node_inspection_core
node_automation_service -->|"applies rules"| node_config_data
node_automation_service -->|"uses models"| node_shared_models
node_runtime_services -->|"uses"| node_android_system
node_automation_service -->|"accessibility"| node_android_system
node_inspection_core -->|"inspects UI"| node_android_system
node_config_data -->|"syncs"| node_remote_services
node_version_download -->|"requests"| node_network_api
node_network_api -->|"calls"| node_remote_services
node_docs_content -->|"documents"| node_config_data
node_docs_inspect -->|"explains"| node_inspection_core
node_scripts_validation -->|"validates"| node_config_data
node_scripts_release -->|"supports release"| node_version_download
node_scripts_validation -->|"guards inputs"| node_remote_services
node_shared_models -->|"schema"| node_config_data
node_shared_models -->|"schema"| node_version_download

click node_app_shell "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/MyApp.kt"
click node_main_ui "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/ui/main/MainActivity.kt"
click node_alive_ui "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/ui/alive/AliveActivity.kt"
click node_about_ui "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/ui/about/AboutActivity.kt"
click node_settings_ui "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/ui/settings/SettingsActivity.kt"
click node_whitelist_ui "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/ui/whitelist/WhiteListActivity.kt"
click node_inspect_ui "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/ui/inspect/InspectActivity.kt"
click node_record_ui "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/ui/record/InspectRecordActivity.kt"
click node_config_data "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/data/config/ConfigLoadRepository.kt"
click node_version_download "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/data/version/ApkVersionRepository.kt"
click node_network_api "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/data/network/ServiceCreator.kt"
click node_persistence_utils "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/util/DataStoreUtils.kt"
click node_automation_service "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/service/MyAccessibilityService.kt"
click node_runtime_services "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/service/MyForegroundService.kt"
click node_inspection_core "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/service/AccessibilityInspectRepository.kt"
click node_shared_models "https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/dataclass/ConfigReadSchema.kt"
click node_docs_content "https://github.com/guoxicheng/skip/blob/main/docs/index.md"
click node_docs_inspect "https://github.com/guoxicheng/skip/blob/main/docs/inspect/index.md"
click node_scripts_validation "https://github.com/guoxicheng/skip/blob/main/scripts/yaml-check.ts"
click node_scripts_release "https://github.com/guoxicheng/skip/blob/main/scripts/release-file.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_shell,node_main_ui,node_alive_ui,node_about_ui,node_settings_ui,node_whitelist_ui,node_inspect_ui,node_record_ui,node_config_data,node_version_download,node_network_api,node_persistence_utils,node_automation_service,node_runtime_services,node_inspection_core,node_shared_models toneBlue
class node_docs_content,node_docs_inspect toneAmber
class node_scripts_validation,node_scripts_release toneMint
class node_android_system,node_remote_services toneRose
```

## Components

### Android app

Core SKIP runtime on Android: UI, services, config, persistence, and automation.

- [App shell](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/MyApp.kt): Android app · Application entry and overall app wiring. · `app/src/main/java/com/android/skip/MyApp.kt`
- [Main screen](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/ui/main/MainActivity.kt): Compose UI · Landing flow for accessibility enablement, tutorial, and disclaimer. · `app/src/main/java/com/android/skip/ui/main/MainActivity.kt`
- [Keep alive](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/ui/alive/AliveActivity.kt): UI/runtime · Background survival controls such as notification bar and backstage mode. · `app/src/main/java/com/android/skip/ui/alive/AliveActivity.kt`
- [About screen](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/ui/about/AboutActivity.kt): UI/settings · App info plus version and config update actions. · `app/src/main/java/com/android/skip/ui/about/AboutActivity.kt`
- [Settings](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/ui/settings/SettingsActivity.kt): UI/preferences · User preferences for theme, strict mode, tips, recent items, and auto-update. · `app/src/main/java/com/android/skip/ui/settings/SettingsActivity.kt`
- [Whitelist](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/ui/whitelist/WhiteListActivity.kt): UI/control · App selection boundary for where automation is allowed. · `app/src/main/java/com/android/skip/ui/whitelist/WhiteListActivity.kt`
- [Inspect UI](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/ui/inspect/InspectActivity.kt): UI/debug · Screen for starting inspection, floating controls, and record capture. · `app/src/main/java/com/android/skip/ui/inspect/InspectActivity.kt`
- [Records](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/ui/record/InspectRecordActivity.kt): UI/history · Browsing and viewing captured inspection records and screenshots. · `app/src/main/java/com/android/skip/ui/record/InspectRecordActivity.kt`
- [Config data](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/data/config/ConfigLoadRepository.kt): Rules/data · Loads and reads built-in and externally updated skip rules. · `app/src/main/java/com/android/skip/data/config/ConfigLoadRepository.kt`
- [Update data](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/data/version/ApkVersionRepository.kt): Version/download · Checks release versions and downloads APK updates. · `app/src/main/java/com/android/skip/data/version/ApkVersionRepository.kt`
- [API client](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/data/network/ServiceCreator.kt): Network · Retrofit-style service creation and remote API access. · `app/src/main/java/com/android/skip/data/network/ServiceCreator.kt`
- [Local state](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/util/DataStoreUtils.kt): Persistence/helpers · DataStore-backed settings and shared cross-cutting utilities. · `app/src/main/java/com/android/skip/util/DataStoreUtils.kt`
- [Accessibility service](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/service/MyAccessibilityService.kt): Android service · Main automation entry point that detects and interacts with ad UI. · `app/src/main/java/com/android/skip/service/MyAccessibilityService.kt`
- [Runtime services](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/service/MyForegroundService.kt): Android services · Foreground, floating-window, and inspection services that keep the app alive and expose system overlays. · `app/src/main/java/com/android/skip/service/MyForegroundService.kt`
- [Inspection core](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/service/AccessibilityInspectRepository.kt): Service/viewmodel · Captures and exposes accessibility trees for debugging and rule analysis. · `app/src/main/java/com/android/skip/service/AccessibilityInspectRepository.kt`
- [Shared models](https://github.com/guoxicheng/skip/blob/main/app/src/main/java/com/android/skip/dataclass/ConfigReadSchema.kt): Kotlin data · Data carriers for configs, versions, app lists, nodes, and records. · `app/src/main/java/com/android/skip/dataclass/ConfigReadSchema.kt`

### Docs site

VitePress documentation and interactive inspection views.

- [Docs content](https://github.com/guoxicheng/skip/blob/main/docs/index.md): VitePress site · Guides, advanced config docs, and layout inspection documentation. · `docs/index.md`
- [Inspect docs](https://github.com/guoxicheng/skip/blob/main/docs/inspect/index.md): Vue/docs · Interactive inspection UI and ZIP browsing helpers in the docs site. · `docs/inspect/index.md`

### Tooling

TypeScript validation and release scripts for configs and packaged artifacts.

- [Config checks](https://github.com/guoxicheng/skip/blob/main/scripts/yaml-check.ts): TS validation · YAML and release-file validation scripts with malformed fixtures. · `scripts/yaml-check.ts`
- [Release scripts](https://github.com/guoxicheng/skip/blob/main/scripts/release-file.ts): TS tooling · Release-file generation and packaging helpers. · `scripts/release-file.ts`

### External systems

Android platform APIs and remote update/config endpoints the app depends on.

- **Android system**: OS APIs · Accessibility, foreground service, overlay, notification, and storage platform capabilities.
- **Remote endpoints**: Hosted config/update · Externally hosted config subscription and APK/version download endpoints.

## Connections

- App shell → Main screen: launches · Starts the primary user-facing flow.
- Main screen → Accessibility service: enable skip · Routes the user toward accessibility activation and runtime automation.
- Main screen → Local state: prefs · Reads and writes local user state.
- Settings → Local state: stores · Persists theme, strict mode, tips, recent, and update preferences.
- Whitelist → Local state: stores · Saves app-selection and visibility choices.
- About screen → Update data: checks update · Triggers version lookup and APK download flows.
- About screen → Config data: loads config · Surfaces configuration version and refresh actions.
- Keep alive → Runtime services: controls · Starts keep-alive and overlay behavior.
- Inspect UI → Inspection core: captures trees · Starts inspection and floating-window collection.
- Records → Inspection core: browses · Reads stored inspection records and screenshots.
- Accessibility service → Config data: applies rules · Consumes skip rules at runtime.
- Accessibility service → Shared models: uses models · Operates on shared node and config schemas.
- Runtime services → Android system: uses · Depends on foreground, overlay, notification, and service APIs.
- Accessibility service → Android system: accessibility · Integrates with Android accessibility services.
- Inspection core → Android system: inspects UI · Reads accessibility trees and related node state.
- Config data → Remote endpoints: syncs · Fetches externally updated rule/config data.
- Update data → API client: requests · Uses the API client to check versions and download APKs.
- API client → Remote endpoints: calls · Connects to hosted version and config endpoints.
- Docs content → Config data: documents · Explains installation, configuration, keep-alive, and whitelist behavior.
- Inspect docs → Inspection core: explains · Documents the inspection workflow and artifact browsing.
- Config checks → Config data: validates · Checks YAML/config structure against expected schema.
- Release scripts → Update data: supports release · Assists release artifact handling and APK versioning.
- Config checks → Remote endpoints: guards inputs · Protects external config and packaged assets from malformed data.
- Shared models → Config data: schema · Defines typed config payloads and node structures.
- Shared models → Update data: schema · Defines version and download payloads.
