Definition
The definition of system app is not very clear. There are at least three different definitions:
- Apps in system partition (
/system
)- These apps will get the flag
ApplicationInfo.FLAG_SYSTEM
- If an updated version is installed (probably not under
/system
), it will getApplicationInfo.FLAG_UPDATED_SYSTEM_APP
- These apps will get the flag
- Apps signed with platform signature
- These apps will be granted
signature
level permission - The signature is checked in PackageManagerService.java
- These apps will be granted
- Apps in
/system/priv-apps
and/system/framework
- These apps will get the flag
ApplicationInfo.PRIVATE_FLAG_PRIVILEGED
- The flag is set in PackageManagerService.java
- These apps will be granted
signatureOrSystem
level permissions (corresponding to theSystem
insignatureOrSystem
) - For Samsung, apps in
/system/carrier/priv-app
and/odm/priv-app
will also get this flag
- These apps will get the flag
Check
1 | import android.content.pm.ApplicationInfo; |
Reference
Definition of PRIVATE_FLAG_PRIVILEGED in ApplicationInfo.java
How to check if application is system app or not (By signed signature)
Android permission element