[Galaxy S 4 i9505 Original Android Development] danerrickcuba@gmail.com:
This is known since 100 of pages back , but I'll just guide you:

1.First you'll need to setup your ADB environment,

Download this adb tool and run executable inside the zip file...

https://www.dropbox.com/s/ok7qfuvyparclsi/adb-setup-1.4.2.zip?dl=0

It'll configure within a cmd shell and auto close!

2.Now you'll need to get mbtool_recovery that's meant for your device, you can get this a couple of ways, I'll use this:

Rename using your PC your dualbootpatcher.apk (which ever name it is) , to dual boot patcher.zip then open this in your file explorer on your pc till you find this file \assets\data-8.0.0.rxxx.gd5c4139.tar.xz(the name ain't important) ...then open the *.tar.xz with 7zip or winrar till you're in /binaries/android/ folder, you'll see 4 folders , here just select the one that matches your device architecture and then inside the folder for your device architecture copy the file : mbtool_recovery to the root of your drive C, ie. C:\ or where ever you like, just remember the path!

3.turn on your USBDEBUG mode on your Android device from developer settings!

And install your device drivers if you've got them, or just download them!

4.with your device connected to your PC run CMD "command" it should start in this path C:\users\username>

Write cd.. (please mind the 2 dots)

And repeat that again ie. cd.. You should after this 2 commands be more on root drive C

I.e. C:\>

5.Now reboot your device/phone into recovery mode....connected to PC(with debug enabled) type adb devices(this is to make sure your device it's connected, otherwise if not listed reinstall drivers for your device)

Now mount system directory...

Write this command: adb shell mount /system

Now push the mbtool_recovery to /tmp/ using this command: adb push armeabi-v7a/mbtool_recovery /tmp/

This is ran from the folder containing mbtool_recovery ...

I.e. C:\> thus C:\>adb push armeabi-v7a/mbtool_recovery /tmp/ use the folder where you've placed the mbtool_recovery from above

Plz replace armeabi-v7a with your device architecture,i.e. arm64-v8a,x86 or x86_64

Now make backups using command: adb shell MBTOOL_NO_MULTICALL=true /tmp/mbtool_recovery backup -r (whats being backed up) -d /sdcard/MTBoots/backups -n (name of backup)

E.g. adb shell MBTOOL_NO_MULTICALL=true /tmp/mbtool_recovery backup -r primary -d /sdcard/MTBoots/backups -n mybackup

Thus I made a backup from primary slot with the name mybackup!

Plz note:

-d /sdcard/MTBoots/backups... This means that your backup will go to sdcard/MTBBoots/backups folder, you can specify a different path, i.e. -d /external_sd/mypath or even not specify a path a let default paths be used, in which case the command will be : adb shell MBTOOL_NO_MULTICALL=true /tmp/mbtool_recovery backup -r primary -n mybackup

Important :

if you get PERMISION DENIED while executing the above command....use your file manger(from within TWRP) navigate to /tmp/ folder and open it, then select the mbtool_recovery inside this folder and set the 755 permission from the pop up window!

You should by now have a working backup!

6.To restore the backup, command:

adb shell MBTOOL_NO_MULTICALL=true /tmp/mbtool_recovery restore -r (where to restore the back up) -d /sdcard/MTBoots/backups -n (name of backup)

I.e. adb shell MBTOOL_NO_MULTICALL=true /tmp/mbtool_recovery restore -r data-slot-1 -d /sdcard/MTBoots/backups -n primary

My backup it's at /sdcard/MTBoots/backups and it's name is mybackup

Then command is:

adb shell MBTOOL_NO_MULTICALL=true /tmp/mbtool_recovery restore -r data-slot-1 -d /sdcard/MTBoots/backups -n mybackup

Thus I've restored primary slot ROM to data-slot-1, this works for any backup...you can restore it anywhere , on ext-slot-* or data-slot-* or multi-slot-* and even primary and dual!!!

Good luck!

I just rewrote what [MENTION=4277844]chenxiaolong[/MENTION] already explained some pages way back...

Thanks to him, this is essential feature of this patcher!