[Tutorial] Android OTA payload dumper on Android

Search This thread
G

GuestK00376

Guest
Introduction
This tutorial will teach you how to specifically extract the boot.img from your OTA/ROM's payload.bin on your Android device, rather than a computer.

In addition to this, you will also have the ability to access all other img files that are packaged with the payload.bin.

The boot partition contains a kernel image and a RAM disk combined via mkbootimg.
You would generally want to keep a copy of your current OTA/ROM's boot.img in the event that you want to recover your devices boot partition when you want to switch kernels, or repairing a corrupted device due to kernel/RAM disk issues.

Prerequisites
Termux Installed: Official Play Store Link | Official F-Droid Link
payload_dumper: Official GitHub Link

To get started

Code:
# Extract payload_dumper folder contents to: /storage/emulated/0/payload_dumper/
# Extract payload.bin from your OTA/ROM to: /storage/emulated/0/payload_dumper/
$ pkg install python -y
$ pip install --upgrade pip
$ apt update && apt upgrade -y
$ termux-setup-storage
# Allow Termux access photos, media and files on your device
$ cd storage/shared/payload_dumper
$ pip install -r requirements.txt
$ python payload_dumper.py payload.bin
# You will find the dumped payload in /storage/emulated/0/payload_dumper/output

Sources
https://explainshell.com/explain?cmd=sudo+apt-get+update+&&+sudo+apt-get+upgrade
https://github.com/python/cpython
https://packaging.python.org/tutorials/installing-packages/
https://github.com/vm03/payload_dumper
https://termux.com/
https://wiki.termux.com/wiki/Python
https://source.android.com/devices/bootloader/partitions-images
https://wiki.termux.com/wiki/Internal_and_external_storage
 

creeve4

Senior Member
Jan 5, 2011
2,829
572
Bountiful
I am getting the following error and I cannot figure out how to fix it:

Code:
Processing LOGO partitionTraceback (most recent call last):
  File "payload_dumper.py", line 157, in <module>
    dump_part(part)
  File "payload_dumper.py", line 100, in dump_part
    out_file = open('%s/%s.img' % (args.out, part.partition_name), 'wb')
FileNotFoundError: [Errno 2] No such file or directory: 'output/LOGO.img'
 

serraxer

Senior Member
Oct 25, 2012
53
26
Thank you a lot Man!
This method working great with OnePlus 7 pro. Extracted system.img from Hydrogen, will try reflash it to Oxygen rom.
 
Last edited:

ltth

Senior Member
Dec 13, 2018
136
13
74
Malmo
Samsung Galaxy S21 Ultra
Introduction
This tutorial will teach you how to specifically extract the boot.img from your OTA/ROM's payload.bin on your Android device, rather than a computer.

In addition to this, you will also have the ability to access all other img files that are packaged with the payload.bin.

The boot partition contains a kernel image and a RAM disk combined via mkbootimg.
You would generally want to keep a copy of your current OTA/ROM's boot.img in the event that you want to recover your devices boot partition when you want to switch kernels, or repairing a corrupted device due to kernel/RAM disk issues.

Prerequisites
Termux Installed: Official Play Store Link | Official F-Droid Link
payload_dumper: Official GitHub Link

To get started

Code:
# Extract payload_dumper folder contents to: /storage/emulated/0/payload_dumper/
# Extract payload.bin from your OTA/ROM to: /storage/emulated/0/payload_dumper/
$ pkg install python -y
$ pip install --upgrade pip
$ apt update && apt upgrade -y
$ termux-setup-storage
# Allow Termux access photos, media a
[QUOTE="GuestK00376, post: 81933401"]
Introduction
This tutorial will teach you how to specifically extract the boot.img from your OTA/ROM's payload.bin on your Android device, rather than a computer.

In addition to this, you will also have the ability to access all other img files that are packaged with the payload.bin.

The boot partition contains a kernel image and a RAM disk combined via mkbootimg.
You would generally want to keep a copy of your current OTA/ROM's boot.img in the event that you want to recover your devices boot partition when you want to switch kernels, or repairing a corrupted device due to kernel/RAM disk issues.

Prerequisites
Termux Installed: Official Play Store Link | Official F-Droid Link
payload_dumper: Official GitHub Link

To get started

[CODE]# Extract payload_dumper folder contents to: /storage/emulated/0/payload_dumper/
# Extract payload.bin from your OTA/ROM to: /storage/emulated/0/payload_dumper/
$ pkg install python -y
$ pip install --upgrade pip
$ apt update && apt upgrade -y
$ termux-setup-storage
# Allow Termux access photos, media and files on your device
$ cd storage/shared/payload_dumper
$ pip install -r requirements.txt
$ python payload_dumper.py payload.bin
# You will find the dumped payload in /storage/emulated/0/payload_dumper/output

Sources
https://explainshell.com/explain?cmd=sudo+apt-get+update+&&+sudo+apt-get+upgrade
https://github.com/python/cpython
https://packaging.python.org/tutorials/installing-packages/
https://github.com/vm03/payload_dumper
https://termux.com/
https://wiki.termux.com/wiki/Python
https://source.android.com/devices/bootloader/partitions-images
https://wiki.termux.com/wiki/Internal_and_external_storage

nd files on your device
$ cd storage/shared/payload_dumper
$ pip install -r requirements.txt
$ python payload_dumper.py payload.bin
# You will find the dumped payload in /storage/emulated/0/payload_dumper/output[/CODE]


[/QUOTE]
Started with this "$ pkg install python -y" but installing process was ending with ... see my screen shot.
 

Attachments

  • Screenshot_20210509-013104298.jpg
    Screenshot_20210509-013104298.jpg
    470.1 KB · Views: 405

SidneyD

Senior Member
Sep 15, 2016
54
8
LG V20
OnePlus 7T Pro
Last edited:

nu2moding

Senior Member
Aug 17, 2011
93
14
trying to extract boot.img from a rom, getting the following error...
" MutableMapping = collections.MutableMapping
AttributeError: module 'collections' has no attribute 'MutableMapping' "

any way to fix?
 

Attachments

  • Screenshot_20220130-091229_Pixel Launcher.png
    Screenshot_20220130-091229_Pixel Launcher.png
    473.6 KB · Views: 33

Top Liked Posts