TWRP Device Tree Generator UI
A user-friendly PyQt6-based GUI for the TWRP Device Tree Generator that makes it easy for normal users to convert Android recovery images into TWRP-compatible device trees.
Features
- Easy-to-Use GUI: Modern PyQt6 interface with intuitive workflow
- Automatic Export Path: Defaults to
~/Documents/trees/[device_codename]- Linux:
/home/[username]/Documents/trees/[device_codename] - Windows:
C:\Users\[username]\Documents\trees\[device_codename]
- Linux:
- Real-time Progress: Live log output during generation
- File Browser: Easy image and output folder selection
- Optional Git Integration: Create a git repository after generation
- Cross-platform: Works on Linux, Windows, and macOS
- Wide Android Support: Android 4.4 through Android 17
Requirements
- Python 3.8 or greater
- PyQt6
- Linux:
cpiomust be installed (sudo apt install cpioorsudo pacman -S cpio)
Installation
pip install twrpdtui
Or if using Poetry:
poetry install
Usage
GUI Mode (Recommended for Normal Users)
twrpdtgen-gui
Or:
python3 -m twrpdtgen --gui
CLI Mode
twrpdtgen <path-to-image>
With custom output:
twrpdtgen <path-to-image> -o /custom/output/path
With git repo initialization:
twrpdtgen <path-to-image> --git
How to Use the GUI
- Launch the GUI: Run
twrpdtgen-gui - Select Recovery Image: Click "Browse" and choose your recovery image (.img or .bin)
- Choose Output Folder (Optional): Default is
~/Documents/trees/ - Set Options: Enable "Initialize Git repository" if desired
- Click Generate: Start the device tree generation
- Monitor Progress: Watch the live log output
- Done: Your device tree will be in the specified folder
Supported Image Types
- Recovery images (.img, .bin)
- Boot images (for A/B devices)
- Tested on Android 4.4 - 17
Supported Android Versions
| Version | Support | Notes |
|---|---|---|
| Android 4.4 (KitKat) | Yes | Full support |
| Android 5.x (Lollipop) | Yes | Full support |
| Android 6.x (Marshmallow) | Yes | Full support |
| Android 7.x (Nougat) | Yes | Full support |
| Android 8.x (Oreo) | Yes | Full support |
| Android 9 (Pie) | Yes | Full support |
| Android 10 | Yes | Full support |
| Android 11 | Yes | Full support |
| Android 12 | Yes | Full support |
| Android 13 | Yes | Full support |
| Android 14 | Yes | Full support |
| Android 15 | Yes | Full support |
| Android 16 | Yes | Full support |
| Android 17 | Yes | Full support |
Output Structure
~/Documents/trees/[device_codename]/
├── Android.bp
├── Android.mk
├── AndroidProducts.mk
├── BoardConfig.mk
├── device.mk
├── extract-files.sh
├── omni_[device_codename].mk
├── README.md
├── setup-makefiles.sh
├── vendorsetup.sh
├── recovery.fstab
├── prebuilt/
│ ├── kernel
│ ├── dt.img
│ ├── dtb.img
│ └── dtbo.img
└── recovery/
└── root/
└── *.rc
Advanced Usage
Using as a Python Library
from twrpdtgen.device_tree import DeviceTree
from pathlib import Path
# Get image info
device_tree = DeviceTree(image_path=Path("/path/to/recovery.img"))
# Dump device tree to folder
output_path = Path("/path/to/output")
device_tree.dump_to_folder(output_path)
License
Apache License 2.0
Copyright (C) 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Contributing
Contributions are welcome! Feel free to submit issues and pull requests.
Credits
- Original twrpdtgen by twrpdtgen
- GUI implementation by RetroFrost
Metadata
Release files for twrpdtui 3.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| twrpdtui-3.1.0.tar.gz | 14.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| twrpdtui-3.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.2 kB
Release files / twrpdtui-3.1.0.tar.gz
| Download URL | twrpdtui-3.1.0.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
694dce76d84a97031c02203208d9e3412d88fce7c849485011508bad9d1a61a6
|
|
BLAKE2b-256 checksum How to use checksums |
6321097cb32ba5142fb9ff8fa9762c13892559e828903c3b432f081e5e7d44af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / twrpdtui-3.1.0-py3-none-any.whl
| Download URL | twrpdtui-3.1.0-py3-none-any.whl |
|---|---|
| Size | 19.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85b05caeb298ed3debe96d8fede86d9fa15eb5c2be68694941cebb854fef18ff
|
|
BLAKE2b-256 checksum How to use checksums |
0202009c9a46c97bbc2546c3dd3078630f20beecd0b272ae08cdfb8ef167999d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|