Android roles and permissions

I would like to understand something about Android roles and, in particular, why, if I execute this function of the Context class

openOutputFile(filename, MODE_WORLD_WRITEABLE) 

the created file has write permissions for each role (User, Group, Others), but has read permissions only for the user and group. I think this is not os lock, because if I try to change the permissions that execute this code

 Runtime.getRuntime().exec("chmod 666 FILE_PATH") 

it sets read and write permissions for each role.

This is normal? "Who are the people in the role of others? Why doesn't the first instruction set read permissions for Others?"

Thanks.

+4
source share
2 answers

This is normal?

Yes.

"Who are people in the role of others?

All applications on the device, except yours.

Why doesn't the first instruction set read permission for Others?

Because you did not ask. Use MODE_WORLD_READABLE to set read access bits.

+4
source

"Android is a privileged operating system in which each application works with a separate system identifier ( Linux user ID and group identifier ). Parts of the system are also divided into separate identifiers. Thus, Linux isolates applications from each other and from the system."

http://developer.android.com/guide/topics/security/permissions.html

In addition, here are some research results:

http://elinux.org/Android_Security#Users_and_groups

+1
source

Source: https://habr.com/ru/post/1440622/


All Articles