# kejiyunb/hongguo architecture

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

- Interactive diagram: https://gitdiagram.com/kejiyunb/hongguo
- Repository: https://github.com/kejiyunb/hongguo

## Overview

红果综合模块是面向红果短剧 Android 客户端的 Xposed/LSPosed 体验增强模块。用户可查看适配版本、检查更新；框架加载后，模块在目标应用就绪时安装业务 Hook，提供沉浸式界面、播放手势、内容与账号相关修改等能力。Hooks.kt 承载核心业务与设置面板，TargetNames.kt 提供版本兼容映射；主界面、更新检测和日志是配套功能。功能分支主要依据 README，未抽样的 Hook 内部调用关系不作推断。

Main entry points: [`app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt`](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt) (业务 Hook 与设置面板), [`app/src/main/kotlin/xyz/kejiyu/hongguo/MainHook.kt`](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/MainHook.kt) (模块生命周期入口), [`app/src/main/kotlin/xyz/kejiyu/hongguo/MainActivity.kt`](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/MainActivity.kt) (模块主界面), [`app/src/main/kotlin/xyz/kejiyu/hongguo/UpdateChecker.kt`](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/UpdateChecker.kt) (更新检测)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["入口与面板"]
  node_activity["模块主界面<br/>[MainActivity.kt]"]
end

subgraph group_hooking["Hook 注入"]
  node_mapping["版本映射<br/>[TargetNames.kt]"]
  node_mainhook["模块生命周期入口<br/>[MainHook.kt]"]
  node_hooks["业务 Hook 与设置面板<br/>[Hooks.kt]"]
end

subgraph group_playback["播放体验"]
  node_immersive["沉浸式界面精简<br/>[Hooks.kt]"]
  node_playback_features["画质与倍速<br/>[Hooks.kt]"]
  node_gestures["播放手势拦截<br/>[Hooks.kt]"]
end

subgraph group_content["内容与工具"]
  node_ads["广告与挂件拦截<br/>[Hooks.kt]"]
  node_vip["VIP 权益 Hook<br/>[Hooks.kt]"]
  node_tools["实验功能与快捷工具<br/>[Hooks.kt]"]
end

subgraph group_support["配套服务"]
  node_updates["更新检测<br/>[UpdateChecker.kt]"]
  node_logs[("日志与诊断<br/>[LogUtil.kt]")]
end

node_user(("用户"))
node_framework(("Xposed 框架"))
node_target(("红果客户端"))
node_github(("GitHub Releases"))

node_user -->|"操作"| node_activity
node_activity -->|"读取适配版本"| node_mapping
node_activity -->|"检查更新"| node_updates
node_updates -->|"查询发行版"| node_github
node_framework -->|"触发生命周期"| node_mainhook
node_mainhook -->|"安装业务 Hook"| node_hooks
node_mainhook -->|"启动更新检查"| node_updates
node_mainhook -->|"记录运行日志"| node_logs
node_target -->|"承载注入功能"| node_hooks
node_hooks -->|"精简界面"| node_immersive
node_hooks -->|"优化播放"| node_playback_features
node_hooks -->|"拦截手势"| node_gestures
node_hooks -->|"拦截广告挂件"| node_ads
node_hooks -->|"Hook 权益状态"| node_vip
node_hooks -->|"提供实验工具"| node_tools

click node_activity "https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/MainActivity.kt"
click node_mapping "https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/TargetNames.kt"
click node_mainhook "https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/MainHook.kt"
click node_hooks "https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt"
click node_immersive "https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt"
click node_playback_features "https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt"
click node_gestures "https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt"
click node_ads "https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt"
click node_vip "https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt"
click node_tools "https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt"
click node_updates "https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/UpdateChecker.kt"
click node_logs "https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/LogUtil.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_activity toneBlue
class node_mapping,node_mainhook,node_hooks toneAmber
class node_immersive,node_playback_features,node_gestures toneMint
class node_ads,node_vip,node_tools toneRose
class node_updates,node_logs,node_user,node_framework,node_target,node_github toneIndigo
```

## Components

### 入口与面板

- [模块主界面](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/MainActivity.kt): `app/src/main/kotlin/xyz/kejiyu/hongguo/MainActivity.kt`

### Hook 注入

- [版本映射](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/TargetNames.kt): `app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/TargetNames.kt`
- [模块生命周期入口](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/MainHook.kt): `app/src/main/kotlin/xyz/kejiyu/hongguo/MainHook.kt`
- [业务 Hook 与设置面板](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt): `app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt`

### 播放体验

- [沉浸式界面精简](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt): `app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt`
- [画质与倍速](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt): `app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt`
- [播放手势拦截](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt): `app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt`

### 内容与工具

- [广告与挂件拦截](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt): `app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt`
- [VIP 权益 Hook](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt): `app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt`
- [实验功能与快捷工具](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt): `app/src/main/kotlin/xyz/kejiyu/hongguo/hooks/Hooks.kt`

### 配套服务

- [更新检测](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/UpdateChecker.kt): `app/src/main/kotlin/xyz/kejiyu/hongguo/UpdateChecker.kt`
- [日志与诊断](https://github.com/kejiyunb/hongguo/blob/main/app/src/main/kotlin/xyz/kejiyu/hongguo/LogUtil.kt): `app/src/main/kotlin/xyz/kejiyu/hongguo/LogUtil.kt`

### Other components

- **用户**
- **Xposed 框架**
- **红果客户端**
- **GitHub Releases**

## Connections

- 用户 → 模块主界面: 操作 (evidence: `app/src/main/kotlin/xyz/kejiyu/hongguo/MainActivity.kt`)
- 模块主界面 → 版本映射: 读取适配版本 (evidence: `app/src/main/kotlin/xyz/kejiyu/hongguo/MainActivity.kt`)
- 模块主界面 → 更新检测: 检查更新 (evidence: `app/src/main/kotlin/xyz/kejiyu/hongguo/MainActivity.kt`)
- 更新检测 → GitHub Releases: 查询发行版 (evidence: `app/src/main/kotlin/xyz/kejiyu/hongguo/UpdateChecker.kt`)
- Xposed 框架 → 模块生命周期入口: 触发生命周期 (evidence: `app/src/main/kotlin/xyz/kejiyu/hongguo/MainHook.kt`)
- 模块生命周期入口 → 业务 Hook 与设置面板: 安装业务 Hook (evidence: `app/src/main/kotlin/xyz/kejiyu/hongguo/MainHook.kt`)
- 模块生命周期入口 → 更新检测: 启动更新检查 (evidence: `app/src/main/kotlin/xyz/kejiyu/hongguo/MainHook.kt`)
- 模块生命周期入口 → 日志与诊断: 记录运行日志 (evidence: `app/src/main/kotlin/xyz/kejiyu/hongguo/MainHook.kt`)
- 红果客户端 → 业务 Hook 与设置面板: 承载注入功能 (evidence: `README.md`)
- 业务 Hook 与设置面板 → 沉浸式界面精简: 精简界面 (evidence: `README.md`)
- 业务 Hook 与设置面板 → 画质与倍速: 优化播放 (evidence: `README.md`)
- 业务 Hook 与设置面板 → 播放手势拦截: 拦截手势 (evidence: `README.md`)
- 业务 Hook 与设置面板 → 广告与挂件拦截: 拦截广告挂件 (evidence: `README.md`)
- 业务 Hook 与设置面板 → VIP 权益 Hook: Hook 权益状态 (evidence: `README.md`)
- 业务 Hook 与设置面板 → 实验功能与快捷工具: 提供实验工具 (evidence: `README.md`)
