# cyqawa/yunx architecture

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

- Interactive diagram: https://gitdiagram.com/cyqawa/yunx
- Repository: https://github.com/cyqawa/yunx

## Overview

YunX is an Android cloud-drive share-link resolver and downloader. The principal workflow is to paste a supported share link, identify its platform and access code, browse shared files, obtain a download link, then monitor and manage the download. Separate branches cover cloud-account login, authentication backup, settings, and the optional Gopeed engine. The README documents product behavior; source excerpts and the SOURCE INDEX support selected internal links. Several UI and provider implementations are unsampled, so their internal calls are not expanded.

Main entry points: [`app/src/main/kotlin/com/yunx/app/data/download/DownloadManager.kt`](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/download/DownloadManager.kt) (Download manager), [`app/src/main/kotlin/com/yunx/app/data/repository`](https://github.com/cyqawa/yunx/tree/master/app/src/main/kotlin/com/yunx/app/data/repository) (Platform resolvers), [`app/src/main/kotlin/com/yunx/app/ui/screens/ResolveScreen.kt`](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/ui/screens/ResolveScreen.kt) (Resolve screens), [`app/src/main/kotlin/com/yunx/app/data/prefs/SettingsRepository.kt`](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/prefs/SettingsRepository.kt) (Settings store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Android app"]
  node_main["App entry<br/>[MainActivity.kt]"]
  node_main_screen["Main screen<br/>[MainScreen.kt]"]
  node_resolve_ui["Resolve screens<br/>[ResolveScreen.kt]"]
  node_cloud_ui["Cloud drives"]
  node_download_ui["Download screen<br/>[DownloadScreen.kt]"]
  node_settings_ui["Settings<br/>[SettingsScreen.kt]"]
end

subgraph group_resolve["Share resolution"]
  node_link_parser["Link parser<br/>[ShareLinkParser.kt]"]
  node_resolve_repo["Resolve orchestration"]
  node_provider_resolvers["Platform resolvers"]
  node_provider_apis["Cloud APIs"]
end

subgraph group_downloads["Download engines"]
  node_download_manager["Download manager<br/>[DownloadManager.kt]"]
  node_chunk_downloader["Chunk downloader<br/>[ChunkDownloader.kt]"]
  node_download_service["Foreground service<br/>[DownloadService.kt]"]
  node_gopeed["Gopeed engine<br/>[GopeedEngine.kt]"]
end

subgraph group_state["Accounts and settings"]
  node_accounts["Account repositories"]
  node_database[("Room database<br/>[AppDatabase.kt]")]
  node_download_tasks["Download tasks"]
  node_settings_repo["Settings store"]
  node_auth_backup["Auth backup"]
end

node_user(("User"))
node_cloud_services{{"Cloud platforms"}}

node_user -->|"opens"| node_main
node_main -->|"renders"| node_main_screen
node_user -->|"pastes link"| node_resolve_ui
node_resolve_ui -.->|"parses"| node_link_parser
node_provider_resolvers -->|"uses"| node_link_parser
node_provider_resolvers -->|"implements"| node_resolve_repo
node_provider_resolvers -->|"requests"| node_provider_apis
node_provider_resolvers -->|"resolves links"| node_cloud_services
node_user -->|"logs in"| node_cloud_ui
node_cloud_ui -.->|"manages accounts"| node_accounts
node_user -->|"manages downloads"| node_download_ui
node_download_manager -->|"downloads chunks"| node_chunk_downloader
node_download_manager -->|"dispatches tasks"| node_gopeed
node_download_manager -->|"persists progress"| node_download_tasks
node_download_manager -->|"updates service"| node_download_service
node_download_manager -->|"reads options"| node_settings_repo
node_gopeed -->|"reads settings"| node_settings_repo
node_settings_ui -.->|"configures"| node_settings_repo
node_database -->|"registers entity"| node_download_tasks
node_auth_backup -->|"backs up accounts"| node_database
node_resolve_ui -.->|"requests resolution"| node_provider_resolvers
node_resolve_ui -->|"starts download"| node_download_manager
node_download_ui -.->|"controls tasks"| node_download_manager

click node_main "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/MainActivity.kt"
click node_main_screen "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/ui/MainScreen.kt"
click node_resolve_ui "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/ui/screens/ResolveScreen.kt"
click node_cloud_ui "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/ui/screens/CloudDriveScreen.kt"
click node_download_ui "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/ui/screens/DownloadScreen.kt"
click node_settings_ui "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/ui/screens/SettingsScreen.kt"
click node_link_parser "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/network/ShareLinkParser.kt"
click node_resolve_repo "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/repository/ShareResolveRepository.kt"
click node_provider_resolvers "https://github.com/cyqawa/yunx/tree/master/app/src/main/kotlin/com/yunx/app/data/repository"
click node_provider_apis "https://github.com/cyqawa/yunx/tree/master/app/src/main/kotlin/com/yunx/app/data/network"
click node_download_manager "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/download/DownloadManager.kt"
click node_chunk_downloader "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/download/ChunkDownloader.kt"
click node_download_service "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/download/DownloadService.kt"
click node_gopeed "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/gopeed/GopeedEngine.kt"
click node_accounts "https://github.com/cyqawa/yunx/tree/master/app/src/main/kotlin/com/yunx/app/data/repository"
click node_database "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/db/AppDatabase.kt"
click node_download_tasks "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/db/DownloadTaskEntity.kt"
click node_settings_repo "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/prefs/SettingsRepository.kt"
click node_auth_backup "https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/backup/AuthBackupManager.kt"

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_main,node_main_screen,node_resolve_ui,node_cloud_ui,node_download_ui,node_settings_ui,node_user toneBlue
class node_link_parser,node_resolve_repo,node_provider_resolvers,node_provider_apis toneAmber
class node_download_manager,node_chunk_downloader,node_download_service,node_gopeed toneMint
class node_accounts,node_database,node_download_tasks,node_settings_repo,node_auth_backup toneRose
class node_cloud_services toneIndigo
```

## Components

### Android app

- [App entry](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/MainActivity.kt): `app/src/main/kotlin/com/yunx/app/MainActivity.kt`
- [Main screen](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/ui/MainScreen.kt): `app/src/main/kotlin/com/yunx/app/ui/MainScreen.kt`
- [Resolve screens](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/ui/screens/ResolveScreen.kt): `app/src/main/kotlin/com/yunx/app/ui/screens/ResolveScreen.kt`
- [Cloud drives](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/ui/screens/CloudDriveScreen.kt): `app/src/main/kotlin/com/yunx/app/ui/screens/CloudDriveScreen.kt`
- [Download screen](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/ui/screens/DownloadScreen.kt): `app/src/main/kotlin/com/yunx/app/ui/screens/DownloadScreen.kt`
- [Settings](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/ui/screens/SettingsScreen.kt): `app/src/main/kotlin/com/yunx/app/ui/screens/SettingsScreen.kt`

### Share resolution

- [Link parser](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/network/ShareLinkParser.kt): `app/src/main/kotlin/com/yunx/app/data/network/ShareLinkParser.kt`
- [Resolve orchestration](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/repository/ShareResolveRepository.kt): `app/src/main/kotlin/com/yunx/app/data/repository/ShareResolveRepository.kt`
- [Platform resolvers](https://github.com/cyqawa/yunx/tree/master/app/src/main/kotlin/com/yunx/app/data/repository): `app/src/main/kotlin/com/yunx/app/data/repository`
- [Cloud APIs](https://github.com/cyqawa/yunx/tree/master/app/src/main/kotlin/com/yunx/app/data/network): `app/src/main/kotlin/com/yunx/app/data/network`

### Download engines

- [Download manager](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/download/DownloadManager.kt): `app/src/main/kotlin/com/yunx/app/data/download/DownloadManager.kt`
- [Chunk downloader](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/download/ChunkDownloader.kt): `app/src/main/kotlin/com/yunx/app/data/download/ChunkDownloader.kt`
- [Foreground service](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/download/DownloadService.kt): `app/src/main/kotlin/com/yunx/app/data/download/DownloadService.kt`
- [Gopeed engine](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/gopeed/GopeedEngine.kt): `app/src/main/kotlin/com/yunx/app/data/gopeed/GopeedEngine.kt`

### Accounts and settings

- [Account repositories](https://github.com/cyqawa/yunx/tree/master/app/src/main/kotlin/com/yunx/app/data/repository): `app/src/main/kotlin/com/yunx/app/data/repository`
- [Room database](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/db/AppDatabase.kt): `app/src/main/kotlin/com/yunx/app/data/db/AppDatabase.kt`
- [Download tasks](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/db/DownloadTaskEntity.kt): `app/src/main/kotlin/com/yunx/app/data/db/DownloadTaskEntity.kt`
- [Settings store](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/prefs/SettingsRepository.kt): `app/src/main/kotlin/com/yunx/app/data/prefs/SettingsRepository.kt`
- [Auth backup](https://github.com/cyqawa/yunx/blob/master/app/src/main/kotlin/com/yunx/app/data/backup/AuthBackupManager.kt): `app/src/main/kotlin/com/yunx/app/data/backup/AuthBackupManager.kt`

### Other components

- **User**
- **Cloud platforms**

## Connections

- User → App entry: opens (evidence: `README.md`)
- App entry → Main screen: renders (evidence: `app/src/main/kotlin/com/yunx/app/MainActivity.kt`)
- User → Resolve screens: pastes link (evidence: `README.md`)
- Resolve screens → Link parser: parses
- Platform resolvers → Link parser: uses (evidence: `app/src/main/kotlin/com/yunx/app/data/repository/BaiduResolveRepository.kt`)
- Platform resolvers → Resolve orchestration: implements (evidence: `app/src/main/kotlin/com/yunx/app/data/repository/QuarkResolveRepository.kt`)
- Platform resolvers → Cloud APIs: requests (evidence: `app/src/main/kotlin/com/yunx/app/data/repository/QuarkResolveRepository.kt`)
- Platform resolvers → Cloud platforms: resolves links (evidence: `README.md`)
- User → Cloud drives: logs in (evidence: `README.md`)
- Cloud drives → Account repositories: manages accounts
- User → Download screen: manages downloads (evidence: `README.md`)
- Download manager → Chunk downloader: downloads chunks (evidence: `app/src/main/kotlin/com/yunx/app/data/download/DownloadManager.kt`)
- Download manager → Gopeed engine: dispatches tasks (evidence: `app/src/main/kotlin/com/yunx/app/data/download/DownloadManager.kt`)
- Download manager → Download tasks: persists progress (evidence: `app/src/main/kotlin/com/yunx/app/data/download/DownloadManager.kt`)
- Download manager → Foreground service: updates service (evidence: `app/src/main/kotlin/com/yunx/app/data/download/DownloadManager.kt`)
- Download manager → Settings store: reads options (evidence: `app/src/main/kotlin/com/yunx/app/data/download/DownloadManager.kt`)
- Gopeed engine → Settings store: reads settings (evidence: `app/src/main/kotlin/com/yunx/app/data/gopeed/GopeedEngine.kt`)
- Settings → Settings store: configures
- Room database → Download tasks: registers entity (evidence: `app/src/main/kotlin/com/yunx/app/data/db/AppDatabase.kt`)
- Auth backup → Room database: backs up accounts (evidence: `app/src/main/kotlin/com/yunx/app/data/backup/AuthBackupManager.kt`)
- Resolve screens → Platform resolvers: requests resolution
- Resolve screens → Download manager: starts download (evidence: `README.md`)
- Download screen → Download manager: controls tasks
