About /system/priv-app partition

25 Dec 2016 • 0 Comments

If you just updated your Greenify to 3.0 build 5 recently on Android 4.4 or above, you might notice the release note that,

NEW: “Privileged Mode”, more powerful than Root mode. It can be activated either by ROM-integration or moving app to system partition (/system/priv-app).

Well, we are familiar with /system/app/, but what’s the difference of /system/app/ and /system/priv-app in Kitkat?

According to Christopher’s comments, it is said,

Only apks in /system/priv-app can use system-level permissions. Prior to Kitkat, all apks on the system partition could use those permissions.
This change gives the manufacturer more control over access to sensitive permissions by bundled software.

We can also get some information from official Google documentation that came in the form of a commit message: Commit hash: ccbf84f44c9e6a5ed3c08673614826bb237afc54

Some system apps are more system than others
“signatureOrSystem” permissions are no longer available to all apps residing en the /system partition. Instead, there is a new /system/priv-app directory, and only apps whose APKs are in that directory are allowed to use signatureOrSystem permissions without sharing the platform cert. This will reduce the surface area for possible exploits of system- bundled applications to try to gain access to permission-guarded operations.
The ApplicationInfo.FLAG_SYSTEM flag continues to mean what it is says in the documentation: it indicates that the application apk was bundled on the /system partition. A new hidden flag FLAG_PRIVILEGED has been introduced that reflects the actual right to access these permissions. (via stackoverflow)