I have a Samsung Galaxy A5 (2016) which I rooted with Magisk.
Now in the process of installing TWRP and customizing my phone, I might have run some shell commands, like mount or sudo in a place where I shouldn't had.
So now some folders in my /sdcard/ are now "locked". Apps can't write to them like Whatsapp, Telegram, Camera, for example the messaging apps can't download any media, I can't take any picture with Camera.
When I try to delete a folder or a file with the built-in File Manager, it just doesn't succeed.
With adb shell I tried this command: rm -r /sdcard/Telegram/Telegram Images but I get permission denied, but running it as root works: su -c rm -r /sdcard/Telegram/Telegram Images.
What I did was, I checked ownership and read/write accesses with ls -al and I compared the results with a normal phone, EVERYTHING looks fine! User owner is root and group owner is sdcard_rw, folder permissions look like this drwxrwx--x and file permissions look like this: -rw-rw----.
This issue has been hunting me for a couple of months, my phone is almost unusable, sometimes app work, sometimes they don't. Please tell me how I can provide more information to help solve this problem, thanks very much.
restorecon -R /data/mediashould fix this. Details here: https://android.stackexchange.com/a/218409/218526 – Irfan Latif Dec 28 '20 at 18:52