Metadata-Version: 2.4
Name: twrpdtui
Version: 3.1.0
Summary: TWRP Device Tree Generator with User-Friendly GUI - Convert Android images to TWRP device trees easily
License: Apache-2.0
Author: UI by RetroFrost
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: GitPython (>=3.1.27,<4.0.0)
Requires-Dist: Jinja2 (>=3.1.1,<4.0.0)
Requires-Dist: PyQt6 (>=6.0.0,<7.0.0)
Requires-Dist: sebaubuntu-libs (>=1.3.0,<2.0.0)
Project-URL: Repository, https://github.com/RetroFrost/twrpdtui
Description-Content-Type: text/markdown

# 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]`
- 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: `cpio` must be installed (`sudo apt install cpio` or `sudo pacman -S cpio`)

## Installation

```bash
pip install twrpdtui
```

Or if using Poetry:

```bash
poetry install
```

## Usage

### GUI Mode (Recommended for Normal Users)

```bash
twrpdtgen-gui
```

Or:

```bash
python3 -m twrpdtgen --gui
```

### CLI Mode

```bash
twrpdtgen <path-to-image>
```

With custom output:

```bash
twrpdtgen <path-to-image> -o /custom/output/path
```

With git repo initialization:

```bash
twrpdtgen <path-to-image> --git
```

## How to Use the GUI

1. Launch the GUI: Run `twrpdtgen-gui`
2. Select Recovery Image: Click "Browse" and choose your recovery image (.img or .bin)
3. Choose Output Folder (Optional): Default is `~/Documents/trees/`
4. Set Options: Enable "Initialize Git repository" if desired
5. Click Generate: Start the device tree generation
6. Monitor Progress: Watch the live log output
7. 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

```python
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](https://github.com/twrpdtgen/twrpdtgen)
- GUI implementation by [RetroFrost](https://github.com/RetroFrost)

