I've a OnePlus One with unlocked bootloader, modified TWRP v2.8.6, unofficial MultiROM v32k, MultiROM Manager v1.186, Cyanogen OS 12 as primary and several Android 5.1 secondary ROMs. I don't have any non-Android secondary ROM.
I created a Android backup script in my PC which requires me to boot into a particular ROM of mine for backup to take place. This is not an XY problem and hence I need not to discuss anything about the flexibility of backup. I must boot into a particular secondary ROM (say S1).
At present, I'm using automation, Tasker precisely, which using time trigger launches MultiROM and uses combination of input tap
commands to navigate to S1's entry and taps it to boot into it. As you may have guessed, this approach is mundane and is bound to fail should the user deliberately or inadvertently touches any soft/hard button or interacts with UI of the active app during which the series of input commands are in use.
I'm absolutely aware about AutoInput, Xposed Additions Pro apps and screen pinning of an app, where the former two allows independently disabling soft/hard keys for an active app. AutoInput can even simulate recorded touches. However, none of them can disable input from touchscreen, with touch input being the biggest cause of failure with current solution.
Being unable to find out a way to block touch input on-the-fly, I decided to figure how MultiROM Manager app causes a device to boot into a particular ROM. It was a hopeless journey to begin with, given that the keywords viz. command, multirom, adb, boot, secondary, primary ROM, are found wherever MultiROM is mentioned. Since even advanced web search didn't benefit me, I decided to peek into the output of logcat and see whether it gives me something useful. Once again, nothing of any good use.
I found myself left with the choice to contact Vojtech Bocek (Tassadar, the original developer of MultiROM) for the solution or peek into the source code of the app. Deciding to go with the latter choice, during my exploration I stumbled upon these lines in MultiROM.java
public void bootRom(Rom rom) {
String name = (rom.type == Rom.ROM_PRIMARY) ? INTERNAL_ROM : rom.name;
Shell.SU.run("%smultirom --boot-rom='%s'", m_path, name);
}
Being through with libsuperuser already, I took an educated guess that Shell.SU.run("%s/multirom --boot-rom='%s'", m_path, name)
most likely corresponds to the command run in a shell with superuser privilege.
And, this is the end of the story since I've checked all the locations under $PATH and none of them contains the binary named multirom
.
So, how do I boot into a particular ROM now?