Security Exception while implementing global search for Messaging - android

I am trying to enable global search for messaging application (i.e., messages can be searched from home screen search box). I have followed all the steps given in
http://developer.android.com/reference/android/app/SearchManager.html
I am getting the following exception
04-16 12:49:26.917: ERROR/DatabaseUtils(102): java.lang.SecurityException: Permission Denial: reading com.android.providers.telephony.MmsSmsProvider uri content://mms-sms/search_suggest_query/m?limit=58 from pid=106, uid=10000 requires android.permission.READ_SMS
I have set permission in MmsSmsProvider.java file for read, write sms and global search, but still I get this error.
Can anyone help.
Regards,
Sunil.

You need to have
<uses-permission android:name="android.permission.READ_SMS"></uses-permission>
in you AndroidManifest.xml

Related

Google Play Game Services: SecurityException: Permission Denial: opening provider

This is what I am getting when trying to load google Images:
08-23 12:03:41.247: W/ImageView(23831): Unable to open content: content://com.google.android.gms.games.background/images/1066b186/2
08-23 12:03:41.247: W/ImageView(23831): java.lang.SecurityException: Permission Denial: opening provider com.google.android.gms.games.provider.GamesContentProvider from ProcessRecord{413da0f8 23831:[package_name]/10161} (pid=23831, uid=10161) that is not exported from uid 10045
How do I solve this?
It looks like the "GamesContentProvider" that is used by you or some of the classes you use requires a permission that you have not added in your manifest file. Take a look at the documentation of the classes (in GooglePlayServices) you use and see if there is something about any permission you have to add to your app in order to be able to use the documented functionality.

how to get email\gmail data to activity?

how to get mail buddy from email by choosing ?
i found some sulotion's here at stackoverflaw but when i finnaly found something that might work i gut permission error and as i understood from user here its blocked by google .
is it realy blocked ?
(java.lang.SecurityException: Permission Denial: opening provider com.google.android.gm.provider.MailProvider from ProcessRecord{4284e9f0 15683:com.example.buylist/10158} (pid=15683, uid=10158) requires com.google.android.gm.permission.READ_GMAIL or com.google.android.gm.permission.WRITE_GMAIL) - > this is the error . i add permission as asked from me and it still wont work .
if so , can u give me simple intenet that open gmail imbox (gmail built in app) .
and in related issue , i did get data from sms but can i do it with whatsup ?
thanks !
can u give me simple intenet that open gmail imbox (gmail built in app) .
No, because that is no longer allowed. Only fools did it in the first place, since it was not part of the OS, was not documented, and was not supported.

Does protectionLevel "signature" work properly with Android debug keys?

I have a content provider and a test application both signed with a debug key. The client receives a content normally if permissions are not applied, but I want to apply permissions to the stuff. So the following lines are added into the content provider's manifest file:
<permission android:name="org.example.provider.READ"
android:permissionGroup="org.example.group.DATA_ACCESS"
android:label="#string/readonlyaccess"
android:protectionLevel="signature" />
<application
...
<provider android:name=".ImageContentProvider"
android:authorities="org.example.provider"
android:readPermission="org.example.provider.READ" />
In the client's manifest file the following line is added:
<uses-permission android:name="org.example.provider.READ" />
When I try to get the data from the provider, I get the error:
09-13 22:38:20.995: E/AndroidRuntime(13979): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.hello/com.example.hello.HelloActivity}: java.lang.SecurityException: Permission Denial: reading org.example.ImageContentProvider uri content://org.example.provider/file from pid=13979, uid=10040 requires org.example.provider.READ
Am I missing something, or is it related to the fact that the applications are signed by debug key? How to solve the problem? I saw a suggestion to add uses-permission to the provider as well, but this does not help either. NB. This is checked inside emulator, if this can be of any importance.
I found a related question throws SecurityException when signing with the default debug keystore, but it does not provide actual solution.
Yes, it works with debug keystores, at least the last time I tried it.
I would have the <permission> element in both apps. If you installed the <uses-permission> one first, and then installed the <permission> one, you would run into problems. The permission needs to be defined before the <uses-permission> is encountered, and the simplest way to do that is to put the <permission> in both.

How to use security permissions in combination with a shared user id?

I got a well known security exception:
java.lang.SecurityException: Sending SMS message: User 1001 does not have android.permission.SEND_SMS
I added the following line to the android manifest file:
<uses-permission android:name="android.permission.SEND_SMS" />
But even when I do this I got the same exception.
This has possibly something to do with the shared user id I use:
android:sharedUserId="android.uid.phone", so here my question:
When I use a shared user id (from a system application), can I add my own permissions to the manifest file.
additional information:
I used the same certificate as the system, else I couldn't use the same user id as a system application.
Thanks in advance for your answers and remarks!
I know this question is old but I just had the same problem in 2019 and only found this un-answered question. I too was tinkering with with android:process & android:sharedUserId to let two apps use the same process and I too got a permissions-error that had previously not occurred before I started tinkering. I always got:
Neither user 10003 nor current process has android.permission...
What solved it for me was to perform a factory reset.

Security exception while calling bindAppWidgetId

While developing a Launcher (Homescreen) application for Android, I've come into a security exception I don't understand.
When calling the
[bindAppWidgetId()][1] method from
within my Launcher Activity, I get
this security exception :
08-19 11:30:11.689: ERROR/AndroidRuntime(6032): java.lang.SecurityException: bindGagetId appWidgetId=99 provider=ComponentInfo{com.android.music/com.android.music.MediaAppWidgetProvider}: User 10034 does not have android.permission.BIND_APPWIDGET.
I first thought I had forgotten the BIND_APPWIDGET permission in my manifest, but it is definitely there.
The android api documentation states this :
"You need the APPWIDGET_LIST
permission. This method is to be used
by the AppWidget picker."
I tried to add the permission android.permission.APPWIDGET_LIST, but it doesn't solve the issue.
Also, I've looked at the manifest of the Settings application from the android sources that contains the AppWidgetPickActivity code : there's a special line that asks to share user id :
"android:sharedUserId="android.uid.system"
Could it be related to my problem ?
If anyone has an idea that would be great !
Cheers,
Laurent
I've found an answer!
BindAppWidgetId() is deliberately not available to applications! (security problems).
"The android.permission.BIND_APPWIDGET
permission is a system permission. You
can only get that permission if your
package is installed as a system
package (installed in /system/app in
stead of /data/app) or sign you app
with a certificate that's the same as
your android image. So basicly this
means you can only use this permission
if you are also the creator of the
android image on your platform/phone."
Here are the links to this information :
http://groups.google.com/group/android-developers/browse_thread/thread/231245ba6d1e690f/047b9d3f776d7e54?lnk=gst&q=bindAppWidgetId#047b9d3f776d7e54
http://groups.google.com/group/android-developers/browse_thread/thread/f24e0f484a79d529/ef84188e8533a125?lnk=gst&q=bindAppWidgetId#ef84188e8533a125
A quick Google search reveals that android.permission.APPWIDGET_LIST is a usable permission, even though it's not listed in the API docs.

Categories

Resources