[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,867
590
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
60
27
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
150
13
76
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: 693

SidneyD

Senior Member
Sep 15, 2016
54
9
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: 84

Fap4k

Senior Member
Jul 5, 2013
613
167
Mumbai
This doesn't work!!

Edit:
This working fine. Just figured out the play Store version of termux is outdated.
 

Attachments

  • Screenshot_2022-10-23-19-38-03-50_84d3000e3f4017145260f7618db1d683.jpg
    Screenshot_2022-10-23-19-38-03-50_84d3000e3f4017145260f7618db1d683.jpg
    640.6 KB · Views: 77
Last edited:

Codeman785

Member
Nov 4, 2016
6
1
There is no longer a payload dumper release available to download on github, it is labeled android ota payload dumper, so I'm assuming Windows payload dumper will not work for this?
 

Top Liked Posts