Symlinked folder is treated as a file instead of a folder - Eee Pad Transformer Q&A, Help & Troubleshooting

Hello, using KatKiss 4.4.4 #35 i'm unable to get a symlink to work correctly from /storade/sdcard1/Android/data/<name of a package> (source) to /data/media/0/Android/data/<package name>.
The symlink do works from the path "/data/media/0/Android/data/<package name>" with a file explorer, but the reflected view on "/sdcard/Android/data/<package name>" is treated as a file by every applications, including the file manager that doesn't know what to do with that file (but correctly recognize this is a symlink and not a folder physically created here) and the software that require that folder (crash because it reconize it as a file and not a folder, as it use the "/sdcard" path and not the "/data/media/0/")
This is not a permission problem on the source folder side, changed to 777 it still doesn't work.
The problem is not specific to KatKiss, but i'm giving the information in case someone have a workaround that works only on a specific fork.
The only working workaround i found is using XPosed, redirecting the calls to the /storage/sdcard1 directly, but this solution is too aggressive, i'm unable to move only a subfolder of that package's folder, i'm forced to move everything.
The mountpoint workaround is dirty, i'd rather not use that if possible.
Regards, Magissia

Related

how can i write a file to the / directory

i want to save a file to the / directory of my phone.
when using adb in recovery mode with $su and mount -a, it seems as if i'm able to us cp to move a file to it, ls shows the file afterwards.
but after booting, the file is gone.
i tried it with a update.zip, same result.
anybody has an idea why this is so and if there is a solution to my problem?
thanks
use root explorer from the market....you can simply copy the file you need to the "/" directory with this app!
I think / is in RAM. There are system and data partitions on internal flash, but there isn't / one, right?
@androgiallo i don't know about root explorer, bur SU File Manager & Terminal couldn't do the trick ...
@Brut.all to be honest, i don't know what you're talking about ... does your reply mean it's futile or rather that there might be a solution?
btw, thanks for maps[brut] and even more for apktool.
der_bert said:
@Brut.all to be honest, i don't know what you're talking about ... does your reply mean it's futile or rather that there might be a solution?
Click to expand...
Click to collapse
I mean "/" isn't persistent - I think it is created in the RAM when you turn on your device, then you could change its contents, but after rebooting it's gone.
For sure there is a way to install something there. If I'm right about that RAM, then there should be somewhere some image of initial contents of "/" partition (they are copied to RAM at boot) - probably in boot.img . So it's possible, but not that easy as just copying a file to "/".
These are just my guesses, maybe I'm wrong.
Ahh and why do you want to place some file to "/"? Why not to e.g. /data/?
i use a keyfile for my password manager and i have to enter the path to it manually every time i open the database, so i want to keep the path as short as possible ...

Solution: Shared Library Crash With Terminal

I was getting something like this error after compiling and integrating Term.apk and it's dependent libjackpal-androidterm3.so file in several 2.3 and newer ROMs:
UnsatisfiedLinkError: Cannot load library: reloc_library : unknown reloc type
It turns out that the libjackpal-androidterm3.so file in the apk was not the correct file to copy to /system/lib. I checked the source directory and in the /obj directory there was another libjackpal-androidterm3.so file that was much larger. I copied it to /system/lib and terminal works great. The file does get compiled during ndk-build; it is not pre-included with the source.
Usually I am able to copy library files directly from the apks. This apk was different for some reason. Anyway, I hope this helps someone.

Cannot delete files or folders within /data/data/

Setup: CROMI 3.4.7 with Data2SD
I am having issues deleting folders and files within the /data/data/ portion of my file structure. I have tried with both th File Manager HD and ES File Explorer but I keep getting messages saying that I am unable to delete those folders and files.
The reason I am trying to delete this is because I was unable to install certain apps, and continually got an error message during installation that said:
Unknown error code during application install: "-24"
From searching forums, I found that the issue is that previous installations (I guess I forgot to do a factory reset before reflashing a ROM) left certain system folders and files for certain applications, which prevented a fresh installation from taking place. Other users have resolved this issue by deleting the relevant files in the /data/data/ section of their tablet.
I have circumvented the issue by renaming those folders (which for some reason works), but still cannot delete those renamed folders. I've tried messing with the permissions, but still no luck.
Any ideas?
Possibly an ownership problem?
Boot into recovery, plug in the USB cable, go into adb shell. Make sure that /data is mounted. Then do something like:
cd /data/data
chown -R media_rw.media_rw *
Might wanna backup first...
danger-rat said:
cd /data/data
chown -R media_rw.media_rw *
Click to expand...
Click to collapse
Don't do that if you want any apps to work afterwards.
Eeeeek, good catch!
I was thinking data/media.
You could do this just for the specific folders you want to delete, but not all...

[Tutorial] Install problematic APKs in /system (or /preload)

You may have tried to move some APKs to /system/app/ and end up with continuous crashes, usually resulting in abandoning your plan to save some otherwise wasted space (or preventing to accidentally uninstall all keyboards...)
This is often said to be a permissions issue, yet that's not enough for some packages: those with external libraries.
Copy the APK to /system/app/, then `chmod 644` it as usual.
You can also install to /preload and symlink to system
On your computer (easier but not required), open the APK (as a renamed ZIP).
Go to ./lib/{architecture}/, where on the Ace2 this is lib/armeabi-v7a.
Extract all the (.so) files here and put them in /system/lib.
There's no step 5!
Ryccardo said:
You may have tried to move some APKs to /system/app/ and end up with continuous crashes, usually resulting in abandoning your plan to save some otherwise wasted space (or preventing to accidentally uninstall all keyboards...)
This is often said to be a permissions issue, yet that's not enough for some packages: those with external libraries.
Copy the APK to /system/app/, then `chmod 644` it as usual.
You can also install to /preload and symlink to system
On your computer (easier but not required), open the APK (as a renamed ZIP).
Go to ./lib/{architecture}/, where on the Ace2 this is lib/armeabi-v7a.
Extract all the (.so) files here and put them in /system/lib.
There's no step 5!
Click to expand...
Click to collapse
Thank you very much :good:
All of the above is still true if you want to package apps in CWM format, but people who just are tight on /data (and don't want to repartition) can just use the convert to system app in Link2SD, which now actually works on apps with libraries

Mount binding SD card folder works for moving WhatsApp media

¿Why do people use xposed or foldermount? It is pretty easy to accomplish a binding mount.
BTW, I tried foldermount and it failed because it didn't fix permissions
And link2SD didn't even try moving the WhatsApp media
Here we go: (commands run from adb, could use terminal):
First, move your WhatsApp content to the sd card. (I moved /data/media/0/WhatsApp/* to /data/sdext2/WhatsApp/)
Now fix permissions (and ownership)
Code:
chown -R root:root /data/sdext2/WhatsApp
chmod -Rv 777 /data/sdext2WhatsApp
Now, mount the sdcard folder into the internal memory folder
Code:
mount -o bind /data/sdext2/WhatsApp /data/media/0/WhatsApp
Considering
/data/sdext2 is a mounted external sdcard. This means that the folder is accessible. Makes sense since you just created /data/sdext2/WhatsApp to move the WhatsApp media into there.
/data/media/0/WhatsApp is the WhatsApp folder It is the original location of the WhatsApp media and MUST EXIST check its permissions, too, btw, just in case. Always try the real location ignore /storage/emulated/0/WhatsApp or any other symlink or emulated
Now restart whatsapp and test. Working means you can access your downloaded pictures and you can download new ones. Either that or, In which way is it not working?
If it works ok, make the code line which mounts the folder to be run on startup. I pasted it in my /system/etc/init.d folder because my rom supports it. If you are following this guide, you probably know how to make code run on startup.
It is so easy, why are people installing apps or frameworks for something SO FREAKIN' EASY!?
BTW, whatsapp couldn't use symlink. That's why I had to use a foldermount.
tested on: lollipop 5.0, samsung i9500, halcyon rom and kernel
pppppp said:
¿Why do people use xposed or foldermount? It is pretty easy to accomplish a binding mount.
tested on: lollipop 5.0, samsung i9500, halcyon rom and kernel
Click to expand...
Click to collapse
Did you by any chance get to test with pie? Or are you still on ancient lollipop?

Categories

Resources