Home > Tips and Tricks

How to Unpack and Repack Boot.img and Recovery.img

In this guide, we will show you the steps to unpack and repack the boot.img as well as the recovery.img files. There have been some major changes in the way we used to flash a custom recovery onto our devices. While you could directly flash a custom recovery to the dedicated recovery partition on some devices, other devices doesn’t have any recovery partition as such. Hence in those cases, you’ll have to take the help of the boot partition to temporary boot to TWRP.

After that, you may then permanently install it by flashing its ZIP or installing its IMG file in the Ramdisk partition. Then if we talk about rooting, then you’ll have to take the help of the boot/init_boot partition by patching it via Magisk and flashing it via Fastboot. Apart from that, some tech enthusiasts and developers might have to unpack the boot.img or the recovery partition, make the necessary changes and tweaks to the file, and then repack.

This new boot/recovery file could then be flashed onto your device, thereby giving you the required features set. However, unpacking and repacking the IMG file might prove to be a tough nut to crack for some. If you are also in the same boat, then fret not as this guide is here to help you out. Follow along for the instructions.

How to Unpack Boot.img

  1. To begin with, download the stock firmware and extract boot.img:
    Pixel: Download the Factory Image and extract the ZIP file via 7ZIP
    Xiaomi: Download Fastboot ROM and extract TGZ > TAR via 7ZIP
    OnePlus: Download Firmware > extract ZIP > payload.bin via 7ZIP
  2. Then download and extract Carliv_Image_kitchen Tool on your PC.
  3. Go to its boot-resources folder and transfer the boot.img file there.
  4. Now launch the tool via the carliv.bat file. It is a Command Line Tool.
  5. First off, type B and hit Enter [B: Boot]Unpack and Repack Boot.img
  6. Next up, type 1 and hit Enter. [1:boot.img]Unpack and Repack Boot.img
  7. Finally, type 1 and hit Enter. [1: Unpack Image]Unpack and Repack Boot.img
  8. The unpacked boot.img will now be present inside the boot folder.Unpack and Repack Boot.img

How to Repack Boot.img File

Once you have done the necessary tweaks, it’s time to repack the boot.img. Here’s how it could be done:

  1. Launch the Carliv_Image_kitchen Tool via the carliv.bat file.
  2. First off, type B and hit Enter [B: Boot]Unpack and Repack Boot.img
  3. Next up, type 1 and hit Enter. [1:boot.img]Unpack and Repack Boot.img
  4. Finally, type 2 and hit Enter. [2: Repack Image]Unpack and Repack Boot.img
  5. The boot.img will be repacked and placed in the Output folder.Unpack and Repack Boot.img

How to Unpack Recovery.img

  1. First off, download the stock firmware and extract the recovery.img:
    Pixel: Download the Factory Image and extract the ZIP file via 7ZIP
    Xiaomi: Download Fastboot ROM and extract TGZ > TAR via 7ZIP
    OnePlus: Download Firmware > extract ZIP > payload.bin via 7ZIP
  2. Then download and extract Carliv_Image_kitchen Tool on your PC.
  3. Go to its recovery-resources folder and transfer the recovery.img file.
  4. Now launch the tool via the carliv.bat file. It is a Command Line Tool.
    First off, type R and hit Enter [R: Recovery]
    Next up, type 1 and hit Enter. [1:recovery.img]
    Finally, type 1 and hit Enter. [1: Unpack Image]
  5. The unpacked recovery.img will be present inside the recovery folder.

How to Repack Boot.img File

unpack boot recovery

Once you have done the necessary tweaks, it’s time to repack the boot.img. Here’s how it could be done:

  1. Launch the Carliv_Image_kitchen Tool via the carliv.bat file.
    First off, type R and hit Enter [R: Recovery]
    Next up, type 1 and hit Enter. [1:recovery.img]
    Finally, type 2 and hit Enter. [2: Repack Image]
  2. The recovery.img will be repacked and placed in Output folder.

So these were the steps to unpack and repack the boot.img as well as the recovery.img files. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.


Share: