Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Commit a957802

Browse files
committed
docs: add auto-configuration feature to README
Document the new automatic device configuration feature: - Add Auto-Configuration section (now section 1) - Update numbering for configuration sections (2-5) - Include example partition_info.json output - Explain trigger condition and generated files
1 parent 7925697 commit a957802

2 files changed

Lines changed: 56 additions & 8 deletions

File tree

README.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,31 @@ sudo python3 main.py --stock <底包路径> --port <移植包路径> --pack-type
167167

168168
本项目采用模块化的 JSON 配置系统。
169169

170-
### 1. 设备配置 (`config.json`)
170+
### 1. 自动设备配置 (Auto-Configuration)
171+
工具支持从底包 (Stock ROM) 自动提取设备信息并创建设备配置。
172+
173+
- **触发条件**: 当 `devices/<机型代码>/` 目录不存在时自动触发
174+
- **数据来源**: 通过 `payload-dumper --json` 提取分区信息和元数据
175+
- **生成文件**:
176+
- `config.json` - 设备基本配置
177+
- `features.json` - 功能开关和属性
178+
- `replacements.json` - 资源替换规则
179+
- `partition_info.json` - 分区布局信息(动态分区列表、固件分区列表、super 大小)
180+
181+
**示例生成的 partition_info.json**:
182+
```json
183+
{
184+
"device_code": "myron",
185+
"super_size": 14485028864,
186+
"dynamic_partitions": [
187+
"odm", "product", "system", "system_dlkm",
188+
"system_ext", "vendor", "vendor_dlkm", "mi_ext"
189+
],
190+
"firmware_partitions": ["abl", "aop", "boot", ...]
191+
}
192+
```
193+
194+
### 2. 设备配置 (`config.json`)
171195
控制设备特定的设置,包括 wild_boost、打包类型和 KSU。
172196
- **位置**: `devices/<机型代码>/config.json`
173197
- **优先级**: CLI 参数 > `config.json` > 默认值
@@ -193,7 +217,7 @@ sudo python3 main.py --stock <底包路径> --port <移植包路径> --pack-type
193217
sudo python3 main.py --stock stock.zip --port port.zip --pack-type super --fs-type ext4
194218
```
195219

196-
### 2. 狂暴引擎支持
220+
### 3. 狂暴引擎支持
197221
根据内核版本自动安装性能增强模块。
198222

199223
**功能特性:**
@@ -209,7 +233,7 @@ sudo python3 main.py --stock stock.zip --port port.zip --pack-type super --fs-ty
209233
- 小米 12S (mayfly) - 内核 5.10
210234
- 小米 13 (fuxi) - 内核 5.15
211235

212-
### 3. 特性开关 (`features.json`)
236+
### 4. 特性开关 (`features.json`)
213237
管理每个设备的系统特性和属性。
214238
- **位置**: `devices/<机型代码>/features.json`
215239

@@ -225,7 +249,7 @@ sudo python3 main.py --stock stock.zip --port port.zip --pack-type super --fs-ty
225249
}
226250
```
227251

228-
### 4. 资源 overlays (`replacements.json`)
252+
### 5. 资源 overlays (`replacements.json`)
229253
自动化文件/目录替换(如 overlays、音频配置等)。
230254
```json
231255
[

README_EN.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,31 @@ sudo python3 main.py --stock <path_to_stock_zip> --port <path_to_port_zip> --pac
169169

170170
The tool uses a modular JSON-based configuration system.
171171

172-
### 1. Device Configuration (`config.json`)
172+
### 1. Auto-Configuration
173+
The tool supports automatic device configuration extraction from the Stock ROM.
174+
175+
- **Trigger**: Automatically triggered when `devices/<device_code>/` directory does not exist
176+
- **Data Source**: Extracts partition info and metadata via `payload-dumper --json`
177+
- **Generated Files**:
178+
- `config.json` - Device base configuration
179+
- `features.json` - Feature toggles and properties
180+
- `replacements.json` - Resource replacement rules
181+
- `partition_info.json` - Partition layout (dynamic partitions, firmware partitions, super size)
182+
183+
**Example generated partition_info.json**:
184+
```json
185+
{
186+
"device_code": "myron",
187+
"super_size": 14485028864,
188+
"dynamic_partitions": [
189+
"odm", "product", "system", "system_dlkm",
190+
"system_ext", "vendor", "vendor_dlkm", "mi_ext"
191+
],
192+
"firmware_partitions": ["abl", "aop", "boot", ...]
193+
}
194+
```
195+
196+
### 2. Device Configuration (`config.json`)
173197
Control device-specific settings including wild_boost, pack type, and KSU.
174198
- **Location**: `devices/<device_code>/config.json`
175199
- **Priority**: CLI args > `config.json` > defaults
@@ -195,7 +219,7 @@ Control device-specific settings including wild_boost, pack type, and KSU.
195219
sudo python3 main.py --stock stock.zip --port port.zip --pack-type super --fs-type ext4
196220
```
197221

198-
### 2. Wild Boost Support
222+
### 3. Wild Boost Support
199223
Automatically installs performance boost modules based on kernel version.
200224

201225
**Features:**
@@ -211,7 +235,7 @@ Automatically installs performance boost modules based on kernel version.
211235
- Xiaomi 12S (mayfly) - Kernel 5.10
212236
- Xiaomi 13 (fuxi) - Kernel 5.15
213237

214-
### 3. Feature Toggles (`features.json`)
238+
### 4. Feature Toggles (`features.json`)
215239
Manage system features and properties per device.
216240
- **Location**: `devices/<device_code>/features.json`
217241

@@ -227,7 +251,7 @@ Manage system features and properties per device.
227251
}
228252
```
229253

230-
### 4. Resource Overlays (`replacements.json`)
254+
### 5. Resource Overlays (`replacements.json`)
231255
Automate file/directory replacements (e.g., overlays, audio configs).
232256
```json
233257
[

0 commit comments

Comments
 (0)