Just declare the permission in your own .apk that is signed with your
certificate, so it will be associated with that certificate.  If it is a
signature perm, then only apps signed with that cert can be granted it.
 Then you can use the perm in all the normal ways -- as a requirement for a
component in a manifest, checking the caller in incoming IPC with the
Context APIs, etc.

Note that you can NOT check the perm in any of the PlatformLibrary code,
since this code by definition is loaded and runs in each client process (it
is a shared library).  You need to do the check in some process you trust,
behind an IPC.

On Wed, Dec 2, 2009 at 6:28 AM, Robert Lagerstedt <
[email protected]> wrote:

> If I create a service within an apk and create an AIDL API to this
> service I can protect the usage of this API
> using signatures in the AndroidManifest file.
>
> If I create a native/JNI library with a Java API as shown in the
> platform_library sample, how can I protect the
> usage of this API with signatures or any similar protection?
>
>
> /Robert Lagerstedt
> Distribution Architect - Android
> Sony Ericsson
>
> The postings on this site are my own and don’t necessarily represent
> Sony Ericsson’s positions, strategies or opinions.
>
> --
> unsubscribe: 
> [email protected]<android-porting%[email protected]>
> website: http://groups.google.com/group/android-porting
>



-- 
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.

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to