[Galaxy S 4 i9505 Original Android Development] chenxiaolong:
Version 7.0.0 has just been released! (I usually bump the major version only when the code is incompatible with previous versions, but I think the new features make it worth the bump this time)

The first major change in this release is that the camera

finally

works in dualbooted TouchWiz 4.4 ROMs. Now that the camera, audio, and vibration work properly, there should be no more major bugs when these ROMs are dualbooted :) The second major change is that F2FS-enabled kernels are now supported. This includes kernels that support both EXT4 and F2FS (like Alucard and ktoonsez). Note that it is

not

possible to dual boot an EXT4 ROM with an F2FS ROM.

On the Android side, the patcher now refreshes the media scanner cache so the patched files show up over MTP when connected to the computer.

Support for new stuff

SuperSU release candidate versions (1.99r4)

Echoe GE 4.4.3 (their files have a new naming scheme again)

Echoe AEL kernel

Alucard AOSP kernel V2.6.7la

Alucard TouchWiz kernel

AOKP 4.4 Google Apps package

Technical details Rant

Debugging proprietary software sucks. Seriously. The TouchWiz 4.4 camera issue is actually a permission issue that shouldn't exist at all. For the camera to work properly, the Qualcomm camera daemon (mm-qcamera-daemon) needs to have access to /data/cam_socket*, /dev/video*, /dev/media*, /dev/v4l-subdev*, /dev/msm_camera/*, and /dev/msm_vidc_end. That should be perfectly fine because each of those devices/files are owned by the 'camera' user and group and mm-qcamera-daemon runs as the camera user right? NOPE. So what's wrong then? You'd think that the ownership and permissions of those files were not set properly right? Well nope, they were all set properly and yet, the camera still didn't work.

So I thought, if the permissions on the files were right, then the daemon must not really been running under the camera user and group. Well, /proc/<daemon pid>/status showed that it was indeed running under the correct user and /proc/<daemon pid>/limits shows that there were no restrictions imposed on the process from the Linux capabilities and limits systems. Stumped by this, I tried to avoid the permission issues altogether by running the daemon under the root user and group. Guess what? The camera STILL didn't work. But this time, instead of logging nothing, the daemon actually complaining about not being able to access the hardware. The fix was to make the files and devices I mentioned earlier world-readable and writable along with running mm-qcamera-daemon as root.

This isn't exactly the most secure solution, but right now, it's the only one that works. If anyone has any insight as to why this happens, I'd be happy to hear it :) I'm guessing Samsung worked around something in their init binary to avoid this issue, but I have to resort to using a patched AOSP init since their's fails to mount partitions when dual booted.

Code changes

The ktoonsez ramdisk patching script has been removed. The Qualcomm common script can now handle the common hack of commenting out lines based on the filesystem in fstab.

The mount script will now be executed after the mount_all init command regardless of where (location in init script) the partitions are mounted. The TouchWiz on_fs_selinux target issue has been worked around in another way.

The mount and vold arguments for Google Edition and TouchWiz ROMs are no longer overridden. The patcher will search the fstab file for existing mount options before falling back to the defaults.

All common code for Qualcomm devices has been moved to ramdisks/common/qcom.py. This removes a whole ton of duplicated code and simplifies ramdisk patching scripts to something like this: https://github.com/chenxiaolong/DualBootPatcher/blob/master/ramdisks/jflte/AOSP/AOSP.py

^^^ As usual, TouchWiz still requires a bunch of hacks... removing hardcoded checks for a nonexistent 'icd' device; removing selinux policy reloading lines that crash when selinux is set to permissive; setting unneccessary permissions; using a specially crafted custom init and adbd binary; mounting modem partitions outside of the init script; etc

The init-kk44 binary has been updated (compiled for jflte with unmodified CyanogenMod source on 2014-06-11)