A Python library/script to automatically generate TWRP-compatible device tree from a boot/recovery image
Project description
twrpdtgen
Create a TWRP-compatible device tree only from an Android recovery image (or a boot image if the device uses non-dynamic partitions 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 12
Requires Python 3.8 or greater
Installation
pip3 install twrpdtgen
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)
Instructions
python3 -m twrpdtgen <path to image>
When an image is provided, if everything goes well, there will be a device tree at output/manufacturer/codename
You can also use the module in a script, with the following code:
from twrpdtgen.device_tree import DeviceTree
# Get image info
device_tree = DeviceTree(image_path)
# Dump device tree to folder
device_tree.dump_to_folder(output_path)
License
#
# Copyright (C) 2022 The Android Open Source Project
#
# SPDX-License-Identifier: Apache-2.0
#
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-3.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e376ccfd55020aad691a44faac04001560655562b90a052b67453b974d12e3c5 |
|
MD5 | 21b05bcb98f332e9ca01dbe9ac22281b |
|
BLAKE2b-256 | 3b3d275eca2f1d4ec5728bd752b5d09e99eb398577ff147f206dbc30094015fd |