How To Dual-Boot TouchWiz & Any AOSP ROM On Samsung Galaxy S4

Advertisement

The Samsung Galaxy S4 and the HTC One have a lot in common. Both these devices represent the very best in terms of both hardware and software that the Android smartphone industry has to offer, and are the pride of their manufacturers. Also, both these devices come in two variants: the standard version running the respective manufacturer’s tweaked OS (Samsung’s Touchwiz and HTC Sense), and the Google Play editions that run stock Android the way it’s built by Google and shipped on Nexus devices. Though what if a user wants to experience both variants of the OS on the same device? We recently took a look at dual-booting HTC Sense and Google Play Edition stock Android on HTC One using MoDaCo.SWITCH, which was later made available for Samsung Galaxy S4 as well. Grarak’s Rom Switcher is a similar tool that let’s you dual-boot TouchWiz and any AOSP-based ROM on the S4.

Samsung-Galaxy-S4-dual-boot-Garak's-ROM-Switcher

Brought to us by XDA-Developers Senior Member Grarak, this nifty tweak lets you dual-boot not just the Google Play edition ROM, but any AOSP-based ROM on your Galaxy S4 that’s already on the stock Samsung TouchWiz ROM. The AOSP ROM basically runs from the cache partition, and the location for the cache partition of the TouchWiz ROM has been changed to accommodate it. Do note that the ROM is currently in alpha state, though it’s working fine as a daily driver according to the developer and the users who have tried it so far.

So, without any further ado, let’s get the whole thing up and running on your Galaxy S4.

Disclaimer: Please follow this guide at your own risk. AddictiveTips will not be liable if your device gets damaged or bricked during the process.

Requirements

  • International Samsung Galaxy S4 I9500 running the latest stock TouchWiz ROM. Do NOT attempt to use this method with any other variant of the S4, or any other phone.
  • Root access and a custom recovery such as TWRP or ClockworkMod installed on the phone
  • Any AOSP-based custom ROM compatible with your device
  • The latest Gapps package (To install Google apps on the AOSP ROM)
  • An archiving utility such as the excellent and free 7-zip
  • A decent text editor like Notepad++ (Windows’ built-in Notepad might give line formatting issues)
  • Grarak’s Rom Switcher app (Install when instructed in the procedure)

Procedure

  1. Open the AOSP ROM that you downloaded in 7-zip (or an archiving utility of your choice).
  2. Go to META-INF/com/google/android/ and drag out the updater-script file to your desktop or any Windows Explorer window.
  3. Open the updater-script file in Notepad++ (or the editor of your choice).
  4. Find this line:
    mount("ext4", "EMMC", "/dev/block/mmcblk0p20", "/system");

    and replace it with this:

    mount("ext4", "EMMC", "/dev/block/mmcblk0p19", "/system");
  5. Now find these two lines (that may or may not be together) and delete them:
    format("ext4", "EMMC", "/dev/block/mmcblk0p20", "0", "/system");

    and

    package_extract_file("boot.img", "/dev/block/mmcblk0p9");
  6. Save the updater-script file and drag it back onto 7-zip with the ROM still open in it in the same location where you dragged the file out from. Confirm when asked if you want to replace the file.
  7. Similarly open the zip file of the gapps package in 7-zip and drag out the same updater-script file from the same location in it to your desktop or any Windows Explorer window, opening it in Notepad++ the same way.
  8. Find this line:
    run_program("/sbin/busybox", "mount", "/system");

    and replace it with this:

    mount("ext4", "EMMC", "/dev/block/mmcblk0p19", "/system");
  9. Save this updater-script file the same way as well, and drag it back into 7-zip with the gapps zip file still open in it at the same location, confirming when prompted to replace the file.
  10. Transfer both the ROM as well as the gapps package to your phone’s internal storage.
  11. Reboot your S4 into recovery.
  12. Flash the ROM followed by the gapps package, and make sure NOT to wipe anything.
  13. Reboot your phone. You should be back into your stock TouchWiz ROM.
  14. Now install Grarak’s Rom Switcher app from its APK file and open the app once installed.
  15. The app will then set everything else up for you; just follow any steps it shows you.

You should now be able to use the Rom Switcher app for rebooting your phone into the AOSP ROM. While this is all you need for this dual-boot mod to work, there are a few things you need to keep in mind. Since the default partitioning structure has been altered in order to make dual-booting possible, you’ll need to wipe partitions and reinstall the AOSP ROM if you need, accordingly. You can find instructions by the developer for these in the second post at the forum thread linked at the end of this post.

For bug reports, help with issues, feature requests and staying up-to-date with further developments, visit the XDA-Developers forum thread linked below.

[via XDA-Developers]

Advertisement
  • Yash Ostwal

    Everything worked perfectly well for me till the ROM switcher app installation. After opening the app, it asked me to download extra file (a download.zip). After downloading, when I open the app, the app hangs. I dont see any option to select / boot to other ROM.