Following the previous question regarding android permissions at runtime, I found that there are many different ways in android that an application can check with the calling (client) application. This includes calls like checkCallingPermission, checkCallingOrSelfPermission, checkCallingUriPermission, checkCallingOrSelfUriPermission, checkPermission, checkUriPermission. Since I went through the android documentation , I can only find these calls related to checking permissions at runtime. My questions:
- Is there another way (instead of using the above calls) to check caller permissions dynamically? If there are such calls, please provide information / links or list them.
- Description checkCallingOrSelfPermission says
it provides your own permissions if you are not currently processing IPC. Use with care !
This seems risky because it can facilitate the delegation of (dangerous) permissions to the calling process, which can lead to escalation of privileges (if used carelessly). Please let me know if I say correctly that this can lead to an escalation of privileges.
- I could not understand why the process (the running application) checks if it has a certain permission (does he know very well what he has the right to do?). Please let me know the intuition behind the design of this particular method: checkCallingOrSelfPermission. (Assuming this is just why / when do I need to checkCallingOrSelfPermission?)
android android permissions android manifest permissions
Annamalai n
source share