On Mon, Jun 25, 2012 at 7:27 AM, Jason Meyer <[email protected]> wrote:
> On 25 Jun., 02:26, Dianne Hackborn <[email protected]> wrote: > > Why do you care if there is a <perms> tag? > Because I figured that is what controls which Permissions can be used > by apps. At least for apps stored in "user space" (/data/app/) this > seems to be true. As stated here, you can revoke permissions granted > at installation by editing the packages.xml file: > > http://elinux.org/Android_Security#Changing_application_security_permissions_after_installation I would strongly disagree with that wording. The file is used to retain information across boots. It is a dump of the current in-memory state that needs to be retained across boots. It doesn't control anything, except what the platform will think it last state was the next time you reboot. Modifying it only has an impact if you do this between stopping and restarting the platform. Also changing what is listed there is not in my mind "revoking" the permission, it is making the platform think the last time the user went through the install UI of the app that this was not a permission shown and approved by them. > > applications in the system image must still explicitly request the > > permissions they need, and they have to follow the rules as anyone else: > What do you mean by "explicitely request"? List them in their > AndroidManifest.xml? > Yes. > > The only > exception is the "signatureOrSystem" permission type, which > > means the > permission can be granted to an app signed with the same > > cert (whether it is in the system image or a third party app), *or* to > any > > app installed on the system image. There are a handful of such > > permissions, but it isn't the common case. > Does this only apply for all permissions protected by > "signatureOrSystem", or does this also apply to permissions with a > "lower" protection level such as "dangerous"? > I.e., is there a relation regarding protection level strictness like: > signature > signatureOrSystem > dangerous > normal? > So that apps in /system/app/ will be granted permissions with a > protection level equal to or below "signatureOrSystem"? > normal == any app requesting the permission can get it, it will not normally be shown to the user. dangerous == any app requesting the permission can get it, it will be shown to the user when installing the app. signature == app requesting the permission must be signed by the same cert as the one that declared the permission. signatureOrSystem == same as signature, and also any apps installed on the system image can get the permission. I wouldn't try to put these in a strict hierarchy. > > As for why there are no permissions stored in packages.xml: there is no > > need, because they can just be re-evaluated each boot when scanning the > > packages. > Then why are they stored for user apps (stored in /data/app/)? > Because those are the permissions the user saw and approved. Users do have to see and approve permissions for system applications. > > If you use the package manager APIs to find out the permissions that are > > held by each app, you will see that the system applications are granted > the > > permissions they request as per the rules. > Again: What dou you mean by "request"? Putting them in your > AndroidManifest.xml? Because for all apps I wrote, I never explicitely > requested any permission in my code. Only through the Manifest file. > You request a permission with <uses-permission> in your manifest. http://developer.android.com/guide/topics/security/permissions.html#permissions -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

