How to make symlinks work inside /storage/emulated in 4.4.4 I created a symlink from /storage/sdcard1/somefolder to /data/media/0/somefolder, but apps treat the symlink as a file and not a folder (and crash because they are hardcoded to look for files inside a folder at this path). 

Root apps that access the symlink from /data/media/0/somefolder works and treat it as a folder, non root apps use fused mount point at /storage/emulated/0/somefolder instead because they don't have the permission to look inside /data/media. 

It is not possible to symlink to the fused point directly (cross device link error). Symlink's point permission on fused point are 770 for a app_ID:1028 instead of 777 for root:root like it is from /data/media, it's not possible to change permissions using root on the fused point. /storage/sdcard1/somefolder is 777.

debuggerd exploit is to be avoided as long as possible and mount points won't be visible system wide.

What need to be changed to make the symlink working from the fused point? How will it affect the rest of the system?
Android guards mount points since Android 4.2 came out. You already mentioned the debuggerd hack, so I assume you know about this restiction.

This might seem obvious, but you should first check if the file system that is used on the emulated external storage and on the real external storage both support symlinks. If your SD-card is formatted as FAT32, which doesn't support symlinks, nothing will happen and you'll need to format the external storage to something like ext2/3/4 or yaffs.

The 'cross device link' error might be fixed by using ln -s /data/media/0/somefolder /storage/sdcard1/somefolder instead of ln /data/media/0/somefolder /storage/sdcard1/somefolder. This will create a symbolic link instead of a hard link, so it can span across file systems and storage devices. You need to do this as root or else it won't work.

If permissions are a problem you might need to fix the 'external sdcard problem'. This problem causes the real external SD-card to be read-only on versions of Kitkat. The details are on this page. It comes down to editing /system/etc/permissions/platform.xml so that apps with the WRITE_EXTERNAL_STORAGE permission can also write to the 'real' external storage. This can be done by installing this app or by doing the following:


  
  Launch your favorite file manager with enabled root access rights.
  You can use any app you prefer which can run elevated on your device.
  For example, the 'Root Explorer' app or 'Total Commander' or 'File Manager' from CyanogenMod will do.
  Navigate to the following file:
  
  
  /system/etc/permissions/platform.xml
  
  
  Find android.permission.WRITE_EXTERNAL_STORAGE and android.permission.WRITE_MEDIA_STORAGE lines. These are XML sections. You need to make them look exactly like the strings below:
  


&lt;permission name="android.permission.WRITE_EXTERNAL_STORAGE" &gt;
&lt;group gid="sdcard_r" /&gt;
&lt;group gid="sdcard_rw" /&gt;
&lt;group gid="media_rw" /&gt;
&lt;/permission&gt;
&lt;permission name="android.permission.WRITE_MEDIA_STORAGE" &gt;
&lt;group gid="sdcard_rw" /&gt;
&lt;group gid="media_rw" /&gt;
&lt;/permission&gt;



  Save the platform.xml file. It’s necessary to set the file permissions to  644 (rw-/r–/r–) before mobile restarting. Now reboot your Android device.


Credits go to poolmaker@XDA