Skip to content

A Python script to extract boot image from any Android devices with root access.

License

Notifications You must be signed in to change notification settings

gitclone-url/Boot-image-Extractor

Repository files navigation

Boot Image Extractor

Boot Image Extractor is a standalone Python script designed to extract the boot image from Android devices with root access. It supports both A/B and legacy partition styles. This script was developed as part of an automated method for extracting boot images described in the Boot Image Extraction Guide.

Requirements

  • Python 3 or higher
  • Root access on the Android device
  • Python package: pyfiglet

Initial Setup

  1. Install Termux: Download and install Termux on your device.

  2. Grant Storage Permissions: Open Termux and allow storage permissions using the command:

    termux-setup-storage
  3. Check for PHH Superuser (if applicable): If you are going to use this script on a Phh-based GSI that ships with an inbuilt superuser, check if the PHH Superuser app is installed:

    (pm list packages | grep me.phh.superuser) && echo "App installed" || echo "Not found"

    Note: If "Not found" is displayed, install the app from F-Droid. This app is necessary to grant Termux requests to run as root. Skip this step if your device is already rooted with Magisk or another method.

  4. Grant Superuser Permission: Grant superuser permission to Termux by typing:

    su

Installation Instructions

Procedure 1: Direct Installation

  1. Run with One-Liner Commands: Copy and paste the following command in termux and hit enter to start running the script:
    apt update && apt upgrade -y; { command -v tsu && command -v curl && command -v python && command -v pip && python -c 'import pyfiglet' &>/dev/null; } || apt install -y tsu curl python; pip install pyfiglet; curl -o boot_image_extractor.py https://raw.githubusercontent.com/gitclone-url/Boot-image-Extractor/main/scripts/boot_image_extractor.py; clear; sudo python boot_image_extractor.py

    Note: It may take some time to run for the first time because the script will be downloaded along with the required tools. Please be patient.

Procedure 2: Manual Installation

  1. Clone or Download Source: Clone the repository and navigate to the project directory:

    git clone https://github.com/gitclone-url/Boot-image-Extractor.git
    cd Boot-image-Extractor

    or download the source zip file from GitHub, extract it, and navigate to the extracted directory.

  2. Install Dependencies: Ensure Python and required packages are installed:

    pkg install python tsu -y
    pip install -r requirements.txt
  3. Install the Script: Run the setup script to install Boot Image Extractor:

    pip install .

    This will install the Boot Image Extractor script on your terminal and make it accessible system-wide.

Usage Instructions

After installation, execute the script using the following command:

sudo boot_image_extractor.py

If you used the direct installation method and the script was downloaded to a different directory instead of Termux's $HOME directory, you may need to change to the directory where the script is located before running it.

Contribution

Contributions to Boot Image Extractor are welcome. Please fork the repository, make your modifications, and submit a pull request. For detailed guidelines, see our Contributing Guidelines.

License

This script is distributed under the terms of the MIT License.

Support

For any issues or inquiries, please open an issue on the repository's issue tracker or contact the developer via Telegram.