How can I change file permission of a file on Android without rooting? I actually want to prevent some files from deletion.
Note: I am asking of changing the file permissions of user-created files in internal shared storage.
On all operating systems based on Linux kernel - like Android is - it's possible to set permissions on files (including directories) provided that filesystem supports UNIX permissions (uid, gid, mode). Common examples of such filesystems are
However Android's internal (confusingly called external) storage which is accessible by installed apps at
/sdcard, is not an actual but virtual / emulated filesystem exposing
/data/media (which is a real filesystem) through
sdcardfs. sdcardfs and its predecessor
FUSE expose the emulated filesystem with a fixed set of uid, gid and mask (mode). So the commands
chown have no impact, whether executed through CLI (adb shell or terminal emulator) or GUI (file explorer).
It's possible to change permission bits of file on underlying actual filesystem, but accessing
/data/media requires root access because only UID/GID
1023 (aid_media_rw) has read access to the directory. And still the permissions will remain same when viewed from emulated view
So you can't change permissions of user created files on Android, with or without root.
Its possible with a File manager called Es File explorer it comes with a number of features out of the box just do try downloading that app from Playstore
I don't exactly remember the exact settings but it should be there I used it long time ago after installing Navigate to the folder that contains your file -> Select the target -> Select Properties -> you should see some permissions like read-write,read,write choose that applies