Re: [android-developers] Re: Restricted access to Content Provider

2011-05-04 Thread Dom
Thanks for that info Dianne. It looks like I need the 
android:protectionLevel=signature configuration, however I can't get it 
working.

Here is my manifest containing my content provider:

manifest xmlns:android=http://schemas.android.com/apk/res/android; 
package=com.cpexample
permission android:name=some.name.permission 
android:label=@string/cp_permission_label
android:description=@string/cp_permission_desc 
android:protectionLevel=signature/
application android:label=@string/app_name 
android:icon=@drawable/icon
provider android:name=.Provider 
android:authorities=com.cpexample.Provider/
/application
/manifest


I used eclipse to Export Signed Application of the content provider using a 
brand new keystore. I have another app signed with another keystore. I 
didn't expect the second app to be able to access the content provider, yet 
it has no problem accessing it. Have I misunderstood something?


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Restricted access to Content Provider

2011-05-03 Thread Dom
Hi, did you solve this problem of restricting access to your content 
provider to certain applications?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Restricted access to Content Provider

2011-05-03 Thread Dianne Hackborn
If you want to have a permission that only apps signed with your cert can
get, use android:protectionLevel=signature for the permission.

If you just want to limit access to only code within your own app, a quick
and dirty thing you can do is check that the calling UID is the same as
Process.myUid().

On Tue, May 3, 2011 at 12:08 PM, Dom dominicmarm...@gmail.com wrote:

 Hi, did you solve this problem of restricting access to your content
 provider to certain applications?

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en