Android's privilege Persion is also fine-grained privilege management.
Classification:
Normal
Dangerous (prompt during installation)
Signature (for vendor-defined permissions, a few apps developed by the vendor can be used, other third parties can not use, with the manufacturer's private key to sign)
Signatureorsystem (the manufacturer or the system comes with the available permissions)
You can see the defined permissions under Frameworks/base/core/res/androidmanifest.xml
Run-time permission control mode:
1. Through Pacakagemanage's checkpermission
Android-only service (the underlying platform Linux does not have)
So you need to control it in the Android framework.
Mainstream service is generally based on binder IPC or other IPC services
So at the lowest level of control (the server where the service resides) to avoid escape control
Bypass utility function directly invoke Remote Service
Example: Daydream
2. Mapping to specific properties of the OS
Non-Android-specific service (the underlying platform has been provided, such as file access, number of TCPIP
According to the transceiver, etc.)
Multiple portal access: Android API, Java api,ndk C API, Shell, etc
The underlying control criterion, the convergence port at the bottom, so at the bottom (OS level) unified control, which
Can avoid escape control
So some of the security control features of the multiplexed OS, such as GID
So you need to mapping the permission of the Android space to the OS gid.
Example: Access SDcard
When we declare that you have read and write SD card permissions
View file permissions, each with GID as SDCARD-_RW
How to add it?
Grammar:
UID Assigning Permission:<assign-permission
Name= "Permission_name" uid= "Target_uid"/>
Gids Mapping: <permission name= "Permission_name" >
<group gid= "Assigned gid"/>
<group gid= "Assigned gid"/>
............
</permission>
Time of occurrence: At the time of installation
Under the Etc/permissions directory
Any XML file below system/etc/permissions that conforms to the above syntax will be
The system reads the parse and uid/gid the mapping. Like Platform.xml.
Security: Only the root user is allowed to add or overwrite.
Android Security-Permissions