How To Guide How to extract image collection from rom releases (and root the boot image and apply root to the phone)

Search This thread

djsubterrain

Senior Member
Jan 4, 2012
4,112
3,834
Livingston
OnePlus 9 Pro
1. To extract the image collection from your downloaded rom :

  1. Download Payload Dumper from here (It's a zip file but it's not flashable) to your computer
  2. Extract the zip file to a folder, make it a folder you can use regularly because this is the default tool you would use from now on
  3. Download the rom version you want to root
  4. Unzip the rom to a folder, you will find a file within it called payload.bin
  5. Copy and paste that file into the "payload_input" folder within the Payload Dumper folder you created
  6. Execute the payload_dumper.exe file within Payload Dumper folder, you will not have to specify any options as it always extracts from any payload.bin file in payload_input and outputs the image files to payload_output.
  7. Leave the extraction to be completed, the program will automatically close itself once it's completed
  8. Your extracted .img files will be shown within the payload_output folder


2. If you need to root the boot image you extracted :


  1. Copy the boot.img file from the payload_output folder to a folder on your phone storage (Best to name it appropriately if you will be doing this regularly)
  2. Download and Install the latest Magisk apk from the release site (Accept any prompt to allow install from external source)
  3. Launch the app and then choose Install under the top "Magisk" section
  4. Choose Select and Patch a File then browse to where you copied the boot.img on your storage
  5. Magisk will then apply root to the boot image you specified, Your rooted image file will be output to your phone's Download folder : /sdcard/Download
  6. You don't need to keep the default filename of the rooted image file so you can rename it appropriately for the rom version after you copy it to your computer, just ensure to keep the .img file extension
  7. If you rename the rooted boot image, try not to use spaces in the filename, rather use _ or - as spaces make it more difficult to use in a command window although when you start typing the filename you can use TAB to autocomplete it, always ensure the filename shows .img as the extension and at the end of any commandline


3. If you need to use your rooted boot image to apply root to your phone :


  1. Install the drivers from the mounted drive you should get when connecting the phone to your computer
  2. On Windows you should then have a folder in C:\Program Files (x86)\OnePlus USB Drivers\Android with the platform tools (ADB.exe and Fastboot.exe) you will need, you can obviously copy the content from that folder somewhere else if you wish.
  3. Connect your phone to your computer
  4. Copy your rooted boot image to the folder that has adb.exe and fastboot.exe
  5. Open a command window on your computer by right clicking in that folder and choosing Open command window here
  6. In the command window, Type or copy/paste the command ADB devices and press enter
  7. If you see a prompt on your phone to allow the computer connection then accept it, better still, tell it to allow from now on also.
  8. You should see a string of characters shown in the command window, if you don't see that, then try another cable or re-install your drivers and reboot the computer.
  9. Reboot your phone into Fastboot either by using ADB on your computer ( ADB Reboot Fastboot ) or by enabling Advanced reboot in your developer options in settings and then hold down the power button and use the 3 dot menu on the top right and choosing "Bootloader"
  10. In the command window type Fastboot Boot <filename.img> i.e. Fastboot Boot rooted_boot.img and press enter
  11. You should see a couple of lines in the command window telling you it's copying over to the phone, don't worry it's not being flashed or replacing your existing installed boot image
  12. The phone should then restart and boot using the image from your computer, it will be a slightly slower boot than usual, your existing unlock method should still work
  13. Launch the Magisk app, it should already have root access because the boot image you've used is already rooted
  14. Go to Install under the top Magisk section
  15. Choose Direct Install (Recommended)
  16. Magisk will then apply root access to the boot image on the actual phone
  17. You will be prompted to reboot the phone on the bottom right, do this to complete the process
  18. You don't need the phone connected to your computer anymore as the installed boot image on the phone should now have root access
  19. You can check for root either using any app which requires root or by using an app like Root Checker


Remember to empty the contents of payload_input and payload_output once you have finished, leaving them ready for any future rom versions


4. To retain root access after ROM/OTA update :



  1. Install the update either from Oxygen Updater or from Settings > System > System updates
  2. DO NOT REBOOT when prompted
  3. Go to the Magisk app
  4. Go to Install under the top Magisk section
  5. Choose Install to Inactive Slot (After OTA)
  6. Magisk will apply root to the newly installed boot image for the next version
  7. Reboot when prompted by the Magisk app
  8. The phone should reboot into the updated version with root already applied
 
Last edited:

djsubterrain

Senior Member
Jan 4, 2012
4,112
3,834
Livingston
OnePlus 9 Pro
I'm asking where to get my ROM file, in order I should be able to extract the boot img?
A link? Somewhere on my phone?

It's pinned at the top of the entire forum :


They're also posted on OnePlus's site (eventually) :


Make sure the version matches the one you're using
 
  • Like
Reactions: SorinaLyn

Levi4cyber

Senior Member
Apr 26, 2018
139
34
OnePlus 9 Pro
I updated to latest version 11.2.4.4.LE15AA
Since there's nowhere to download the OTA package and extract the boot img, can I use the boot img of a lower version - 11.2.2.2 ?
 

djsubterrain

Senior Member
Jan 4, 2012
4,112
3,834
Livingston
OnePlus 9 Pro
I updated to latest version 11.2.4.4.LE15AA
Since there's nowhere to download the OTA package and extract the boot img, can I use the boot img of a lower version - 11.2.2.2 ?

No, definitely not.
Try Oxygen Updater in advanced mode, it should let you download the full rom.

If you were already rooted though, you should've been able to retain it by following the last section in my original post.

If not, then follow the first 2 sections
 

Levi4cyber

Senior Member
Apr 26, 2018
139
34
OnePlus 9 Pro
No, definitely not.
Try Oxygen Updater in advanced mode, it should let you download the full rom.

If you were already rooted though, you should've been able to retain it by following the last section in my original post.

If not, then follow the first 2 sections
In the oxygen updater app, if I select "full update" in update method it only gives me version 11.2.2.2., if I select "incremental update", it lets me download 11.2.4.4, and when I unzipped it I have a file payload.bin (it's only 105MB).

Should I use that? Or do I need a full OTA package to extract the boot IMG?
 

djsubterrain

Senior Member
Jan 4, 2012
4,112
3,834
Livingston
OnePlus 9 Pro
In the oxygen updater app, if I select "full update" in update method it only gives me version 11.2.2.2., if I select "incremental update", it lets me download 11.2.4.4, and when I unzipped it I have a file payload.bin (it's only 105MB).

Should I use that? Or do I need a full OTA package to extract the boot IMG?

Are you choosing the correct OnePlus 9 Pro? It'll show you different variants under the model lookup.
To be honest, If I get the update pushed via OnePlus I always copy/paste it somewhere else cos I think it gets deleted once the upgrade is done.

If you extract the payload.bin and it shows a boot.img then that should suffice. I think it should be around 105MB (I'm on my work PC at the moment so can't check)
 

glitchsys

Senior Member
May 3, 2006
212
67
Sacramento
Thanks. I'm on the T-Mobile version of the OnePlus 9 Pro, technically my phone is currently on "11.2.2.2.LE5ACB" and the one on OnePlus's support site is "11.2.2.2.LE15AA". I'm not sure the difference but I assume T-Mobile bloatware. Hopefully they didn't do anything else to make the phone work "slightly better" on their network.
I'm not sure if the boot.img I extracted from 11.2.2.2.LE15AA will work with my currently-installed "11.2.2.2.LE5ACB"; any ideas?

Might be better to create a boot.img from my existing version and patch that. Do you know the dd command for me to just create the boot.img from my existing partition? In the past with other phones I've done something like "dd if=/dev/block/mmcblk0 of=/storage/sdcard1/boot.img bs=4096 count=4096 skip=7552" or "dd if=/dev/block/bootdevice/by-name/boot of=boot.img" but I don't know which partition on the OnePlus 9 Pro to image. Any ideas?

--- Update 1 ---

Code:
OnePlus9ProTMO:/ $ ls -l /dev/block/bootdevice/by-name/*boot*                                                                                                                                          
lrwxrwxrwx 1 root root 16 1970-01-20 02:38 /dev/block/bootdevice/by-name/boot_a -> /dev/block/sde16
lrwxrwxrwx 1 root root 16 1970-01-20 02:38 /dev/block/bootdevice/by-name/boot_b -> /dev/block/sde43
lrwxrwxrwx 1 root root 16 1970-01-20 02:38 /dev/block/bootdevice/by-name/vendor_boot_a -> /dev/block/sde28
lrwxrwxrwx 1 root root 16 1970-01-20 02:38 /dev/block/bootdevice/by-name/vendor_boot_b -> /dev/block/sde55
lrwxrwxrwx 1 root root 16 1970-01-20 02:38 /dev/block/bootdevice/by-name/vm-bootsys_a -> /dev/block/sde24
lrwxrwxrwx 1 root root 16 1970-01-20 02:38 /dev/block/bootdevice/by-name/vm-bootsys_b -> /dev/block/sde51

Then looking at my active mounts I saw this:

Code:
OnePlus9ProTMO:/ $ mount | egrep "sde16|sde43|sde28|sde55|sde24|sde51"                                                                                                                                  
/dev/block/sde51 on /vendor/vm-system type ext4 (ro,seclabel,nosuid,nodev,relatime)

Which indicates that I'm on the "b" side. So I would want to create a boot.img from `/dev/block/bootdevice/by-name/vendor_boot_b` potentially. So this command "should" work, right?
Code:
dd if=/dev/block/bootdevice/by-name/vendor_boot_b of=/sdcard/Download/stock_boot.img
I might try that instead of the boot.img I extracted from 11.2.2.2.LE5ACB since it doesn't technically line up with the T-Mobile supplied ROM version.

--- Update 2 ---
Yeah, that didn't work.Turns out dd needs to be elevated to do its thing. Got a "Permission denied" when i tried to create the image. So yeah, ironically I need root to run said command and that's why I was trying to run the command, to get the boot.img to root. lol. oh well.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 34
    1. To extract the image collection from your downloaded rom :

    1. Download Payload Dumper from here (It's a zip file but it's not flashable) to your computer
    2. Extract the zip file to a folder, make it a folder you can use regularly because this is the default tool you would use from now on
    3. Download the rom version you want to root
    4. Unzip the rom to a folder, you will find a file within it called payload.bin
    5. Copy and paste that file into the "payload_input" folder within the Payload Dumper folder you created
    6. Execute the payload_dumper.exe file within Payload Dumper folder, you will not have to specify any options as it always extracts from any payload.bin file in payload_input and outputs the image files to payload_output.
    7. Leave the extraction to be completed, the program will automatically close itself once it's completed
    8. Your extracted .img files will be shown within the payload_output folder


    2. If you need to root the boot image you extracted :


    1. Copy the boot.img file from the payload_output folder to a folder on your phone storage (Best to name it appropriately if you will be doing this regularly)
    2. Download and Install the latest Magisk apk from the release site (Accept any prompt to allow install from external source)
    3. Launch the app and then choose Install under the top "Magisk" section
    4. Choose Select and Patch a File then browse to where you copied the boot.img on your storage
    5. Magisk will then apply root to the boot image you specified, Your rooted image file will be output to your phone's Download folder : /sdcard/Download
    6. You don't need to keep the default filename of the rooted image file so you can rename it appropriately for the rom version after you copy it to your computer, just ensure to keep the .img file extension
    7. If you rename the rooted boot image, try not to use spaces in the filename, rather use _ or - as spaces make it more difficult to use in a command window although when you start typing the filename you can use TAB to autocomplete it, always ensure the filename shows .img as the extension and at the end of any commandline


    3. If you need to use your rooted boot image to apply root to your phone :


    1. Install the drivers from the mounted drive you should get when connecting the phone to your computer
    2. On Windows you should then have a folder in C:\Program Files (x86)\OnePlus USB Drivers\Android with the platform tools (ADB.exe and Fastboot.exe) you will need, you can obviously copy the content from that folder somewhere else if you wish.
    3. Connect your phone to your computer
    4. Copy your rooted boot image to the folder that has adb.exe and fastboot.exe
    5. Open a command window on your computer by right clicking in that folder and choosing Open command window here
    6. In the command window, Type or copy/paste the command ADB devices and press enter
    7. If you see a prompt on your phone to allow the computer connection then accept it, better still, tell it to allow from now on also.
    8. You should see a string of characters shown in the command window, if you don't see that, then try another cable or re-install your drivers and reboot the computer.
    9. Reboot your phone into Fastboot either by using ADB on your computer ( ADB Reboot Fastboot ) or by enabling Advanced reboot in your developer options in settings and then hold down the power button and use the 3 dot menu on the top right and choosing "Bootloader"
    10. In the command window type Fastboot Boot <filename.img> i.e. Fastboot Boot rooted_boot.img and press enter
    11. You should see a couple of lines in the command window telling you it's copying over to the phone, don't worry it's not being flashed or replacing your existing installed boot image
    12. The phone should then restart and boot using the image from your computer, it will be a slightly slower boot than usual, your existing unlock method should still work
    13. Launch the Magisk app, it should already have root access because the boot image you've used is already rooted
    14. Go to Install under the top Magisk section
    15. Choose Direct Install (Recommended)
    16. Magisk will then apply root access to the boot image on the actual phone
    17. You will be prompted to reboot the phone on the bottom right, do this to complete the process
    18. You don't need the phone connected to your computer anymore as the installed boot image on the phone should now have root access
    19. You can check for root either using any app which requires root or by using an app like Root Checker


    Remember to empty the contents of payload_input and payload_output once you have finished, leaving them ready for any future rom versions


    4. To retain root access after ROM/OTA update :



    1. Install the update either from Oxygen Updater or from Settings > System > System updates
    2. DO NOT REBOOT when prompted
    3. Go to the Magisk app
    4. Go to Install under the top Magisk section
    5. Choose Install to Inactive Slot (After OTA)
    6. Magisk will apply root to the newly installed boot image for the next version
    7. Reboot when prompted by the Magisk app
    8. The phone should reboot into the updated version with root already applied
    4
    Quick question as this is my first OnePlus device.
    Will I lose root after a system update and will have to it all over again?
    Just added a new section to my original post for this.
    1
    Very nice write up! Hopefully many will read this and follow instructions. Too many threads being created with issues because they never bother to read.
    1
    I'm asking where to get my ROM file, in order I should be able to extract the boot img?
    A link? Somewhere on my phone?

    It's pinned at the top of the entire forum :


    They're also posted on OnePlus's site (eventually) :


    Make sure the version matches the one you're using
    1
    When I click on the payload_pumper.exe file, the cmd window flashes and nothing else happens.