Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twrpdtgen/twrpdtgen
A Python library/script to automatically generate TWRP-compatible device tree from a boot/recovery image
https://github.com/twrpdtgen/twrpdtgen
android device-tree hacktoberfest python recovery twrp twrp-device-tree-generator
Last synced: about 2 months ago
JSON representation
A Python library/script to automatically generate TWRP-compatible device tree from a boot/recovery image
- Host: GitHub
- URL: https://github.com/twrpdtgen/twrpdtgen
- Owner: twrpdtgen
- Created: 2020-02-13T20:08:33.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-12T20:58:43.000Z (9 months ago)
- Last Synced: 2024-05-01T16:55:17.587Z (8 months ago)
- Topics: android, device-tree, hacktoberfest, python, recovery, twrp, twrp-device-tree-generator
- Language: Jinja
- Homepage:
- Size: 462 KB
- Stars: 665
- Watchers: 23
- Forks: 228
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# twrpdtgen
[![PyPi version](https://img.shields.io/pypi/v/twrpdtgen)](https://pypi.org/project/twrpdtgen/)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ae7d7a75522b4d079c497ff6d9e052d1)](https://www.codacy.com/gh/twrpdtgen/twrpdtgen/dashboard?utm_source=github.com&utm_medium=referral&utm_content=twrpdtgen/twrpdtgen&utm_campaign=Badge_Grade)Create a [TWRP](https://twrp.me/)-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 12Requires Python 3.8 or greater
## Installation
```sh
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
```sh
python3 -m twrpdtgen
```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:
```python
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
#
```