TWRP Device Tree Generator. A script that generates a TWRP-compatible device tree.
Project description
TWRP device tree generator
Create a TWRP-compatible device tree only from a recovery image (or a boot image if the device is A/B) of your device's stock ROM It has been confirmed that this script supports images built starting from Android 4.4 up to Android 11
Installation
pip install twrpdtgen
The module is supported on Python 3.6 and above.
Linux only: Be sure to have cpio installed in your system (Install cpio using sudo apt install cpio
or sudo pacman -S cpio
based on what package manager you're using)
How to use
$ twrpdtgen -h
TWRP device tree generator
usage: twrpdtgen [-h] [-v] recovery_image
positional arguments:
recovery_image path to a recovery image (or boot image if the device is A/B)
optional arguments:
-h, --help show this help message and exit
-v, --verbose Enable debugging logging
When an image is provided, if everything goes well, there will be a device tree at working/manufacturer/codename
You can also use the module in a script, with the following code:
from twrpdtgen.twrp_dt_gen import generate_device_tree
# The function will return a DeviceTree object, you can find its declaration here:
from twrpdtgen.utils.device_tree import DeviceTree
result = generate_device_tree(image_path, output_path)
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
Hashes for twrpdtgen-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1f02fe1342f16ee707a3ebc6ace1f5ad18f64ade5f1bc138f8c8a9b216b4bcb |
|
MD5 | f9c623c946293ee3b72b8ab950ef40d4 |
|
BLAKE2b-256 | 0f5df6a3ec814f105b0385638be74b32ba5210e1b4848aa79d50c8ac6c27eaa1 |