TWRP Device Tree Generator with User-Friendly GUI - Convert Android images to TWRP device trees easily
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file twrpdtui-3.1.0.tar.gz.
File metadata
- Download URL: twrpdtui-3.1.0.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
694dce76d84a97031c02203208d9e3412d88fce7c849485011508bad9d1a61a6
|
|
| MD5 |
02a6c792075a0d1d526010742914f1c1
|
|
| BLAKE2b-256 |
6321097cb32ba5142fb9ff8fa9762c13892559e828903c3b432f081e5e7d44af
|
File details
Details for the file twrpdtui-3.1.0-py3-none-any.whl.
File metadata
- Download URL: twrpdtui-3.1.0-py3-none-any.whl
- Upload date:
- Size: 19.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85b05caeb298ed3debe96d8fede86d9fa15eb5c2be68694941cebb854fef18ff
|
|
| MD5 |
3c5a8dbfc8131ff8796644bb1ec1c1a2
|
|
| BLAKE2b-256 |
0202009c9a46c97bbc2546c3dd3078630f20beecd0b272ae08cdfb8ef167999d
|