This is a step by step guide on how to backup an Android phone's firmware / partitions using adb. This covers partitions like boot, recovery, system etc.
Important Notice
A box / dongle can enable you easily achieve this without root
Method 1: ADB Method I
- Install a root browser (e.g ROM Toolbox lite) and navigate to dev/block/platform . Open each folder in the platform folder till you find a folder named "by-name". Replace "your_folder" in the code below with the name of the folder which contains the by-name folder
- Launch ADB and type the code below. Press Enter after each lineCode:
adb shell
ls -al /dev/block/platform/your_folder/by-name - You should get an output of the phone's mount points
- Type the code below to dump the partition of your choiceCode:
adb shell
su
dd if=/yourMountingPoint of=/yourDestination/partitionType - For exampleCode:
adb shell
su
dd if=/dev/block/mmcblk0p9 of=/sdcard/system.img
Method 2: ADB dd 2
- Launch ADB and run the command belowCode:
adb shell
cat /proc/dumchar_info - You should have an output likeCode:
Part_Name Size StartAddr Type MapTo Region
preloader 0x0000000000040000 0x0000000000000000 2 /dev/misc-sd BOOT_1
mbr 0x0000000000080000 0x0000000000000000 2 /dev/block/mmcblk0 USER
ebr1 0x0000000000080000 0x0000000000080000 2 /dev/block/mmcblk0p1 USER
pro_info 0x0000000000300000 0x0000000000100000 2 /dev/block/mmcblk0 USER
nvram 0x0000000000500000 0x0000000000400000 2 /dev/block/mmcblk0 USER
protect_f 0x0000000000a00000 0x0000000000900000 2 /dev/block/mmcblk0p2 USER
protect_s 0x0000000000a00000 0x0000000001300000 2 /dev/block/mmcblk0p3 USER
seccfg 0x0000000000020000 0x0000000001d00000 2 /dev/block/mmcblk0 USER
uboot 0x0000000000060000 0x0000000001d20000 2 /dev/block/mmcblk0 USER
bootimg 0x0000000001000000 0x0000000001d80000 2 /dev/block/mmcblk0 USER
recovery 0x0000000001000000 0x0000000002d80000 2 /dev/block/mmcblk0 USER
sec_ro 0x0000000000600000 0x0000000003d80000 2 /dev/block/mmcblk0p4 USER
misc 0x0000000000080000 0x0000000004380000 2 /dev/block/mmcblk0 USER
logo 0x0000000000300000 0x0000000004400000 2 /dev/block/mmcblk0 USER
expdb 0x0000000000a00000 0x0000000004700000 2 /dev/block/mmcblk0 USER
tee1 0x0000000000500000 0x0000000005100000 2 /dev/block/mmcblk0 USER
tee2 0x0000000000500000 0x0000000005600000 2 /dev/block/mmcblk0 USER
kb 0x0000000000100000 0x0000000005b00000 2 /dev/block/mmcblk0 USER
dkb 0x0000000000100000 0x0000000005c00000 2 /dev/block/mmcblk0 USER
android 0x0000000080000000 0x0000000005d00000 2 /dev/block/mmcblk0p5 USER
cache 0x0000000010000000 0x0000000085d00000 2 /dev/block/mmcblk0p6 USER
usrdata 0x000000030ce00000 0x0000000095d00000 2 /dev/block/mmcblk0p7 USER
bmtpool 0x0000000001500000 0x0000000001500000 2 /dev/block/mmcblk0 USER - If you wish to dump recovery.img for example, take note of the recovery lineCode:
recovery 0x0000000001000000 0x0000000002d80000 2 /dev/block/mmcblk0 USER
- Convert the Size and StartAddr values from Hexadecimal to Decimal then divide by 4096 (which is the Block Size)
Run the command belowCode:#mount -o ro,remount /emmc@android /system
dd if=/dev/block/mmcblk0 bs=4096 skip=StartAddr count=Size | gzip > /data/local/tmp/recovery.img.gz - For Recovery in this example, it'll beCode:
#mount -o ro,remount /emmc@android /system
dd if=/dev/block/mmcblk0 bs=4096 skip=11648 count=4096 | gzip > /data/local/tmp/recovery.img.gz - Check your device for the dumped image
Method 3: ADB + ROMdump.zip method
- Setup ADB
- Download ROMdump
- Extract the file named "Install" from the ROMdump zip file and copy it to the same location as adb.exe
- Enable USB debugging on the phone (Settings > Developer > Tick USB Debugging) and connect the phone to PC
- Launch adb.exe (Open the adb folder > Hold Shift button > Right-click on any empty space > Select Open Command Window here)
- In the command window, type the following commands and press Enter after each:Code:
adb devices
adb push install /data/local/
adb shell chmod 04755 /data/local/install
adb shell /data/local/install - Wait till pushing is complete
- Toggle Wi-Fi On then Off or Off then On then Off (depending on its current state)
- Type the command below in the command window then press EenterCode:
adb shell romdump
- Wait for the process to be complete and you'll have your ROMdump
- You'll find your files in a folder named romdump in the root of the SD card
Method 4: Terminal + ROMdump.zip method
- Ensure the phone is rooted (see https://blog.hovatek.com/how-to-root-and...ithout-pc/ )
- Install Android Terminal Emulator
- Download ROMdump
- Extract the file named "Install" from the ROMdump zip file and copy it to the root of the SD card (as in copy directly and not into any folder)
- Launch Terminal Emulator and type the following commands then press Enter after eachCode:
su
cat /sdcard/install >/data/local/install
chmod 04755 /data/local/install
/data/local/install - Wait for the process to complete
- Toggle Wi-Fi On then Off or Off then On then Off (depending on its current state)
- Type the command below in Terminal Emulator then press EnterCode:
/system/bin/romdump
- Wait for the process to complete and you're done
- You'll find your files in a folder named romdump in the root of the SD card
Method 5: ADB Method II
- Note: Only use this method for Boot and Recovery images, not for System image
Also, you can use Terminal Emulator for this method instead of ADB - Setup ADB
- Launch adb.exe (Open the adb folder > Hold Shift button > Right-click on any empty space > Select Open Command Window here)
- In the command window, type the following command then press EnterCode:
adb shell
- If you're using Terminal emulator instead of ADB then typeCode:
su
- TypeCode:
cat proc/mtd
Code:cat proc/emmc
- You'll get an output similar to this:Code:
dev: size erasesize name
mtd0: 000a0000 00020000 "misc"
mtd1: 00480000 00020000 "recovery"
mtd2: 00300000 00020000 "boot"
mtd3: 0fa00000 00020000 "system"
mtd4: 02800000 00020000 "cache"
mtd5: 093a0000 00020000 "userdata" - To dump the recovery image to your SD card, take note of the first word of the line which says “recovery” in the end. It is ‘mtd1’ in this example. Now use the command below, replacing ‘mtd1’ with the term that applies in your case, if different then press Enter:Code:
dd if=/dev/mtd/mtd1 of=/sdcard/recovery.img bs=4096
- For boot image in this example, type the command below then press EnterCode:
dd if=/dev/mtd/mtd2 of=/sdcard/boot.img bs=4096
- You should have your partition images dumped to the root of your SD card
Method 6: AIO Flasher Method
- Download AIO Flasher
- Launch it
- Enable USB debugging on the phone (Settings > Developer > Tick USB Debugging) and connect to PC via USB cord
- Go to The Backup / Restore tab
- Click on Install RomDump and ait till the log by the right showsCode:
Pushing Romdump...
Installed. - Click Dump!
- Once complete, You'll find your files in a folder named romdump in the root of the SD card
Important Notice
A box / dongle can enable you easily achieve this without root
No comments:
Post a Comment