Skip to main content

TWRP Device Tree Generator. A script that generates a TWRP-compatible device tree.

Project description

TWRP device tree generator

PyPi version PyPi version status Codacy Badge

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 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] [-o OUTPUT] 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
  -o OUTPUT, --output OUTPUT
                        custom output folder

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twrpdtgen-1.1.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twrpdtgen-1.1.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file twrpdtgen-1.1.0.tar.gz.

File metadata

  • Download URL: twrpdtgen-1.1.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.9.16-1-MANJARO

File hashes

Hashes for twrpdtgen-1.1.0.tar.gz
Algorithm Hash digest
SHA256 6f7464cfc070d11aa5837c3fc6c79f44f8f6df3707f7cb1ea31240fc15eded4a
MD5 44ded815cf1bdc9b7bd2b43e6a7206fd
BLAKE2b-256 f6fcf69ccbb119454affe4c7323fb142ff534bc5439a55980f238831bfdf6d53

See more details on using hashes here.

File details

Details for the file twrpdtgen-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: twrpdtgen-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.9.16-1-MANJARO

File hashes

Hashes for twrpdtgen-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 829f66e378e8c728da26baf5437f61b858f293bc1a2e03e9176615d63e7dd5ec
MD5 d740fc456fd984e4c596935d4264e93d
BLAKE2b-256 c4fa41ff2e62384137f4a8287912f234b295eb28134586b5f351c7576aee4a28

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page