yashsingh1/xdaforums huggingface dataset:
[Galaxy S 4 i9505 Original Android Development] gaww:
Except I have two TW ROMs - on use TMO 4.4.4 (with wifi-calling) and one 5.0.2 international. I patched and flashed with older patcher, but sure hope this will be possible when app sharing is fully up.
[Galaxy S 4 i9505 Original Android Development] noobiedev83:
How?
[Galaxy S 4 i9505 Original Android Development] gaww:
Wipe primary with utility, then patch new primary and flash and select primacy as the location to install it. This should not affect Multi slot at all.

Note - if you flash a ROM as-is as primary, if the install script wipes cache - you wipe out all the multi slot ROMs (the data would remain). If it wipes system, you secondary ROM - if any - is also gone.

---------- Post added at 05:03 PM ---------- Previous post was at 04:57 PM ----------

I used patcher 1051. The 4.4.4 is primary with 600mb still free is system. The 5.0.2 TW is a multislot - with only 150mb left in cache. Note that I am on a 919-9505, so there is lots on room (2.13 gb) in the cache for an

unbloated

TW.

It is the lack of app sharing between the TW's that is killing me sizewise - lol
[Galaxy S 4 i9505 Original Android Development] noobiedev83:
Thanks
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
I'm working on debugging that right now (I just ran into this yesterday trying to dual boot a Lollipop TouchWiz ROM on my Note 4).
[Galaxy S 4 i9505 Original Android Development] noobiedev83:
Thank you man for a awesome work!!
[Galaxy S 4 i9505 Original Android Development] gaww:
You are a trooper!

I guess the Note 4 has made all this even more complicated - but that's your baby now - just don't leave it in the freezer too long ...
[Galaxy S 4 i9505 Original Android Development] noobiedev83:
Lol you bully!!
[Galaxy S 4 i9505 Original Android Development] Technical:
Ranomez, did you achieve sharing app/data via Link2SD installed in both ROMs?

How? I've tested Slim and CM 12.1 and not a single app got shared.
[Galaxy S 4 i9505 Original Android Development] Ranomez:
I didn't test it for that purpose but I did test on my old phone and if I link apps to the SD card then flash a different ROM on the device (which means doing a full wipe first) and then link the 2nd partition in link2sd I get all the apps that were linked back on my device without having to re-install them, I am not sure if it does work for the dual-boot sharing but I think it should as on my Touch Pro 2 even if switching to different android versions (android 2.2/2.3/4.0) or bases (sense/miui/aosp/cm) the apps get automatically re-detected, I can't test on my note 4 as my 64GB SD card is full and can't free up any space and also my 2nd ROM (AOSP-based) can not see the SD card at all.
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Haha, I've reflashed this thing nearly 100 times over the last 48 hours debugging app sharing and random TouchWiz bugs... Gotta love my Ziploc bag and freezer, especially in this 80° weather :laugh:
[Galaxy S 4 i9505 Original Android Development] carandcar:
Your persistence is incredible and appreciated! Thank you.
[Galaxy S 4 i9505 Original Android Development] rlorange:
I concur!!!
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Thank you!! You guys are the best :D
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
The greatly anticipated app sharing build is here! Starting from snapshot 8.0.0.r1257.gc87ee47, you can share both the apk and data for any app (or just data for system apps).

The individual app sharing works by storing the app's apk and data in a shared location at /data/multiboot/_appsharing. When you enable sharing for an app, Android will load the app and data from that location. Of course, enabling it for one ROM isn't useful at all. Once you have it enabled in two or more ROMs, they will all use the same apk and data. ie. your Chrome tabs (or whatever else) will be synced across all your ROMs :D

When data sharing is enabled, the shared data can be though of as "overlaid" on top of the original app data. That means, if app sharing is disabled, the app will go back to using whatever data it had for that ROM. If shared data is enabled for an app and you uninstall that app, the data simply becomes unshared so the data won't be deleted.

I've tested this a whole bunch over the past few days, but like all software, there will be bugs. Be sure to backup your apps with Titanium Backup before enabling app sharing!

Enjoy!

(Just a side note: The mingw-w64 cross compiler on my server just got updated to version 5.1, which is currently incompatible with the boost library, so no Windows builds for now. They should hopefully be back soon.)

EDIT: Going to sleep now... Let's hope I wake up to happy faces and not bug reports :D :laugh:

EDIT2: This also fixes various bootloops that happen on the Nexus 7 and Note 4.
[Galaxy S 4 i9505 Original Android Development] noobiedev83:
patched a tw kikat rom but when i finished to flashed to try to boot from it is stay in the samsung bootloader screen and keeps rebooting in a bootloop, any ideas? thanks for the update!
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Could you link me to which ROM you're using? I'll give it a try on my Note 4. So far, I've only tested Lollipop-based TW ROMs.
[Galaxy S 4 i9505 Original Android Development] noobiedev83:
http://xdaforums.com/note-4-tmobile/development/firekatn4v1-4-4-4-tw-anj7-extremely-t2916463
[Galaxy S 4 i9505 Original Android Development] nds850:
Fantastic work! Can't wait to try it out :o
[Galaxy S 4 i9505 Original Android Development] TheDarkKnight:
Just one thing: YOU, sir, are the greatest dev I've known!!! :D
[Galaxy S 4 i9505 Original Android Development] todivefor:
I am trying app sharing for the first time. Might be user error because I am a noob at app sharing. I am running sph-l720 with primary (sacs-v4 KK), dual AntareOnes optimized cm12.1, and slot-1 official cm12.1 jfltespr. Primary has never been patched because it is unsupported. I updated ramdisk on all 3. I have an app (convertr) on dual I setup for sharing (apk and data) and rebooted. I booted into slot-1 and turned on app sharing (individual) and rebooted hoping to see my convertr app. It was not there. I went back to dual. Convertr nolonger showed up in app sharing and was not in app drawer. I restored convertr app to primary. Set it up to share, and rebooted. Booted into my dual and slot-1, not visible in app sharing on either. Set app sharing off in all 3 and rebooted each. Looked in /data/multiboot/_appsharing/app/ and found com-vervv.convertr/base.apk. In /data/app, I have com.vervv.convertr-1.apk

My primary is pretty much barebones. My main rom is dual with all apps. Can I only share between primary and my secondaries, or can I share between dual and slot-1 without sharing with primary? Does app have to be on the roms I want to share prior to sharing (ie does convertr have to be on dual and slot-1 prior to sharing)? Or if convertr is on dual will sharing it make it selectable for sharing on slot-1?

Hope this makes sense. Have never shared with DB.

EDIT: Didn't repatch dual or slot-1.
[Galaxy S 4 i9505 Original Android Development] gaww:
Great work once again. I have a few questions on app sharing:

1. I assume the ROMs have to be repatched for app sharing (not really a question).

2. Will this patcher version recognize S6 device names in buildprop (looking at using S6 port and it needs the S6 build prop manes to work correctly)?

3. From a post a few back - will this work on 4.x.x TW as well as LL TW - especially with respect to app sharing ?

4. As a starter, If it reflash patched ROMs, and before I enable app sharing, I first delete all the apps in a MUltiROM that I want to app share and then enable app sharing - will they all come back up on the multiROM?

5. To finally recapture usable space on my internal SD, would wiping data on the multiROM and then patching reflashing the RORs and setting up app sharing result in the most free space?

PS - if you do forget and leave you Note 4 in the freezer (like after working until 6 in the AM), do not take it out of the ziplock until it is fully warmed back up - lol.
[Galaxy S 4 i9505 Original Android Development] Quote100:
As of now I am afraid to try this because when I updated my ramdisk before and rebooted it made my kernel crash and it hung on the kernel panic screen with blinking LEDs so is it safe to update the ramdisk on a g3?

Edit: never mind it failed to update the ramdisk but didn't give me a reason [MENTION=4277844]chenxiaolong[/MENTION]
[Galaxy S 4 i9505 Original Android Development] sronweb:
I did the same with few apps just for testing but as soon I share them the apps it not available on the rom.

In my case I have a Touchwiz rom as primary and CM12.1 as multi-slot1. Perhaps they are not compatible for sharing currently? With the previous patcher I was using individual app sharing (only apk, no data of course) but it was possible to share the apps even between touchwiz based rom and AOSP for my experience.

Perhaps I forget some steps? Any other experience is appreciated.

[MENTION=4277844]chenxiaolong[/MENTION]

please, you deserve another donation for you great support:

paypal no.87B09586XE001760S
[Galaxy S 4 i9505 Original Android Development] pbarakhsan:
note 4 issue

chen

ive been having problems with my note 4

i install the second rom, set my primary kernel, and reboot to second rom. all good so far.

the problem arises when i try to go back to my primary rom.

for some reason i can not go back no matter what i do. ive tried all i know but still cant go back.

ive even flashed the primary boot image in twrp but still it boots up to the secondary rom

any thoughts on this issue?

thank you master chen
[Galaxy S 4 i9505 Original Android Development] haoyangw:
[MENTION=4277844]chenxiaolong[/MENTION]

Unfortunately with the latest snapshot 8.0.0.r1257.gc87ee47, patching the ramdisk results in a bootloop that is stuck on the bootanimation(it is no longer repeatedly random rebooting at the Galaxy S4 logo screen). I'm running 0412 CM11 nightly with Alucard Kernel 1.4qs on my Galaxy S4 I9505. Below is a dmesg log I captured after the bootloop. Hope this gets fixed, and thanks a lot! Can't wait to try out app sharing! :)
[Galaxy S 4 i9505 Original Android Development] sronweb:
Maybe I misunderstand something. In example Iet's assume I uninstall one application from multi-slot1 rom and then I decide to share this application from the primary to the other roms I go into individual app sharing function from primary and then I select apk + data because I suppose that in this way I should find the same app and data also on the second or multislot roms where I have updated ramdisk. Do I have to keep it the application instead of uninstalling it? For my understanding sharing apps should avoid to have it installed in order to save space....
[Galaxy S 4 i9505 Original Android Development] Technical:
You can use DualBootUtilities-4.0-snapshot4.zip to flash into recovery and in the Aroma installer, choose to return to primary ROM.
[Galaxy S 4 i9505 Original Android Development] gaww:
Sounds like he set his secondary kernel as primary - so this may not work.

The simple fix would then be to flash a patched kernel as primary. Then not to forget setting it as primary after boot-up.
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Ahh yes, I should probably note that somewhere. You do in fact have to have the app installed in dual and slot-1 prior to sharing. This is one limitation that would be pretty difficult to fix. When an app is installed on Android, it gets assigned a unique UID and all of the app's data files must be owned by that UID (or Android will delete them). If you boot into a ROM where convertr hasn't been installed yet, the UID is unknown, so the app sharing code won't know how to change the permissions. If you enable individual app sharing and share apk/data for convertr in both ROMs, things should start working properly.

There is no dependency on the primary ROM (or any other ROM), since it just tells the system to load the app and data from /data/multiboot/_appsharing/, as you found out.
[Galaxy S 4 i9505 Original Android Development] Technical:
What did I do:

1. Install the latest dual boot apk and update Ramdisk on primary (Slim 5.1.1).

2. Reboot.

3. Share 2 app: Amazon Store and a non-important app of mine.

4. Change to secondary ROM (CM 12.1 nightly).

5. Reboot into secondary.

6. Install the latest dual boot apk and update Ramdisk.

7. Reboot into secondary (very slow boot).

8. Choose to share all apps.

9. For my surprise all app got shared... and not only the two ones I've selected in n.3 above.

10. But the data seems not shared. At least some apps didn't come with the primary ROM settings.

What does the primary share app option really does?
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Yep. If the ramdisk update feature works for you, then that'll be good enough too.

It'll recognize your device as the S6 and won't look up the correct partitions for the S4. Starting from 8.0.0.r1259.ge9e86eb, you can override the device value by adding to build.prop:

ro.patcher.device=jfltetmo

The app will then correctly use "jfltetmo" to determine the partitions.

There shouldn't be anything specific to Lollipop in the code, but app sharing on TW 4.4 is something I haven't tested yet.

No they will not. You'll have to install the apps again before they will be shared. This is a limitation I had to add to get data sharing working. When you install an app, Android assigns it a unique UID and the app's data has to be owned by that UID or else it will be wiped. If the app isn't installed, the app sharing code won't know the UID, so there's a very high chance the shared data would be deleted.

In the future, I might add a screen that pops up on the first boot that asks if the shared apps should be reinstalled. If yes, then it will go through the standard apk sideload process to reinstall the apps.

You don't need to do that :) The app sharing code will automatically link the apks in /data/app/ (for shared apps) to /data/multiboot/_appsharing/. The only thing to watch out for is apps with a lot of data. App sharing does not delete the original app data, so if you unshare an app, it's as if nothing had been changed. If you don't care about the original data, just clear it in Settings before enabling sharing.

Haha, duly noted :D
[Galaxy S 4 i9505 Original Android Development] gaww:
From the above, won't the app that is now being shared in the Multi or secondary still exist in its data folder, so app sharing will not save any space - unless they can manually be deleted after being shared?

If this is the case, can apps still be shared without sharing data if they are not in the MultiROM before app sharing? I was formerly able to simply flash a new patched ROM with no data, setup app sharing, reboot - and there the apps were.

I think you post above answers this no.

I am missing something here - how does this app sharing save space on the internal?
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Any way you could get me a logcat when you update the ramdisk? You could either do it manually using adb or using an app, like Catlog. Thanks!
[Galaxy S 4 i9505 Original Android Development] mgbotoe:
For clarrification purposes, we do not need to do anything with the gapps correct? just flash it in recovery when flashing second rom?
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Any zip file that you want to install for the second ROM needs to be patched. :good:

Currently, the gapps at http://get.cm/gapps is supported and works with most AOSP-based ROMs. (AOKP gapps is supported too)

EDIT: Oops, I meant http://goo.im/gapps
[Galaxy S 4 i9505 Original Android Development] mgbotoe:
Oh i see, the link doesn't work btw i get this.....You are doing great here! I'm surprise it did not show up on the front page

Traceback (most recent call last):

File "/usr/local/lib/python2.7/dist-packages/tornado-2.4-py2.7.egg/tornado/web.py", line 1037, in _execute

self.prepare()

File "/usr/local/lib/python2.7/dist-packages/tornado-2.4-py2.7.egg/tornado/web.py", line 1487, in prepare

raise HTTPError(self._status_code)

HTTPError: HTTP 404: Not Found
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Oops, I meant http://goo.im/gapps

Thanks for the compliments!
[Galaxy S 4 i9505 Original Android Development] mgbotoe:
By the way, out of curiousity I decided to use the patch script use to patch the roms....I used it on the gapps instead. Im not sure if this is accidental discovery, or if the dualbootpatcher can patch any zips for the second rom.

I went on to compare the updater scripts and i got this, I compared it to the instruction for manual patching and everything is the same! So i am thinking the patchscript can patch anything without us doing it manually? Just wanted to share, im grabbing the gapps from the link...just to be on the safe side loool. But let me know!

ui_print("...4.3 Gapps for AOKP...");
ui_print("Installing for SECONDARY OS/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");

run_program("/sbin/busybox", "umount", "/data");
run_program("/tmp/dualboot.sh", "mount-data", "ext4", "/dev/block/platform/msm_sdcc.1/by-name/userdata");

show_progress(1, 15);
delete("/system/app/Provision.apk", "/system/app/CalendarGoogle.apk", "/system/app/Phonesky.apk", "/system/app/GoogleBookmarksSyncAdapter.apk");
delete("/lib/libgoogle_recognizer_jni.so");
ui_print("Copying Files...");
package_extract_dir("data", "/data");
package_extract_dir("system", "/system");
ui_print("Unmounting system...");
run_program("/tmp/dualboot.sh", "unmount-data");
run_program("/tmp/dualboot.sh", "unmount-system");
ui_print("Installation complete!");
[Galaxy S 4 i9505 Original Android Development] bibymon:
I have patched latest cm10.2 nightly & flashed.. Everything went fine.. Using tw as primary rom with Latest phils recovery..

Thanks a lot..

Between is there a way to get the apps shared between two roms..? I mean those installed in primary rom is not shown in secondary..
[Galaxy S 4 i9505 Original Android Development] mgbotoe:
Review

So i have been crazy about dual boots for a while and I can SAFELY say, I just found one! BTW, I flashed the gapp files created by the dualbootpatcher...

I successfully booted between both roms with no issue. My second rom was task AOKP rom. No force close. Instruction is easy to follow (but being me, I like to clarify If i get mix message from something).

Thx!
[Galaxy S 4 i9505 Original Android Development] kendragon:
Great, Installed this as second rom

http://xdaforums.com/showthread.php?t=2422582 and works! only camera in second rom doesn't works, I don't know why
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Not quite automatic yet; I don't want the program to miss something and suddenly /system is wiped :D In case you're interested, the program applies this patch for the gapps I mentioned: https://github.com/chenxiaolong/DualBootPatcher/blob/master/patches/cyanogenmod-gapps.dualboot.patch
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Awesome, glad you got it working!

It is very easy to enable app sharing (no data) between the two ROMs. However, I need to test how the second ROM would react to incompatible apps (like what would happen in AOSP saw TW apps).
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Glad you got it working :D

If something is unclear, feel free to ask. I know I'm not the best at explaining things ;)
[Galaxy S 4 i9505 Original Android Development] csec:
Great. Was waiting for something like this. :)

Nice work, mate. :thumbup:

Will try it soon.
[Galaxy S 4 i9505 Original Android Development] mgbotoe:
Wow if you can do that, it will be awesome! My only request for that would be MMS lol, already had two incidents were i forgot i texted the person on the other rom and they responded while i was in the other lmaoooo was like "what are you talking about" moment haha.
[Galaxy S 4 i9505 Original Android Development] RK:
Hey I don't want to bother you for each different GE ROM. How do I modify the patcher to accept a GE ROM other than the untouched one you added support for? I'll make sure the ROM I want to try has a stock GE kernel so that It can use your ramdisk.
[Galaxy S 4 i9505 Original Android Development] bulgareli:
Great work! Will try it in a few days.

One question: I will install PAC Man ROM as secondary ROM, do I need to Wipe System before installation? Using the WipeSystemSecondary.zip?

Thanks!
[Galaxy S 4 i9505 Original Android Development] blood_talon:
Here is what I am looking for on my i9505: Primary rom XTREMEPERIA_S4_V5 with Infamous kernel 2.0, secondary rom: Evil_UnWizzed_v2 with default kernel from its Aroma installation (I think it is Ktoonz kernel).

So I understand properly, I need to patch all kernels and ROMs?

Thanks!
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
MIUI is now supported in version 1.5 :)
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
All patched ROMs will automatically wipe the secondary system. So just patch and flash ;)
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Give me a couple minutes and I'll modify the patcher so it can do the ramdisk replacement part only. Then you can modify the updater-script for your specific ROM.
[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Done! Checkout version 1.6 :)

What you want to do is edit the updater-script like I describe in the OP and then drag the boot.img (or the zip itself) onto useful/replace-ramdisk.bat in the patcher.

Please let me know if it works, thanks!
[Galaxy S 4 i9505 Original Android Development] gaww:
I don't know if this is possible, but would like to know if the linked MOD could be made patchable. It is the AOSP Wallet patcher.

It will not install the modified Wallet App into the secondary ROM, and the App only will not install as-is - ditto with just putting it into system apps. This mod (TW version) was installed and running great in Primary ROM (Wicked) and made a purchase with it yesterday. I had tried to patch it, but zip not supported.

http://xdaforums.com/attachment.php?attachmentid=2316573&d=1381453450
[Galaxy S 4 i9505 Original Android Development] RK:
Just patch it yourself using the manual patching guide in the OP.

Or,

1 Extract the zip and place the included wallet.apk on SD card

2 boot into primary ROM

3 copy wallet.apk to /system/dual

4 set permissions rw-r-r on /system/dual/wallet.apk

5 reboot into recovery and clear cache and delvik cache on the secondary ROM using DualBootUtilities

6 boot into secondary ROM and you should have wallet.
[Galaxy S 4 i9505 Original Android Development] gaww:
Thanks for your response.

I tried the "Or" option, and got Wallet installed as I had done previously, but the issue is that it still works OK except for the NFC payments, which do not even appear as an option. I am reluctant to try the manual install to only find out that it just may not work in CM10.2 - period. With the other new TW Wallet patch, it works fine in my Primary ROM.

I was thinking that there might be additional modifications in the installation script for the patch that are needed besides just the app, but may just accept that I am spending too much time for a function that a simple reboot into the Primary ROM makes available, as well as WiFi calling.

Now if the OP somehow got this working along with his TMo WiFi calling MOD....
[Galaxy S 4 i9505 Original Android Development] RK:
Nope.. I looked at the update script in the zip file you posted. It does not do anything besides the steps in the OR part...