I am learning Android programming and I have kind of understood the concept of custom permission.
Based on my understanding this is how custom permissions works:
'Base app'
can protect some of its components (e.g., activity and services) by declaring custom permissions (i.e., using <permission>
tags in the manifest file) and the'client app'
that calls the activities and services protected by custom permissions need to acquire necessary permissions (i.e., using <uses-permission>
tags in the manifest file) to call those components in the base app
.
However, I have these questions regarding custom permissions:
- If the custom permission is declared as dangerous (i.e.,
android:protectionLevel="dangerous"
), does theclient app
needs to get the approval from the user during installation time? If so, how does the user aware of these custom permissions because there won't be any documentation for the custom permissions. - During installation time how does the
client app
knows thatbase app
is already installed in the user's phone? Is there anyway for theclient app
to know this information? - Once the
client app
is installed, what will happen if the user decides to remove thebase app
? In this case, if the user tries to useclient app
will it cause any security exception?
I don't know whether these questions make sense but it makes me wonder how custom permissions actually work in real scenario.
Thank you.