• If you are experiencing issues logging in, we moved to a new and more secure software and older account passwords were not able to be migrated. We recommend trying to reset your password, then contacting us if there are issues.
  • Nearly done! Migration cleanup is mostly done. There are a small number of issues left that we continue to work on, but all the heavy lifting is done. We still would love to hear feedback over at this thread and also check out the new XDA app! Thanks and we hope you enjoy the new forums, and thanks for your support of XDA <3

[MI 4i/ferrari][OFFICIAL] DualbootPatcher - a much simpler dual boot solution

faizauthar12

Recognized Developer / Inactive Recognized Contrib
Jan 26, 2014
1,872
2,688
113
Jakarta


Informations

Hey guys, today i will show DualBootPatcher one of the best apps for multi ROMs (i think this is the unique app for this :p).
I have managed to support Xiaomi Mi 4i.
I am not the creator, just the supporter

Disclaimer

Your warranty is now void.
I am not responsible for bricked devices, dead SD cards, thermonuclear war, or you getting fired because the alarm app failed. Please do some research if you have any concerns about features included in this ROM before flashing it! YOU are choosing to make these modifications, and if you point the finger at me for messing up your device, I will laugh at you. Hard. A lot.


It patches...

  • Custom kernels for dual boot support
  • ROMs so that they can be installed as secondary
  • Google Apps packages for AOSP-based ROMs
  • SuperSU so that it can be used in the secondary ROM

NOTE: If you want to dualboot a Miui ROM, I highly recommend installing Miui as the primary ROM. Otherwise, any mods will need to be patched before flashing.

What's supported?
Except Toaster and Alarm clocks pretty much everything is supported.

How to use the patcher


Android

Download the patcher apk and run it. Tap "Patch Zip File" from the navigation drawer and choose the file you want to patch.

Windows (GUI)

Double click DualBootPatcher.exe and choose the file you want to patch.

--------

After patching the zip file, a new file, like some_rom_dual.zip file will be created. For example, patching ktoonsez's

KT-SGS4-JB4.3-AOSP-TMO-08.28.2013.zip

would create a new

KT-SGS4-JB4.3-AOSP-TMO-08.28.2013_dual.zip


Instructions for dual booting


Before doing anything, download the Dual Boot Patcher app and the DualBootUtilities.zip from the download section below.

The patcher offers several locations for installing ROMs:

  • Primary: This is normally used for installing a zip to the primary ROM. It is not required, but is strongly recommended because it has code to prevent the zip from inadvertently affecting other ROMs.
  • Dual: Dual/Secondary is the first multiboot installation location. It installs to the system partition. This is a good spot for installing a second ROM because it doesn't take any space away from the internal storage.
  • Multi-slots: There are 3 multislots: multi-slot-1, multi-slot-2, multi-slot-3. These install to the cache partition. This is specifically for devices, like the Galaxy S4, that have a massive cache partition.
  • Data-slots: There can be an unlimited number of data slots. These install to the data partition and eat up space on the internal storage. This is useful for devices where the system partition is nearly full and the cache partition is tiny. These slots are named "data-slot-[id]", where "id" is something you provide in the app.

With that said, let's get to the "how to"!

  1. First, boot into your primary ROM and install the Dual Boot Patcher app
  2. Open the app and go to "Roms" in the navigation drawer. It will ask if you want to set the kernel. Make sure that you do.
  3. Go to "Patch zip file" in the navigation drawer and patch the ROM or zip you want to install. You can select one of the installation locations described above.

There are two ways of flashing the patched zip file. You can either flash it normally from recovery or flash it using the in-app flashing feature. Both methods are explained below.

Flashing from recovery

To flash from recovery, just flash the patched zip file like you would for any other zip. Nice and simple.

In-app flashing

To use in-app flashing, go to "Roms" in the navigation drawer, tap the floating button on the bottom right, and add the zips you want to install. You can queue multiple zips and they will all be flashed in one go. Once you've added all the zips you want to flash, click the check mark in the action bar and they will be flashed right away.

A normal backup from recovery will backup every ROM. If you would like to back up ROMs individually, please see @rlorange's awesome tool: http://forum.xda-developers.com/showthread.php?t=2491299


App and data sharing


DualBootPatcher very recently got support for sharing apps and their data across ROMs. Maybe sharing is somewhat of a misleading term. The feature actually makes Android load the shared apps and data from a centralized location, /data/multiboot/_appsharing. So you're not sharing apps from one ROM to another per se. The ROMs are just loading the apps from one shared location. Let me make this clearer with an analogy.

Think of the people in a company office as ROMs. You want to share with your coworkers some documents (apps). Instead of telling them to come over to your desk to see those documents (sharing apps from one ROM to another), everyone goes to the conference room to look at the documents together (loading apps from a shared location). That's how app and data sharing is implemented.

To use app sharing, follow these steps in every ROM that you want to use app sharing:

  • Install the app you want to share
  • Open DualBootPatcher and go to "App Sharing" in the navigation drawer
  • Enable individual app sharing
  • Tap "Manage shared applications" and enable APK/data sharing for the app
  • Reboot

When you uninstall an app that's shared, it simply become unshared for the current ROM. That way, other ROMs are not affected. To continue the analogy above, if you quit your job, you won't shred the documents that everybody else was looking at.

If you unshare an app's data, it will go back to using the data it had before it was shared. In other words, you leave the conference room and go back to work on your own documents at your desk.

(Hope my analogy didn't suck too much :p)


How do I...?


Switch the ROM if something doesn't work properly?
You can flash the DualBootUtilities zip from recovery. It will provide a menu interface that allows switching to the various ROMs.

If you have TWRP, you can also switch manually by tapping Install -> Images (bottom right) -> Go to /sdcard/MultiBoot/[Your ROM]/ -> flash boot.img.​

Wipe /cache, /data, /system, or dalvik-cache?

The easiest way is to do it from the app while booted in another ROM. Just go to "Roms" in the navigation drawer, tap the 3 dots options menu for the ROM you want to wipe, and tap "Wipe ROM".

Alternatively, flash the DualBootUtilities zip from recovery, which will also allow you to wipe a ROM.

NOTE: Don't use the recovery's built-in wiping abilities as that may delete non-primary ROMs!​

Update the primary ROM?

Patch the zip for primary and flash it. The "primary" installation target is designed so that other ROMs won't be affected when you want to flash something for the primary ROM.​

Update a non-primary ROM?

Patch and flash the zip exactly like how you did it the first time.​

Flash a mod or custom kernel for the primary ROM?

Patch it for primary before flashing. If the zip does not wipe /cache, it is also safe to flash it directly.​

Flash a mod or custom kernel for a non-primary ROM?

Just patch and flash it :)



Downloads:

I recommend against using the stable version of the patcher right now. So many changes have been made in regards to device support, ROM support, and general bug fixes that it's better to use the unstable snapshot builds until the next stable release is made.


[LINK] Dual Boot Patcher (Snapshots) and DualBootUtilities recovery zip


Source code:




Know Issues

- The ROMs section sometimes bug and get a infinite refresh, close the app and open app again.
- Simple Anouncement : Please refrain from using /system and /cache partitions for secondary rom install


Special Thanks

@chenxiaolong for the awesome DualBootPatcher. @onano for intial works on Xiaomi devices, helping me with builds and also his thread template for Redmi 1S :p
@thewisenerd for initial bringing up Dual Boot Patcher to Xiaomi Mi 4i

XDA:DevDB Information
[MI 4i/ferrari][OFFICIAL] DualbootPatcher - a much simpler dual boot solution, ROM for the Xiaomi Mi 4i

Contributors
faizauthar12, thewisenerd, chenxiaolong, onano
ROM OS Version: 2.3.x Gingerbread

Version Information
Status: Testing

Created 2016-12-05
Last Updated 2016-12-07
 

faizauthar12

Recognized Developer / Inactive Recognized Contrib
Jan 26, 2014
1,872
2,688
113
Jakarta
Reserved

/* FAQ */

Q: is that possible to dual booting Miui with cm/AOSP rom?
A: yes it's possible, the primary rom must be Miui

Q: can i dual boot Miui and Miui?
A: you can't , while installing the secondary rom, you will got an error or something like that

Q: can we dual boot Miui 6 with anything or vice versa?
A: no you can't it will flash / patch the current primary Miui rom with the rom flashable zip

Q: is there is anyone do Miui and cm?
A: yes is it, go here (give him a thanks tho)

a video tutorial by @sharan.nyn
is here
 
Last edited:

apna.suresh0305

Senior Member
May 12, 2012
76
7
0
Did anyone try this....?? I tried and getting an error(Unfortunately Dual Boot patcher(Debug) has stopped) while patching the ROM zip file. I am using the unofficial patcher app as advised in the instructions. Official app doesn't have the Mi4i in the device list hence not able to patch the zip. Can anyone please through some light to go forward.
 

thewisenerd

Elite Member
Sep 27, 2012
1,385
2,995
0
Did anyone try this....?? I tried and getting an error(Unfortunately Dual Boot patcher(Debug) has stopped) while patching the ROM zip file. I am using the unofficial patcher app as advised in the instructions. Official app doesn't have the Mi4i in the device list hence not able to patch the zip. Can anyone please through some light to go forward.
Which ROM zip did you try to patch?

I was able to patch cm-12.1 zips correctly. Haven't tried with Marshmallow yet.
 

apna.suresh0305

Senior Member
May 12, 2012
76
7
0
Appreciate if we could get the support for Elephone M2 as well....??? Below is the url for device thread.
http://forum.xda-developers.com/elephone-m2

---------- Post added at 12:01 PM ---------- Previous post was at 11:55 AM ----------

Which ROM zip did you try to patch?

I was able to patch cm-12.1 zips correctly. Haven't tried with Marshmallow yet.
I tried below mokee official builds...
http://download.mokeedev.com/?device=ferrari&type=release

I did a trick that the patcher is installed in my other mobile "Elephone M2" and patched zip files successfully, then moved those files again to Mi4i and installed. It worked.

Surprisingly i could able to patch from my secondary ROM (Mokee) but not from the primary rom(MIUI). I believe that MIUI rom is not supporting for patching it seems.
 
Last edited:

hashroot

Senior Member
Feb 2, 2012
612
1,597
0
Mumbai
thetechndroid.com
Appreciate if we could get the support for Elephone M2 as well....??? Below is the url for device thread.
http://forum.xda-developers.com/elephone-m2
don't spam orig dev section, use private messaging system
---------- Post added at 12:01 PM ---------- Previous post was at 11:55 AM ----------


I tried below mokee official builds...
http://download.mokeedev.com/?device=ferrari&type=release

I did a trick that the patcher is installed in my other mobile "Elephone M2" and patched zip files successfully, then moved those files again to Mi4i and installed. It worked.

Surprisingly i could able to patch from my secondary ROM (Mokee) but not from the primary rom(MIUI). I believe that MIUI rom is not supporting for patching it seems.
provide logcat if possible
 

stiw47

Senior Member
Apr 27, 2011
167
39
0
Belgrade
Thanks a lot for this, after years of runing multi boot on laptop, now I can runing multi boot on phone also. I have succses with triple boot install, everything is working well except one little thing: can in-app switch to another rom only if I on primary (RR 5.1.1), but, if on secondary (slim bit 6.0.1) or on data-slot rom (RR 6.0.1), I can switch to another rom only from twrp via flashing boot.img, even DualBootUtility.zip not working.



I have a one question: What is a Leaks app, who cames with DualBoot patcher app?? What means all that notifications/messages MainActivity leaks, leaks this, leaks that, etc... and what mean that message about memory dumping?? Thanks for answer.
 

stiw47

Senior Member
Apr 27, 2011
167
39
0
Belgrade
If you want to install cm13 as a secondary, that mean cm13 will be installed in chroot environment inside your MIUI ROM, exact path is /system/multiboot/dual. MIUI is "little big" rom, did you check how much free space you have in your MIUI /system partition? And what kind of error you got in recovery when you try to flas secondary.

In any case, steps for flashing are:
1. Boot into MIUI
2. Open Dual Boot Patcher app
3. Go to "Patch Zip File" option
4. Add your cm13.zip (and gapps optional), choose "secondary" on popup, if you want to install as a secondary on /system partition of existing rom
5. Press check mark in top right corner to patch zips you added
6. Boot into TWRP and flash cm13-blah-blah-dual.zip (and gapps-blah-blah-dual.zip optional) just normal, as a usually roms.
That's it.
 
Last edited:

tangytomm

Member
Nov 20, 2015
23
0
0
Do i need to patch primary rom also before installing secondary?
I tried to upgrade primary stock rom with primary patched rom, got error cannot flash over rom through Dual Boot Patcher App.
I tried to clean install primary via TWRP, got error Failed to compute sha1sum of boot. Failed to flash zip file.

How do i make it work? Do I keep primary stock ROM as it is (MIUI) or patch primary ROM and flash secondary CM13.
 

tangytomm

Member
Nov 20, 2015
23
0
0
Thanks a lot for this, after years of runing multi boot on laptop, now I can runing multi boot on phone also. I have succses with triple boot install, everything is working well except one little thing: can in-app switch to another rom only if I on primary (RR 5.1.1), but, if on secondary (slim bit 6.0.1) or on data-slot rom (RR 6.0.1), I can switch to another rom only from twrp via flashing boot.img, even DualBootUtility.zip not working.



I have a one question: What is a Leaks app, who cames with DualBoot patcher app?? What means all that notifications/messages MainActivity leaks, leaks this, leaks that, etc... and what mean that message about memory dumping?? Thanks for answer.
Can you explain the procedure step by step how did you manage to get triple boot ? Thanks
 

stiw47

Senior Member
Apr 27, 2011
167
39
0
Belgrade
Hello. Somewhen at begining of this year, I was use some unofficial version of this app on MI 4i, founded here, in this thread, and mentioned version was working properly. Now, I want to fire up multiboot again, but as I see, things was changed here. Actualy, there is not MI 4i as supported device in latest snapshot provided in first post. Can someone give me a link for previous unofficial Dual Boot Patcher app?

Thanks in advance.

EDIT: Sorry, guys, such a stupid from my side. I found an app, in first post ofcourse.
 
Last edited:

stiw47

Senior Member
Apr 27, 2011
167
39
0
Belgrade
It's possible :)

Sorry cause double post, but just for info, I successful running a MIUI V8.0.2.0.LXIMIDG Global Stable in dual boot with ResurrectionRemix-M-v5.7.4-20161005-ferrari from @Rohan purohit

Yes, yes, MIUI 8 in combination with M custom ROM on same phone. We already know, if we want to install L or M custom ROM on our phone, we must have 6.x.x firmware as a base. Procedure for making dual boot MIUI 8 + L/M custom ROM is same as usually. Main trick is how to switch ROM. Again, same as usually, but before every switching, you have to flash firmware files from recovery - 6.x.x if you switching to custom ROM and 8.x.x if you switching to MIUI.

Conclusion: I realy don't like MIUI, I am a person who like AOSP way, but MIUI camera is really really great, and some other features are pretty cool, now I have best from both world.

Unfortunately, this thread is little dead :( , but if you want to setup something like this or similarly, and stuck somewhere, be free to ask here or PM me, and I can write some mini tut with steps.
 

fonefan88

Member
Jul 17, 2015
24
1
0
Sorry cause double post, but just for info, I successful running a MIUI V8.0.2.0.LXIMIDG Global Stable in dual boot with ResurrectionRemix-M-v5.7.4-20161005-ferrari from @Rohan purohit

Yes, yes, MIUI 8 in combination with M custom ROM on same phone. We already know, if we want to install L or M custom ROM on our phone, we must have 6.x.x firmware as a base. Procedure for making dual boot MIUI 8 + L/M custom ROM is same as usually. Main trick is how to switch ROM. Again, same as usually, but before every switching, you have to flash firmware files from recovery - 6.x.x if you switching to custom ROM and 8.x.x if you switching to MIUI.
Hey I'm trying to do exactly that! But I'm a little confused about what you mentioned - I am currently running MIUI 8 and wanted to flash a custom M ROM with the DualBoot Patcher, do I need to flash MIUI 6 before doing this? Or can I proceed to setting up the dualboot alongside MIUI 8? I also didn't understand what you meant about switching between the ROMs, do I need to flash a different version of MIUI to the MIUI partition every time I want to switch?

Sorry for so many questions, I was just confused about that and really wanted to do this, to get the best both MIUI and clean Android! :)
 
  • Like
Reactions: chandanmech2977

stiw47

Senior Member
Apr 27, 2011
167
39
0
Belgrade
Hey I'm trying to do exactly that! But I'm a little confused about what you mentioned - I am currently running MIUI 8 and wanted to flash a custom M ROM with the DualBoot Patcher, do I need to flash MIUI 6 before doing this? Or can I proceed to setting up the dualboot alongside MIUI 8? I also didn't understand what you meant about switching between the ROMs, do I need to flash a different version of MIUI to the MIUI partition every time I want to switch?

Sorry for so many questions, I was just confused about that and really wanted to do this, to get the best both MIUI and clean Android! :)
  1. You should download or transfer a custom rom .zip file (and gapps optional) on your phone
  2. Open Dual Boot Patcher app and patch all .zip files you want to install as a 'Data slot' (be creative and give some name to your data slot, it is mandatory).
  3. After this you will get new .zip files (e.g. Rom-Name-data-slot-name.zip and Gapps-data-slot-name.zip) and this is a whole magic. Those new .zip files have instructions to be installed inside /data/multiboot/data-slot-name folder inside your primary ROM, not inside /system as ussual.
  4. You will get a modded boot.img inside /sdcard/MultiBoot/data-slot-name also, and this boot.img have instructions to boot OS from /data/multiboot/data-slot-name , not from /system as ussual
  5. Before installation of secondary ROM, start DualBoot Patcher app, and set a kernel of MIUI as a primary:




  6. This is not nothing specialy, after this you will get a stock boot.img of MIUI8 inside a /sdcard/MultiBoot/primary, but you'll need it for further booting back to MIUI
  7. Boot into TWRP and install a secondary ROM and gapps, usually as a normal rom and thats it.

***Switching between ROMs***

From MIUI to Custom:

  • Boot into TWRP
  • Install V6.6.10.0.firmware.zip (this is not whole ROM, this is already known firmaware files, here from xda)
  • Install /sdcard/MultiBoot/data-slot-name/boot.img as => Image => Boot
  • Reboot System and whoala, you are in custom ROM.

From Custom ROM to MIUI:

  • Boot into TWRP
  • Install V8.0.2.0.firmware.zip (this is not whole ROM, this is same as V6.6.10.0.firmware.zip mentioned above, but with firmware files for MIUI 8, packed by me :) )
  • Install /sdcard/MultiBoot/primary/boot.img as => Image => Boot
  • Reboot System and whoala, you are in MIUI.


I hope, I was helpful :)