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
signaturelevel permission - The signature is checked in PackageManagerService.java
- These apps will be granted
- Apps in
/system/priv-appsand/system/framework- These apps will get the flag
ApplicationInfo.PRIVATE_FLAG_PRIVILEGED - The flag is set in PackageManagerService.java
- These apps will be granted
signatureOrSystemlevel permissions (corresponding to theSysteminsignatureOrSystem) - For Samsung, apps in
/system/carrier/priv-appand/odm/priv-appwill 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