Reading the book: Android Security Internals I'm reading at Chapter 2 - Permission Management paragraph that permissions are assigned to application at install time by the packet manager with a mapping like Apk's UID <-> Permissions.
Later in the book (Permission Assignment - Permissions and Process Attributes paragraph) I read that
If additional permissions have been assigned to the application, they are mapped to GIDs and assigned as supplementary GIDs to the process.
And, since android.permission.INTERNET permission is associated with inet GID:
any process for an app that has been granted the INTERNET permission is associated with the supplementary GID correspond- ing to the inet group
But I was asking me if this is always necessary.
Imagining a case where you install APK X declaring android.permission.INTERNET permission in AndroidManifest.xml, since mapping of permissions with UIDs is done at install time, PacketManager should be able to map the permission directly with the APK's UID instead of adding inet GID to your APK package.. So I'm wondering why it has to be that:
any process for an app that has been granted the INTERNET permission is associated with the supplementary GID correspond- ing to the inet group
Anyone can clarify me this?