1. Download our Official Android App: Forums for Android!

Support Priv-app and app folders in the system partition

Discussion in 'Android Help' started by El Presidente, Sep 10, 2016.

  1. El Presidente

    El Presidente Beware The Milky Pirate!
    Moderator Thread Starter
    Rank:
     #5
    Points:
    3,118
    Posts:
    32,120
    Joined:
    Jan 3, 2011

    Jan 3, 2011
    32,120
    24,096
    3,118
    Scotland
    What's the difference between these 2 folders?

    The stock camera app on the LG V10 has been modded to work on the G4, but it will only save to SD Card if it's installed on the system partition. Rather than using Terminal Emulator to do it, I took the lazy option, installed as a normal .apk file and converted with Titanium.

    Using the pm list packages command, it appears to be installed on the system partition, but it's still not saving to the SD. (stock camera is com.lge.camera, V10 camera is com.lge.cammra).

    Code (Text):
    1. u0_a118@p1:/ $ su
    2. root@p1:/ # pm list packages -f
    3. package:/system/priv-app/LGCameraApp/LGCameraApp.apk=com.lge.camera
    4. package:/system/app/com.lge.cammra.apk=com.lge.cammra
    Is it because it's in the app folder, not priv-app (I note that most of the preinstalled LG apps are in the priv-app folder)? Is there a difference to how the system views these folders?
     

    Advertisement

  2. scary alien

    scary alien not really so scary
    Moderator
    Rank:
     #8
    Points:
    2,138
    Posts:
    22,298
    Joined:
    Mar 5, 2010

    Mar 5, 2010
    22,298
    23,695
    2,138
    Male
    space alien ;)
    Indy
    According to https://groups.google.com/forum/#!topic/android-platform/Vsa4IsJcOPE:

    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.

    and http://stackoverflow.com/questions/19868138/aosp-privileged-vs-system-app says:

    So after some digging, it's clear that apps in priv-app are eligible for system permissions, the same way that old apps used to be eligible to claim system permissions by being in system-app. The only official Google documentation I could find on this 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.

    So, the priv-app location implies/connotes the system-level privileges you're seeking (from how I read the above).

    Does TiBu give you an option to install it as a priv-app?
     
    Bg260 and El Presidente like this.
  3. Bg260

    Bg260  
    VIP Member
    Rank:
     #32
    Points:
    763
    Posts:
    3,538
    Joined:
    Apr 30, 2016

    Apr 30, 2016
    3,538
    3,667
    763
    Male
    Freelance Entrepreneur
    Lincoln
    El Presidente and scary alien like this.
  4. scary alien

    scary alien not really so scary
    Moderator
    Rank:
     #8
    Points:
    2,138
    Posts:
    22,298
    Joined:
    Mar 5, 2010

    Mar 5, 2010
    22,298
    23,695
    2,138
    Male
    space alien ;)
    Indy
    :D ;) :) :p
     
    Bg260 likes this.
  5. El Presidente

    El Presidente Beware The Milky Pirate!
    Moderator Thread Starter
    Rank:
     #5
    Points:
    3,118
    Posts:
    32,120
    Joined:
    Jan 3, 2011

    Jan 3, 2011
    32,120
    24,096
    3,118
    Scotland
    Not that I can see, but I can use Root Explorer to move it & change the permissions that way (which is probably what I should've done in the first place).

    Never occurred to me that the priv in priv-app might actually stand for privileged, not private...... :p

    Thank you both!
     
    #5 El Presidente, Sep 10, 2016
    Last edited: Sep 10, 2016
    Scotty84, Bg260 and scary alien like this.
  6. Bg260

    Bg260  
    VIP Member
    Rank:
     #32
    Points:
    763
    Posts:
    3,538
    Joined:
    Apr 30, 2016

    Apr 30, 2016
    3,538
    3,667
    763
    Male
    Freelance Entrepreneur
    Lincoln
    I always thought it was private myself. I like these questions. I am a gleaner I guess.:)
     
    Scotty84 and El Presidente like this.

Share This Page

Loading...