{"id":31194786,"url":"https://github.com/ItosEO/ColorFeatureEnhance","last_synced_at":"2025-09-20T02:04:51.177Z","repository":{"id":303241966,"uuid":"1014832288","full_name":"ItosEO/ColorFeatureEnhance","owner":"ItosEO","description":"ColorFeatureEnhance","archived":false,"fork":false,"pushed_at":"2025-07-23T03:32:19.000Z","size":1314,"stargazers_count":35,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-23T04:06:59.911Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ItosEO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-06T13:59:05.000Z","updated_at":"2025-07-23T03:27:14.000Z","dependencies_parsed_at":"2025-07-06T15:28:24.419Z","dependency_job_id":"ee6ffb10-aa17-4d46-b98e-54ea7b8be1c2","html_url":"https://github.com/ItosEO/ColorFeatureEnhance","commit_stats":null,"previous_names":["itoseo/colorfeatureenhance"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ItosEO/ColorFeatureEnhance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItosEO%2FColorFeatureEnhance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItosEO%2FColorFeatureEnhance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItosEO%2FColorFeatureEnhance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItosEO%2FColorFeatureEnhance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ItosEO","download_url":"https://codeload.github.com/ItosEO/ColorFeatureEnhance/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItosEO%2FColorFeatureEnhance/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276033070,"owners_count":25573474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-20T02:02:19.400Z","updated_at":"2025-09-20T02:04:51.121Z","avatar_url":"https://github.com/ItosEO.png","language":"Kotlin","readme":"# ColorOS Feature Enhance 可视化编辑器\n\n一个用于 **可视化编辑与管理 ColorOS 特性开关**（如 `com.oplus.app-features.xml` 与 `com.oplus.oplus-feature.xml`）的开源工具，使用 **Kotlin + Jetpack Compose** 开发，遵循 **Material 3 Expressive** 设计规范。\n\n\u003e ⚠️ 本应用 **需要 Root 权限** 才能正常读写系统配置文件，请确保目标设备已 Root。\n\n## ✨ 主要功能\n\n### 🎯 核心特性\n- **双模式编辑**：一键在 *App-Features* 与 *Oplus-Features* 模式之间切换\n- **智能配置管理**：支持模块化配置文件管理，兼容 OTA 更新，采用基线+补丁架构\n- **实时可视化**：按照「描述 → 分组 → 开关」层级展现所有特性，所见即所得\n- **搜索 \u0026 高亮**：支持按名称/描述高速模糊搜索并自动高亮匹配关键字\n- **分组折叠**：同一描述的特性自动归为同组，可展开/折叠查看\n- **补丁状态显示**：直观显示特性的修改状态（新增/修改/删除）\n\n### 🛠️ 编辑功能\n- **快速增删改**：长按列表项可删除，悬浮按钮（FAB）可新增，开关即改值\n- **复杂特性支持**：支持带参数和子节点的复杂特性配置\n- **文本编辑模式**：内置纯文本编辑器，可直接查看/编辑原始 XML\n- **配置合并**：智能合并系统基线配置与用户自定义补丁\n- **统一日志系统**：内置 CLog 日志管理，支持日志导出和调试\n\n### 🌐 用户体验\n- **国际化**：内置简体中文、英语双语支持\n- **数据持久化**：用户自定义描述映射持久保存\n- **模块集成**：内置 Magisk 模块，支持系统级配置应用\n- **示例配置**：仓库 `exampleConfig/` 提供参考 XML 和模块文件\n\n## 📂 项目架构\n\n```text\ncom.itosfish.colorfeatureenhance/\n├── config/                    # 配置管理核心\n│   └── ConfigMergeManager.kt  # 配置合并与补丁管理\n├── data/\n│   ├── model/                 # 数据模型（AppFeature、OplusFeature 等）\n│   └── repository/            # XML 读写仓库实现\n│       ├── XmlFeatureRepository.kt      # App-Features 仓库\n│       └── XmlOplusFeatureRepository.kt # Oplus-Features 仓库\n├── domain/\n│   └── FeatureRepository.kt   # 领域层接口，抽象数据操作\n├── ui/\n│   ├── components/            # 可复用 UI 组件\n│   │   ├── SearchBar.kt       # 搜索栏组件\n│   │   ├── HighlightedText.kt # 高亮文本组件\n│   │   └── TopAppBarComponent.kt # 顶部应用栏\n│   ├── search/                # 搜索逻辑\n│   │   └── SearchLogic.kt     # 搜索算法实现\n│   ├── theme/                 # Material 3 主题定义\n│   ├── FeatureConfigScreen.kt # 主配置界面\n│   └── TextEditorActivity.kt  # 内置文本编辑器\n├── utils/\n│   ├── ConfigUtils.kt         # 配置文件工具类\n│   ├── DialogUtil.kt          # 对话框工具\n│   └── CSU.kt                 # Shell 命令工具\n├── FeatureMode.kt             # 编辑模式枚举\n└── MainActivity.kt            # 应用入口\n```\n\n## 🏗️ 技术架构\n\n### 分层架构\n| Layer | 关键职责 | 代表文件/目录 |\n|-|--|-|\n| **UI Layer** | Compose 渲染、用户交互、状态管理 | `ui/` `MainActivity.kt` |\n| **Domain Layer** | 业务规则、接口定义 | `domain/FeatureRepository.kt` |\n| **Data Layer** | 数据获取、XML 解析与持久化 | `data/` `config/` |\n| **Utils Layer** | 工具类、系统集成 | `utils/ConfigUtils.kt` `utils/CSU.kt` |\n\n### 核心设计原则\n- **协程异步**：所有 I/O 操作均通过 `Dispatchers.IO` 调度，避免阻塞主线程\n- **依赖倒置**：UI 层仅依赖接口，不直接依赖数据实现，便于测试与扩展\n- **配置分离**：系统基线配置与用户补丁分离管理，支持 OTA 更新\n- **模块化设计**：内置 Magisk 模块，实现系统级配置应用\n\n### 配置管理流程\n1. **系统配置复制**：从系统路径复制基线配置到应用目录 (`system_baseline/`)\n2. **用户补丁生成**：根据用户修改生成增量补丁文件 (`user_patches/`)\n3. **配置合并**：将基线配置与用户补丁合并生成最终配置 (`merged_output/`)\n4. **模块同步**：将合并后的配置同步到 Magisk 模块目录\n5. **权限设置**：自动设置模块目录权限为 644\n\n### 新架构特点\n- **基线+补丁模式**：系统配置与用户修改分离，支持 OTA 更新\n- **智能合并**：自动检测配置变更，仅在必要时执行合并操作\n- **多级回退**：支持系统基线 → 直接系统路径的多级配置源回退\n- **日志追踪**：完整的配置管理操作日志，便于问题排查\n\n## 🚀 编译与运行\n\n### 环境要求\n- **系统**: 支持任何基于 ColorOS 14/15 的系统，**需要 Root 权限**\n- **Root 管理器**: 支持多种 Root 管理器，**不支持 overlayfs 挂载**\n\n### 快速开始\n1. **克隆仓库**\n   ```bash\n   git clone https://github.com/ItosFish/ColorFeatureEnhance.git\n   cd ColorFeatureEnhance\n   ```\n\n2. **导入项目**\n   - 使用 Android Studio 打开项目根目录\n   - 等待 Gradle 同步完成\n\n3. **准备设备**\n   - 连接已 Root 的 Android 设备\n   - 启用 USB 调试模式\n   - 确保设备已安装 Magisk/KernelSU/APatch（**不支持 overlayfs 挂载**）\n\n4. **安装运行**\n   - 点击 Run ▶️ 按钮编译并安装应用\n   - 首次运行时应用会自动安装配套的 Magisk 模块\n   - 重启设备以激活模块功能\n\n### 配置文件准备\n应用支持多种配置文件来源：\n- **自动获取**：应用会自动从系统路径复制配置文件\n- **示例配置**：使用 `exampleConfig/` 中的示例文件快速体验\n- **手动导入**：将配置文件放置到应用的外部存储目录\n\n## 🛠️ 技术栈\n\n### 核心技术\n- **开发语言**: Kotlin 2.0.21 (100% Kotlin)\n- **UI 框架**: Jetpack Compose + Material 3 Expressive\n- **架构模式**: Repository Pattern + Domain Layer + 分层架构\n- **序列化**: Kotlinx Serialization JSON\n- **日志系统**: 统一 CLog 日志管理，支持内存存储和导出\n\n### Android 组件\n- **最低 SDK**: Android 14 (API 34)\n- **目标 SDK**: Android 16 (API 36)\n- **版本号**: v0.83 (Build 25072302)\n- **Compose BOM**: 2025.06.01\n- **Navigation**: Compose Navigation 2.9.1\n- **生命周期**: Lifecycle Runtime KTX 2.9.1\n\n### 系统集成\n- **权限管理**: Root 权限 (通过 su 命令)\n- **模块系统**: Magisk 模块集成，不支持原版 KernelSU\n- **文件操作**: XML Pull 解析 + 文件 I/O\n- **数据持久化**: SharedPreferences + JSON 配置文件\n- **国际化**: 支持中文/英文双语界面\n\n### 开发工具\n- **构建工具**: Android Gradle Plugin 8.10.1\n- **代码混淆**: ProGuard + R8 优化\n- **多架构支持**: ARM64-v8a\n\n## 🔧 使用说明\n\n### 基本操作\n1. **切换模式**：点击顶部标签在 App-Features 和 Oplus-Features 模式间切换\n2. **搜索特性**：使用搜索栏快速定位特定功能\n3. **编辑特性**：点击开关切换功能状态，长按可删除特性\n4. **添加特性**：点击悬浮按钮添加新的功能配置\n5. **文本编辑**：通过菜单进入文本编辑模式直接修改 XML\n\n### 高级功能\n- **配置同步**：修改会自动同步到 Magisk 模块\n- **OTA 兼容**：系统更新后会自动重新合并配置\n- **批量操作**：支持批量启用/禁用相关功能\n- **配置备份**：用户修改以补丁形式保存，便于恢复\n\n## 🤝 贡献指南\n\n欢迎提交 Issue、Pull Request 或功能建议！\n\n### 贡献要求\n1. **代码规范**：遵循 Kotlin 官方代码风格\n2. **注释完整**：新功能需要中英文注释\n3. **向下兼容**：不破坏现有功能\n4. **文档更新**：重要改动需同步更新文档\n\n### 开发环境\n- 使用最新版 Android Studio\n- 确保有已 Root 的且搭载基于 ColorOS 14/15 的系统的设备用于测试\n- 熟悉 Magisk 模块开发（如需修改模块部分）\n\n## 🙏 致谢\n\n- [Shizuku](https://github.com/RikkaApps/Shizuku) - 提供 关于弹窗 布局文件\n\n\n\n## Activity\n![Alt](https://repobeats.axiom.co/api/embed/5c0a87c2274bce91d5b9840f6a3c2bb791fb5ae9.svg \"Repobeats analytics image\")\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=ItosEO/ColorFeatureEnhance\u0026type=Date)](https://www.star-history.com/#ItosEO/ColorFeatureEnhance\u0026Date)\n","funding_links":[],"categories":["📱 OS-Specific Customization"],"sub_categories":["Themes and Visual Mods"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FItosEO%2FColorFeatureEnhance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FItosEO%2FColorFeatureEnhance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FItosEO%2FColorFeatureEnhance/lists"}