[Miscellaneous Android Development] bigrammy:
[NEW]dd-backup helper script.

I wrote a little backup helper script to assist with making a backups using the dd cmd.​

Note It Does Not Perform the Backup for you! Also If you have issues with this Please PM so the thread does not become bogged down with this OT. Note a far more advanced tool for use with Termux app is now available thanks to [MENTION=5312578]mrmazak[/MENTION] you can get that from HERE

Change Log: please read them

ADD mrmazak Advanced tool HERE

V4.1 Now considered stable.

Moved to github for ease of updating.

Previous version now removed from downloads.

What Does It Do Then?

When you run the dd-backup.sh it will do the following.

1. It creates a folder on your sdcard called dd-backup.

2. It then finds your by-name path and adds them to a text file.

3. It adds the full path to everything in the by-name folder.

4. It then edit's paths for use with dd.

5. When it's finished you will have a text file in the dd-backup folder.

The new text file will look something like this example.

dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/boot of=/sdcard/mtk-su-backup/boot.img
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/lk of=/sdcard/mtk-su-backup/lk.img
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/recovery of=/sdcard/mtk-su-backup/recovery.img
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/protect1 of=/sdcard/mtk-su-backup/protect1.img
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/para of=/sdcard/mtk-su-backup/para.img
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/proinfo of=/sdcard/mtk-su-backup/proinfo.img

You can now copy and paste which partition you want to backup to the cmd prompt and hit enter dd will now copy the boot partition for example to your /sdcard/dd-backup folder and name it boot.img. :good:

Because the folder, text file, boot.img where created by root they will probably not be visible via mtp although they do exist.

If this is the case you can use adb from your PC to pull the dd-backup.txt, boot.img or any other file to your PC.

adb pull /sdcard/dd-backup/dd-backup.txt ~/Desktop

The above pulls the dd-backup.txt to your Desktop when using Linux.

adb pull /sdcard/dd-backup/dd-backup.txt C:\Users\[COLOR="blue"]yourname[/COLOR]\Desktop

I think it's something like the above for Windows :silly:

How do I run dd-backup.sh?

So from the very top using the Termux App and mtk-su.

1. Copy dd-backup.sh and the mtk-su that works for your device to the root of your internal /sdcard

2. Open termux app and enter the following cmd's.

cp /sdcard/mtk-su $HOME

cp /sdcard/dd-backup.sh $HOME

chmod 755 mtk-su

chmod 755 dd-backup.sh

./mtk-su -v

You should see:

New UID/GID: 0/0

Note which /bin you are in also and if you need to install "paste" or not as above under "Important please READ".

If all is good then enter

./dd-backup.sh

This took me around 6 days to work out how to do it so if it saved you some time then please take a second to say thanks by using the :good: button and don't forget to hit [MENTION=8132642]diplomatic[/MENTION] :good: button too as without his Amazing mtk-su this would not even be possible let alone so quick and simple!!

Tried and tested and confirmed working on my Nokia3 (MT6737) Android 8.1 using the termux.apk.

Screenshot Here

DOWNLOAD HERE

Github download V4.1

Thanks to [MENTION=8953766]HemanthJabalpuri[/MENTION] for inspiring me to finish this script even though I didn't end up using your suggestions due to my lack of understanding. :)

Big Thanks to [MENTION=8978978]Rortiz2[/MENTION] for testing a giving his feedback. It really does help me a lot.

Special thanks to [MENTION=5312578]mrmazak[/MENTION] for help via PM :D

:cool::cool: