Where is permissions in Android stored?
Asked Answered
Y

2

9

The developer doc: Requesting Permissions at Run Time clearly mentions what runtime permission is and how to use it. And I am able to execute them as well.

However, the question is : where does Android store the run-time permission values?

ie, when the user deletes the data associated with the app, the permissions are reset, so where do Android store these values? (is it in the app cache or in any other place). And in what format ? ( is it a database or a sharedpreferences file or any other) And how are they stored? (encryped or non-encrypted) .

Searched in many existing answers and developer docs, however couldn't find any useful info in this regard. Any help will be much appreciated.

Yearround answered 10/2, 2017 at 10:0 Comment(2)
What are trying to achieve? Permissions are designed to be managed by the OS, leaving your options to requesting and checking them.Missing
As per this thread, they are stored in RAM. groups.google.com/forum/#!topic/android-platform/oD33RVVUBB8Extraneous
A
9

I'm not sure if you found the answer to this or not, but they are stored in:

/data/system/users/0/runtime-permissions.xml

When the system is reset, or a new user created, the system also populates this with system app permissions to auto grant them. I have been trying to research how to auto grant permissions to system apps.

See this answer for more details.

Almond answered 25/5, 2017 at 16:36 Comment(0)
S
2

In Android 12 on Samsung phones it's:

/data/misc_de/0/apexdata/com.android.permission/runtime-permissions.xml

Can't confirm it for others.

0 seems to be the user-id.

Found by running:

find / -name '*permission*.xml' 2>/dev/null

Subclinical answered 7/3, 2022 at 8:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.