yashsingh1/xdaforums huggingface dataset:
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
The code is not complete yet on the ROM side, but very close ;). The way it works is that I've added the ability for other apps to launch the patcher using an Intent. That app gives the patcher two variables, the path to the zip file and the partition configuration (ie. "multislot1"). The patcher will start patching the file and will return to the original app when it's done. It will send three variables to the original app: 1. did the patching succeed, 2. the error message if it didn't, 3. the path to the new zip file if it did.

Here's a video demonstrating what I mean (I created a simple app to show how the patcher can be started):

[YOUTUBE]52fLCDfZm3c[/YOUTUBE]

So using this method, the delta updater will be able to start the patcher and flash the newly patched zip.

For those interested, here is some sample code for doing what is shown in the video:

package com.example.intenttest;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends Activity {
private static final String PATCH_FILE = "com.github.chenxiaolong.dualbootpatcher.PATCH_FILE";
private static final int REQUEST_PATCH_FILE = 1234;

private static final String ZIP_FILE = "/storage/emulated/0/Download/KT-SGS4-KK4.4-AOSP-INTL-12.21.2013.zip";
private static final String PART_CONFIG = "multislot1";

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Button b = (Button) findViewById(R.id.launch);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(PATCH_FILE);
i.addCategory(Intent.CATEGORY_DEFAULT);
i.putExtra("zipFile", ZIP_FILE);
i.putExtra("partConfig", PART_CONFIG);
startActivityForResult(i, REQUEST_PATCH_FILE);
}
});
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
if (requestCode == REQUEST_PATCH_FILE) {
boolean failed = data.getExtras().getBoolean("failed");
String message = data.getExtras().getString("message");
String newZipFile = data.getExtras().getString("newZipFile");
Toast.makeText(this, "Failed " + failed + "\n"
+ "Message: " + message + "\n"
+ "newZipFile: " + newZipFile,
Toast.LENGTH_SHORT).show();
}
}
}
}
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Version 4.0 beta 2 is now released :) Changes:

Fix patching in Windows

Really fix Paranoid Android Google Apps support

Add support for CyanFox

Add support for BlackBox

Add support for 3Minit framework

Add support for Xposed disabler

[MENTION=3641368]Brandroid28[/MENTION]

[MENTION=4564237]alvin551[/MENTION]

[MENTION=5289078]ShAdOw NiNjA[/MENTION]
[Galaxy S 4 i9505 Original Android Development] gravedigger76:
Sorry where do you keep beta downloads? On file host I see only 3.x..

Sent from my SGH-I337
[Galaxy S 4 i9505 Original Android Development] ShAdOw NiNjA:
How do you share the /data/app? Also will you be implementing these or will you not support the dual boot switcher option for data?
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Sorry, I forgot to attach it to the post. It should be there now.
[Galaxy S 4 i9505 Original Android Development] gravedigger76:
When trying to patch KTs latest ( KT-SGS4-KK4.4-AOSP-ATT-12.21.2013.zip) kernel for multislot 1 I'm getting this error with beta2

Any ideas?

Sent from my SGH-I337
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
You can try opening the ramdisks/init.multiboot.mounting.sh from the patcher and uncommenting the last four lines. I never tried this though, so I'm not sure if it will work.
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Thanks, that screenshot is very helpful. I'll have a beta 3 out in a few minutes that fixes this :)
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Version 4.0.0 beta 3 is now released :) Only one change for this one: fixes issue with patching loki'd ROMs and kernels.
[Galaxy S 4 i9505 Original Android Development] gravedigger76:
Beautiful. Worked like a champ. I was about to throw catalog your way to possibly help but u right on top of it :D

Thanks dude!

Sent from my SGH-I337
[Galaxy S 4 i9505 Original Android Development] Kifel Jatt:
Lol. He's from Saudi Arabia.
[Galaxy S 4 i9505 Original Android Development] Bejda:
So yeah it's ok on windows now,only these lines after detecting zip just in case it's "anormal" :)

[<multiboot.partitionconfig.PartitionConfig object at 0x019B9090>, <multiboot.pa

rtitionconfig.PartitionConfig object at 0x01F64D90>, <multiboot.partitionconfig.

PartitionConfig object at 0x01F64670>, <multiboot.partitionconfig.PartitionConfi

g object at 0x01F646D0>]
[Galaxy S 4 i9505 Original Android Development] chavdar:
I used beta2 and beta3 apk to patch Echoe Rom Kit Kat 2.1 but it does not work - the app says new file created just after 2 seconds and does nothing...

Is the problem known? Btw it works fine with 3.2.2

Sent from the GT-I9505 Galaxy
[Galaxy S 4 i9505 Original Android Development] Bejda:
Not enough place on sd's maybe? Still works fine with 3.2.2 when you test it right now?

Previously when not enough place the patching process kept going on 'til the end but ended with a "succes/error" message displayed, normally it's changed/fixed on latest patcher version but I didn't tested what it gives.
[Galaxy S 4 i9505 Original Android Development] chavdar:
Like I said -works fine with 3.2.2. Not free space issue

Sent from the GT-I9505 Galaxy
[Galaxy S 4 i9505 Original Android Development] Bejda:
deleted,tested on windows but bad download so probably not pertinent output lol
[Galaxy S 4 i9505 Original Android Development] omnifarious:
I had to use my windows box with the patcher to get it to work with GE roms. Virgin was fine but for "Dandroid" I had to rename the file from danvdh to Dandroid.
[Galaxy S 4 i9505 Original Android Development] Bejda:
Ah yeah,we already saw that story of some GE Rom's that can't be patched from android but fine on windows (or else..)

Here with then Echoe_KitKat_v2.1_18DEC013.zip it works fine on windows but I can confirm chavdar report on android:

https://www.dropbox.com/s/s9ss0puifvfpwkn/EchoeKKdualptchbeta3.txt

(related error at the end it seems?)
[Galaxy S 4 i9505 Original Android Development] noooooo:
There's no way to share /data folder, so we do not not loose data switching between roms right?
[Galaxy S 4 i9505 Original Android Development] Shanks:
Merry Christmas boss
[Galaxy S 4 i9505 Original Android Development] chavdar:
And of course - Merry Christmas to all and especially to Chen for creating such a nice toy to play with !

Sent from the GT-I9505 Galaxy
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Thanks for the log! I completely forgot the Android version uses Python 2 instead of 3. I'll need to make a few small changes.

EDIT: Should be fixed: https://github.com/chenxiaolong/DualBootPatcher/commit/81264dea18e39357d50e754b5871f32d6dfa9347

Beta 4 is attached to this post.

EDIT2: BROKEN DO NOT USE Android build is missing the python configparser module

EDIT3: Fixed :D https://github.com/chenxiaolong/DualBootPatcher/commit/7fe8d33dbd4da4bec8896537e0fccf586f11707a

Beta 5 is attached to this post
[Galaxy S 4 i9505 Original Android Development] gravedigger76:
Hi Chen,

Any chance we can get PA new BETA's supported for the multi_2 slot?

http://xdaforums.com/showthread.php?t=2314559

It looks like it's patches it, goes through all the way, but the .zip does not flash.

Recovery gives an error: "Error Executing updater binary in zip"

Thank you much!

EDIT: By the way, using v4.0 Beta 3 patcher on android)
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Merry Christmas to everyone!
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Which recovery are you using? That error is caused by flashing an Android 4.4 ROM using a recovery that doesn't support Android 4.4. It doesn't know how to run the META-INF/com/google/android/update-binary file from the ROM's zip, so it gives that error message.

I would recommend updating to the latest CWM, TWRP, or Philz recovery :)
[Galaxy S 4 i9505 Original Android Development] gravedigger76:
Latest TWR. Also having no issues running and flashing you're CM on multislot 1....

What else would cause that error? Tried to patch it twice with same results...

Sent from my Nexus 7
[Galaxy S 4 i9505 Original Android Development] bibymon:
Hi Chen,

How to wipe cache & dalvik cache of multislot1?? Also how to increase the available space for multislot1?? Will wiping secondary rom have any effect on the multislot1??
[Galaxy S 4 i9505 Original Android Development] respider:
hey guys, just tried patching manually a file and lost both systems :victory::laugh:

anyone could point me out what is wrong?

[COLOR="Red"]package_extract_file("dualboot.sh", "/tmp/dualboot.sh");
set_perm(0, 0, 0777, "/tmp/dualboot.sh");[/COLOR]

ui_print(" ");
set_progress(1.000000);

[COLOR="Red"]run_program("/tmp/dualboot.sh", "mount-system");[/COLOR]

package_extract_dir("system", "/system");

[COLOR="red"]run_program("/tmp/dualboot.sh", "set-multi-kernel");
run_program("/tmp/dualboot.sh", "unmount-system");[/COLOR]

ui_print(" ");
ui_print("Done!");
ui_print(" ");

I put the .sh file in zip's root and I just replaced mount and unmount lines with corresponding lines (red lines)

anything else I shouldve done?

edit: here is the original update script: (just removed ui prints)

set_progress(1.000000);
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
package_extract_dir("system", "/system");
unmount("/system");
[Galaxy S 4 i9505 Original Android Development] gravedigger76:
Hey, tried to patch above PA in win- with patcher beta 4, getting the following error, so i think it's not fully supported both on android and on win. Was wondering if you can have a look please. here is the error:

Detected ParanoidAndroid ROM zip

--- Please wait. This may take a while ---

Creating gzip compressed ramdisk with cpio ...Traceback (most recent call last):

File "C:\Android\DualBootPatcher-4.0.0beta1\\scripts\patchfile.py", line 90, i

n <module>

newfile = patcher.patch_zip(filename, file_info, partition_config)

File "C:\Android\DualBootPatcher-4.0.0beta1\scripts\multiboot\patcher.py", lin

e 269, in patch_zip

partition_config)

File "C:\Android\DualBootPatcher-4.0.0beta1\scripts\multiboot\patcher.py", lin

e 173, in patch_boot_image

data = cpio.create(extracted, ramdisk_files)

File "C:\Android\DualBootPatcher-4.0.0beta1\scripts\multiboot\cpio.py", line 4

5, in create

[OS.bash],

AttributeError: 'module' object has no attribute 'bash'

Press any key to continue . . .

Here is the META-INF folder

https://www.dropbox.com/s/t56uh5i31287wy0/PA_META-INF.zip

thanks dude!:good::good:
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Your output says C:\Android\DualBootPatcher-4.0.0beta1 :D Beta 5 from the previous page should work just fine.
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Dual Boot Utilities 2.0 is now released! It is now possible to switch to multi-slot ROMs and wipe them from recovery :)
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Hmm, maybe the recovery log can give some more details on what's going wrong. Could you try flashing the patched zip again and then immediately flash this afterwards (no reboot)? http://d-h.st/hPY That will give you a menu where you can save the recovery log to the internal storage.

In the meantime, I'll check the patcher again to see if it's doing something weird with PA.

Thanks!
[Galaxy S 4 i9505 Original Android Development] gravedigger76:
trying to pull the log, always at 0bytes though :(

By the way same error with beta5

---------- Post added at 10:37 PM ---------- Previous post was at 10:10 PM ----------

OK finally was able to grab non 0 log. Here it is sir. Hopefully this tells you something

https://www.dropbox.com/s/khgmzttu1dkaoue/recovery.log.zip

Sent from my SGH-I337
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Thanks, the log was helpful!

script aborted: This package is for "d2att" devices; this is a "jflteatt".
This package is for "d2att" devices; this is a "jflteatt".

It means you were trying to flash the Galaxy S3 version of the ROM. I think you meant to download "jflteatt" instead of "d2att" :D
[Galaxy S 4 i9505 Original Android Development] gravedigger76:
Serious?? How the heck... The name and file name says jflteatt... That's so weird... Thanks for looking dude.

EDIT: OK count one up to being blind,, arg totally my bad, clicking on a wrong file 3 times is just plain dumb hehehe sorry dude, my bad.

Sent from my Nexus 7
[Galaxy S 4 i9505 Original Android Development] nicholi2789:
Has anyone tried the DualBoot Utilities v2.0 zip that's up on the download site? I just saw it there and DL'ed it but since he hasn't posted about it yet I don't know if it's ready. Has anyone else tried it? I'm really really hoping that it has options to manage your multi-slot roms as I'm tired of doing it manually (though it's not really a big deal) anyone tried it yet?

And Chen, is it usable?
[Galaxy S 4 i9505 Original Android Development] gravedigger76:
Yep just tried to switch from primary to multi 2 in recovery, working great

did not need to wipe anything yet but switching working perfectly.
[Galaxy S 4 i9505 Original Android Development] nicholi2789:
Nice. I took a peek inside and it looked the same as the 1.0.1 version so I figured it was okay. Thanks for letting me know.
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
I made a small one-liner post on the previous page :) Nothing new other than multi-slot ROM support. Supports switching ROMs, and wiping system, cache, data, and dalvik-cache.
[Galaxy S 4 i9505 Original Android Development] tvhak:
hi there,

i want :http://xdaforums.com/showthread.php?t=2555569 as primary rom

and : http://xdaforums.com/showthread.php?t=2372286 as secondary rom

if i use patcher to patch the sec.rom it wont work.

and if i do it manually and use the rom zip it says unsupported kernel zip

is this because this is not supported? if so can you make it supported??

edit:

i switched them and then patch works. but if i want to boot in second rom it hangs on samsung screen any idea??

edit:

tried to pach it all again but now all fails.

waiting for help....

thanks for the help. and thanks for the work so we can dualboot
[Galaxy S 4 i9505 Original Android Development] visanciprian:
Hey!

Just tried to patch ChronicKernel AOSP 4.4 with the new beta5 and when using patch-ramdisk.sh I get the following message:

./patch-ramdisk.sh boot.img

Patch ramdisk in: boot.img

Which type of ramdisk do you have?

1: hammerhead/AOSP/AOSP

2: hammerhead/AOSP/cxl

3: jflte/AOSP/AOSP

4: jflte/AOSP/cxl

5: jflte/GoogleEdition/GoogleEdition

6: jflte/TouchWiz/TouchWiz

Choice: 3

Replacing ramdisk with jflte/AOSP/AOSP.def

Unpacking boot image ...Traceback (most recent call last):

File "/home/ciprian/phone/dualboot/DualBootPatcher/useful/../scripts/patchramdisk.py", line 102, in <module>

partition_config)

File "/home/ciprian/phone/dualboot/DualBootPatcher/scripts/multiboot/patcher.py", line 76, in patch_boot_image

selinux = config.get_selinux()

File "/home/ciprian/phone/dualboot/DualBootPatcher/scripts/multiboot/config.py", line 47, in get_selinux

if has(get_device(), 'selinux'):

File "/home/ciprian/phone/dualboot/DualBootPatcher/scripts/multiboot/config.py", line 32, in get_device

return get('Defaults', 'device')

File "/home/ciprian/phone/dualboot/DualBootPatcher/scripts/multiboot/config.py", line 21, in get

return config[section][option]

File "/usr/lib/python3.3/configparser.py", line 954, in __getitem__

raise KeyError(key)

KeyError: 'Defaults'

Using linux, and have set the bootimg tools binaries with +x permissions.

With beta 3 I could patched Chronic's boot.img with no problem :)

And with beta 5 I could patched KT's 4.4 AOSP kernel, also with no error.. (directly with patch-file)...

So any ideea what's with this error?

Edit: I get errors with all the boot.imgs when using patch-ramdisk.sh but no error when using patch-file.sh -> assuming the bug's in patchramdisk.py

Edit2: think I found the problem :) check line 77 in multiboot/patcher.py

in beta3:

75: if not file_info.selinux:

76: bootimageinfo.cmdline += ' androidboot.selinux=permissive'

in beta5:

76: selinux = config.get_selinux()

77: if selinux is not None:

78: bootimageinfo.cmdline += ' androidboot.selinux=' + selinux

Cheers!:cowboy:
[Galaxy S 4 i9505 Original Android Development] freak.hh:
Hello,

Could you Pls tell a newbie in dualboot where is the difference between secondary Rom and multislot?

Gesendet von meinem GT-I9505 mit Tapatalk
[Galaxy S 4 i9505 Original Android Development] monkteo:
Hi and sorry but at some point i lose the line ,

some body tel me there is a (DualBootPatcherAndroid-4.0.0beta3) or some thing like that but I don't find it ?

I find only 3.2.2 ? help ?

PS , OK found it .
[Galaxy S 4 i9505 Original Android Development] respider:
I'm sorry to bump this but I would like to try again and I dont know what I did wrong :p

any ideas guys?
[Galaxy S 4 i9505 Original Android Development] `SBR`:
Which rom your flashing...try with android apk to convert it...the detials given are very short...and there is no boot.img extraction in the script and how are you formatting the system...
[Galaxy S 4 i9505 Original Android Development] ShAdOw NiNjA:
The difference is in how it is named. The secondary ROM is in /system/dual. Any of the multi-slot ROM will be named as /system/multislot1. Or some name to that effect.
[Galaxy S 4 i9505 Original Android Development] rlorange:
Also dual slot resides in /system/dual but multi slot 1,2 etc is actually in /cache and simlinked to /system/multislot1
[Galaxy S 4 i9505 Original Android Development] ShAdOw NiNjA:
I forgot about the multislots being in the cache
[Galaxy S 4 i9505 Original Android Development] gravedigger76:
Hi,

Any chance we can get new 4.4.2 Slim's added to the patcher please?

Here is the META-INF folder:

https://www.dropbox.com/s/kffxusf87abyw1i/META-INF_Slims.zip

Here is the ROM URL:

http://xdaforums.com/showthread.php?t=2561125

Thank you much!
[Galaxy S 4 i9505 Original Android Development] freak.hh:
Which benefits areise from being in the cache instead of being in the system?

Gesendet von meinem GT-I9505 mit Tapatalk

---------- Post added at 08:09 AM ---------- Previous post was at 08:06 AM ----------

I patched slim 4.4.2 normal way with latest Patcher app and everything is running smoothly

Gesendet von meinem GT-I9505 mit Tapatalk
[Galaxy S 4 i9505 Original Android Development] gravedigger76:
To secondary or multi?

I'm trying to multi 2 and its weird... I think its patched when I boot onto it can't see primary secondary and multi 1. Reboot takes me back to primary and I can't see multi 2 with slims anymore...

Sent from my Nexus 7
[Galaxy S 4 i9505 Original Android Development] freak.hh:
Patched it as secondary and had no problems.

As you can see I asked some posts above what the difference is.

Not tried multislots yet

Gesendet von meinem GT-I9505 mit Tapatalk
[Galaxy S 4 i9505 Original Android Development] freak.hh:
Is there a way to swap primary and secondary Rom? Or is it possible to stay on the secondary and delete the primary Rom?

Gesendet von meinem GT-I9505 mit Tapatalk
[Galaxy S 4 i9505 Original Android Development] visanciprian:
Use DualBootUtilities.zip

You can do both of the things you mentioned :)
[Galaxy S 4 i9505 Original Android Development] freak.hh:
Tried it yesterday with the option in the switcher app.... Set current kernel as..... And ended with using my backup ;)

Thanks. Will try it next time with utilities zip

Gesendet von meinem GT-I9505 mit Tapatalk
[Galaxy S 4 i9505 Original Android Development] respider:
what details? that's the whole update-script

it's just a simple .zip I would like to install to 2nd rom slot, not a full rom

android patcher says unsupported zip
[Galaxy S 4 i9505 Original Android Development] Bejda:
I can't say what went wrong with the way you edited your zip, where it fails or whatever but you could rename such zip's like this:

4.4_qc-optimized_bionic.zip

And patch it, should be fine.
[Galaxy S 4 i9505 Original Android Development] `SBR`:
try removing the line, as its not needed if you're flashing files..and also verify you have the correct dualboot.sh

run_program("/tmp/dualboot.sh", "set-multi-kernel");

or use the below script with duaboot.sh available inn your rom

package_extract_file("dualboot.sh", "/tmp/dualboot.sh");
set_perm(0, 0, 0777, "/tmp/dualboot.sh");
run_program("/tmp/dualboot.sh", "mount-system", "ext4", "/dev/block/platform/msm_sdcc.1/by-name/system");
ui_print("*");
ui_print("*");
ui_print("[*] EXTRACTING ZIP FILE...");
ui_print("*");
ui_print("*");
package_extract_dir("system", "/system");
run_program("/tmp/dualboot.sh", "unmount-system");
[Galaxy S 4 i9505 Original Android Development] ShAdOw NiNjA:
Once you've made the secondary ROM the primary kernel and wiped the primary /system, you still have to patch anything you want on that ROM correct? Or can you flash it like normal?
[Galaxy S 4 i9505 Original Android Development] ibleedbinari:
Could support for this rom be added?

http://xdaforums.com/showthread.php?t=2461469

This is the only Touchwiz ROM for the Google Edition I could find. If there is another already supported Google Edition Touchwiz ROM, please let me know.

Sent from my Galaxy S4 Google Edition
[Galaxy S 4 i9505 Original Android Development] gravedigger76:
I just tried with today's weekly of slims to patch it to multi1 same thing. Zip patched sucesfully. I flash it in recovery just fine. It boots just fine. When I install switcher app it thinks its the only ROM installed. Doesn't see my primary or secondary.

Any ideas guys?

Sent from my SGH-I337
[Galaxy S 4 i9505 Original Android Development] Bejda:
SlimKat is my multislot1 rom since..since SlimKat actually lol and I don't have issues but I guess I live sometimes similar story,only with Slim and most probably after a fresh/wipe data installation.

From memory and in bulk try this:

Go into settings>developers options and tick again root access for apps and adb AND/OR reinstall switcher apk AND/OR go under settings>advanced options>superuser to..do some stuffs lol (maybe delete switcher apk root access log for it gets granted again when you'll open DualBootSwitcher.apk again [once reinstalled maybe..] )

Well,as you can guess something related to root access imo but I can't remember the exacts and really required steps.

Let's try this all and see ;)
[Galaxy S 4 i9505 Original Android Development] angeloumbao:
Thanks! So the ones that works and doesn't are the roms that is listed in the OP? How about if my primary is supported? can i use rom that is not in the op? or vice versa? TIA. :)
[Galaxy S 4 i9505 Original Android Development] munchy_cool:
so I am using a tmo s4. downloaded aokp from here http://xdaforums.com/showthread.php?t=2335006

on a mac

gave the below command and am getting

unsupported zip

same error for gapps downloaded from same rom page

./patch-file.sh /Users/munchy/Desktop/dualboot/patcher/aokp43.zip

does OP need to add support for this rom?

Edit

Same error on Windows :(
[Galaxy S 4 i9505 Original Android Development] sardelisp:
anyone know if adam latest kernel 1.6 support this patch for dual boot? anyone who has tried it?
[Galaxy S 4 i9505 Original Android Development] dgcyears:
No root method

Hello! Can't this be done without roothing? I had root many times but it just slows down my device...Thanks!
[Galaxy S 4 i9505 Original Android Development] bulgareli:
No. The dualboot app requires root access in order to set the kernel for primary or secondary ROMs.

The root itself doesn't slow down the device, maybe it was some app you've installed that cause that behavior.

Enviado de meu Nexus 4 usando Tapatalk 4