Limit content provider access

by AndroidKing » Tue, 14 Jul 2009 09:27:43 GMT


Sponsored Links
 is there an easy way to limit my content provider access to only one
or more packages
I don't want other packages to access my data

I looked at   grantUriPermission  but its not straight forward and it
doesn't work

any ideas?
--~--~---------~--~----~------------~-------~--~----~



Limit content provider access

by Dianne Hackborn » Tue, 14 Jul 2009 14:23:39 GMT


 By far the easiest way is to do this based on app certificates -- just use
android:readPermission and android:writePermission in the manifest, and
declare the permission you are using there with <permission> to be
android:protectionLevel="signature".  Then only apps signed with the same
certificate as your own will be able to get the permission, and thus able to
read/write the provider.






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

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Limit content provider access

by AndroidKing » Tue, 14 Jul 2009 23:38:10 GMT


 Thanks for the reply

That doesn't really help
I want to limit the access based on the package name.
The package name will have different signature from my App.
I added android:readPermission and android:writePermission to the
content provider
but what is the use, any package can add these two permissions and
still access the content provider
I think Android is missing the access limitation...

any other way???





--~--~---------~--~----~------------~-------~--~----~



Limit content provider access

by Dianne Hackborn » Wed, 15 Jul 2009 00:00:05 GMT


 You can limit who can get the permissions based on certificate, to control
who can get the permission, using android:protectionLevel="signature".

The package name is not secure at all -- anyone can write an app with a
particular package name, you have no idea what app it actually is based on
that.  If you really want to do this based on package name, you can
implement the security check yourself at the points of call into your
content provider (such as the query() method) -- you can use
Binder.getCallingUid() to find out who is calling you and the PackageManager
to find the package(s) associated with that.  The platform doesn't provide
any easy way to to this, though, because it is does not provide any actual
security.








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

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Milestone kok Logonya Android saja?? ganti yuuk..

Yuuk mari kita ganti dgn Logo Mata Droid..

Syarat..Milestone mesti sudah root yah..

1. Download
http://droidboots.com/http//droidboots.com/downloads/bootanimations/orig.zip
3: Copy file tersebut ke root sdcard
4: Buka app Terminal (klo blom ada download di market)
5: Ketik su
6: Ketik mount -o remount,rw -t yaffs2 /dev/block/mtdblock6 /system
7: Ketik cp /sdcard/bootanimation_orig.zip /system/media/bootanimation.zip
(must be this name otherwise won't work)
8: Ketik mount -o remount,ro -t yaffs2 /dev/block/mtdblock6 /system
9: Ketik reboot

Cakep dah..truely DROID!!

Source : alldroid.org

-- 
--------------
"Indonesian Android Community [id-android]" 

2. ???? ???? ???? ?? ???? ????? ?? ?????



They do. There is a link to contact them on the About page, as it is
with many Google Groups.

3. about resetInterface() in Android Wifi

4. Fwd: tdk bisa login Gmail

5. Milestone Nandroid Backup..

6. HTC HD or HTC Hero

7. How do I get the KeyEvent when screen is OFF