This project is a Flask-based boot image patching tool that allows users to upload a boot image file and patch it with the latest version of Magisk. The patched boot image file can then be used to root Android devices.
The tool has two endpoints:
-
/
: A basic endpoint that returns "Hello, World!" to verify that the server is up and running. -
/patch
: A POST endpoint that accepts a boot image file in the request and patches it with Magisk.
The tool downloads the Magisk APK and extracts the Magisk binary from it. When a boot image file is uploaded to the
/patch
endpoint, the tool saves the file as boot.img
. It then uses the Magisk binary to
patch the boot.img
file and save the output as patched_boot.img
. The boot.img
file is deleted after the patching is complete. The user can then download the patched boot image file and use it to
root their Android device.
The tool requires Python 3.9 and the following dependencies:
- Flask
- apktool
It also requires the following tools to be installed:
- wget
- unzip
- openjdk-11-jdk-headless
To use the tool, follow these steps:
- Clone the repository
- Install the required tools and dependencies
- Run the Flask application using
python app.py
- Access the tool via a web browser at
http://localhost:80
- Upload a boot image file to the
/patch
endpoint - Download the patched boot image file from the response
The project includes a Dockerfile that can be used to build a Docker image of the tool. The Docker image includes all the required dependencies and tools.
To build the Docker image, run the following command from the root of the project:
arduinoCopy codedocker build -t boot-image-patcher .
To run the Docker container, use the following command:
arduinoCopy codedocker run -p 80:80 boot-image-patcher
This project is licensed under the MIT License. See the LICENSE
file for details.