Android: 系统app和非系统app

系统app和非系统app

Explaining the behavior of an Android application: System apps vs Non-System apps

http://www.archive.ricston.com/blog/explaining-behavior-android-application-system-apps-nonsystem-apps/

Explaining the behavior of an Android application: System apps vs Non-System apps

by Sergio | Apr 10, 2013 | Android | 16 comments

There exists a lot of contrariety on the web when it comes to the description of an Android System application. I will therefore explain the correct methodology here, which will hopefully enlighten you on whether you should place your Android application as a System application or not.

A System application is NOT an application which is signed by the OS’s platform signatures. This is a common mistake believed by many and we shall come to this later on. A System application is merely an application which is placed under /system/app folder in an Android device. An application can only be installed in that folder if we have access to the OS’s ROM (system.img). The application is placed under /app folder after the ROM has been extracted. A device which loads the custom ROM will have the new System application added. The benefit of a System application is that the application cannot be removed from the device (cannot be uninstalled by the user). This is only because /system/app is a read-only folder.

A non-System application is an ordinary application, which will be installed under /data/app folder, and which is read-write. A user can uninstall such applications normally from the Settings application. One can check if an application is a System application or not using “ApplicationInfo.FLAG_SYSTEM”. If the constant returns true, then the application in question is a System application.

Finally we shall explain the benefits of an application being signed by a particular ROM’s platform signatures. Certain permissions are protected under the “signatureOrSystem” protection level. Such permissions are not available to every application because they will grant risky privileges such as control over other applications, background installation and un-installation, among others. Such permissions can be utilized for malicious purposes, therefore Android will only grant them for System applications or Ordinary applications signed by platform signatures. System applications do not require signing by a platform signature to access these permissions. However, it is necessary for Ordinary applications to be signed before they can utilise these permissions.

发布了106 篇原创文章 · 获赞 30 · 访问量 12万+

猜你喜欢

转载自blog.csdn.net/dc3120/article/details/90349949
今日推荐