|  | 
| 1 |  | -# Boot Image Extractor | 
|  | 1 | +<div align="center"> | 
|  | 2 | + <img src="https://github.com/gitclone-url/Boot-image-Extractor/assets/98699436/8fc2fc00-4dcd-4506-a161-7fec49a6ee34" loading="lazy" alt="Boot Image Extractor"/> | 
|  | 3 | +<h2></h2>  | 
|  | 4 | +</div> | 
| 2 | 5 | 
 | 
| 3 |  | -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](https://source.android.com/devices/tech/ota/ab) and [legacy partition](https://source.android.com/devices/bootloader/partitions) styles. This script was developed as part of an automated method for extracting boot images described in the [Boot Image Extraction Guide](https://gist.github.com/gitclone-url/a1f693b64d8f8701ec24477a2ccaab87#file-boot-image-extraction-guide-md). | 
|  | 6 | + | 
|  | 7 | +<div style="display: flex; justify-content: center;"> | 
|  | 8 | + <div style="max-width: 800px;"> | 
|  | 9 | + <p> | 
|  | 10 | +  Boot Image Extractor is a standalone Python script designed to extract the boot image from Android devices with root access. It supports both <a href="https://source.android.com/devices/tech/ota/ab">A/B</a> and <a href="https://source.android.com/devices/bootloader/partitions">legacy partition</a> styles. This script was developed as part of an automated method for extracting boot images described in the <a href="https://gist.github.com/gitclone-url/a1f693b64d8f8701ec24477a2ccaab87#file-boot-image-extraction-guide-md">Boot Image Extraction Guide</a>. | 
|  | 11 | + </p> | 
|  | 12 | + </div> | 
|  | 13 | +</div> | 
| 4 | 14 | 
 | 
| 5 | 15 | ## Requirements | 
| 6 | 16 | 
 | 
| 7 | 17 | - Python 3 or higher | 
| 8 | 18 | - Root access on the Android device | 
| 9 | 19 | - Python package: `pyfiglet` | 
| 10 | 20 | 
 | 
| 11 |  | -## Installation Instructions | 
|  | 21 | +## Initial Setup | 
| 12 | 22 | 
 | 
| 13 |  | -#### Procedure 1: Direct Installation | 
|  | 23 | +1. **Install Termux:** | 
|  | 24 | + Download and install [Termux](https://termux.com/) on your device. | 
| 14 | 25 | 
 | 
| 15 |  | -1. Download [Termux](https://termux.com/) and install it. | 
| 16 |  | -2. Open Termux and allow storage permission using: | 
|  | 26 | +2. **Grant Storage Permissions:** | 
|  | 27 | + Open Termux and allow storage permissions using the command: | 
| 17 | 28 |  ```bash | 
| 18 | 29 |  termux-setup-storage | 
| 19 | 30 |  ``` | 
| 20 |  | -3. If you going to use this script on a [Phh-based GSI](https://github.com/phhusson/treble_experimentations/wiki/Frequently-Asked-Questions-%28FAQ%29) that ships with an inbuilt [superuser](https://github.com/phhusson/treble_experimentations/wiki/Frequently-Asked-Questions-%28FAQ%29#naming-conventions-that-some-gsi-buildermaintainer-uses) check if the PHH Superuser app is installed by running: | 
|  | 31 | + | 
|  | 32 | +3. **Check for PHH Superuser (if applicable):** | 
|  | 33 | + If you are going to use this script on a [Phh-based GSI](https://github.com/phhusson/treble_experimentations/wiki/Frequently-Asked-Questions-%28FAQ%29) that ships with an inbuilt [superuser](https://github.com/phhusson/treble_experimentations/wiki/Frequently-Asked-Questions-%28FAQ%29#naming-conventions-that-some-gsi-buildermaintainer-uses), check if the PHH Superuser app is installed: | 
| 21 | 34 |  ```bash | 
| 22 |  | - (pm list packages | grep me.phh.superuser) && echo "Found" || echo "Not found" | 
|  | 35 | + (pm list packages | grep me.phh.superuser) && echo "App installed" || echo "Not found" | 
| 23 | 36 |  ``` | 
| 24 |  | - > **Note:** If "Not found" is displayed, install the app from [F-Droid](https://f-droid.org/en/packages/me.phh.superuser/). This app is essential to manage root access for Termux. Skip this step if your device is already rooted with Magisk or a other method. | 
|  | 37 | + > **Note:** If "Not found" is displayed, install the app from [F-Droid](https://f-droid.org/en/packages/me.phh.superuser/). 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. | 
| 25 | 38 | 
 | 
| 26 |  | -4. Grant superuser permission to Termux by typing: | 
|  | 39 | +4. **Grant Superuser Permission:** | 
|  | 40 | + Grant superuser permission to Termux by typing: | 
| 27 | 41 |  ```bash | 
| 28 | 42 |  su | 
| 29 | 43 |  ``` | 
| 30 |  | -5. Copy and paste the following command and hit enter to start running the script: | 
|  | 44 | + | 
|  | 45 | +## Installation Instructions | 
|  | 46 | + | 
|  | 47 | +#### Procedure 1: Direct Installation | 
|  | 48 | + | 
|  | 49 | +1. **Run with One-Liner Commands:** | 
|  | 50 | + Copy and paste the following command in termux and hit enter to start running the script: | 
| 31 | 51 |  ```bash | 
| 32 |  | - 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 -s https://raw.githubusercontent.com/gitclone-url/Boot-img-flasher/Master/boot-img-flasher.sh -o boot-img-flasher.sh; clear; sudo boot_image_extractor.py | 
|  | 52 | + 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 | 
| 33 | 53 |  ``` | 
| 34 | 54 |  > **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. | 
| 35 | 55 | 
 | 
| 36 | 56 | #### Procedure 2: Manual Installation | 
| 37 | 57 | 
 | 
| 38 |  | -1. Clone the repository or download the zip file from [GitHub](https://github.com/gitclone-url/Boot-image-Extractor/archive/refs/heads/master.zip). | 
| 39 |  | - | 
| 40 |  | -2. Install Python if not already installed on your terminal: | 
|  | 58 | +1. **Clone or Download Source:** | 
|  | 59 | + Clone the repository and navigate to the project directory: | 
| 41 | 60 |  ```bash | 
| 42 |  | - pkg install python -y | 
|  | 61 | + git clone https://github.com/gitclone-url/Boot-image-Extractor.git | 
|  | 62 | + cd Boot-image-Extractor | 
| 43 | 63 |  ``` | 
|  | 64 | + or download the source zip file from [GitHub](https://github.com/gitclone-url/Boot-image-Extractor/archive/refs/heads/master.zip), extract it, and navigate to the extracted directory. | 
| 44 | 65 | 
 | 
| 45 |  | -3. Install `tsu` using the following command: | 
|  | 66 | +2. **Install Dependencies:** | 
|  | 67 | + Ensure Python and required packages are installed: | 
| 46 | 68 |  ```bash | 
| 47 |  | - pkg install tsu | 
|  | 69 | + pkg install python tsu -y | 
|  | 70 | + pip install -r requirements.txt | 
| 48 | 71 |  ``` | 
| 49 | 72 | 
 | 
| 50 |  | -4. Navigate to the cloned or extracted directory and run the command: | 
|  | 73 | +3. **Install the Script:** | 
|  | 74 | + Run the setup script to install Boot Image Extractor: | 
| 51 | 75 |  ```bash | 
| 52 | 76 |  pip install . | 
| 53 | 77 |  ``` | 
| 54 | 78 |  This will install the Boot Image Extractor script on your terminal and make it accessible system-wide. | 
| 55 | 79 | 
 | 
| 56 | 80 | ## Usage Instructions | 
| 57 | 81 | 
 | 
| 58 |  | -After installation, you can execute the script using the following command: | 
|  | 82 | +After installation, execute the script using the following command: | 
| 59 | 83 | ```bash | 
| 60 | 84 | sudo boot_image_extractor.py | 
| 61 | 85 | ``` | 
| 62 | 86 | 
 | 
| 63 |  | -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 the directory to where the script is located before running it. | 
|  | 87 | +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. | 
| 64 | 88 | 
 | 
| 65 | 89 | ## Contribution | 
| 66 | 90 | 
 | 
| 67 |  | -Contributions to the Boot Image Extractor are welcome. Please fork the repository, make your modifications, and submit a pull request. For detailed guidelines, see our [Contributing Guidelines](CONTRIBUTING.md). | 
|  | 91 | +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](CONTRIBUTING.md). | 
| 68 | 92 | 
 | 
| 69 | 93 | ## License | 
| 70 | 94 | 
 | 
| 71 | 95 | This script is distributed under the terms of the [MIT License](LICENSE). | 
| 72 | 96 | 
 | 
| 73 | 97 | ## Support | 
| 74 | 98 | 
 | 
| 75 |  | -For any issues or inquiries, please open an issue on the repository's [issue tracker](https://github.com/gitclone-url/Boot-image-Extractor/issues) or contact the developer via [Telegram](https://t.me/PhantomXPain). | 
|  | 99 | +For any issues or inquiries, please open an issue on the repository's [issue tracker](https://github.com/gitclone-url/Boot-image-Extractor/issues) or contact the developer via [Telegram](https://t.me/PhantomXPain). | 
0 commit comments