Permissions for jar

177 views
Skip to first unread message

user009

unread,
Aug 25, 2010, 4:19:50 AM8/25/10
to android-platform
Hi

I have a jar file that is added to BOOTCLASSPATH.
This jar file has a Broadcast receiver for SMS; which parses the sms
and sends to a native code (.so).

My question is how to set "android.permission.RECEIVE_SMS" for this
code/receiver. There is no java 'project' as such.

Where exactly is the xml(permission) setting for jar files in such a
case?


Thanks
Aby

Anthony

unread,
Aug 25, 2010, 1:35:35 PM8/25/10
to android-...@googlegroups.com
The permission would go in the application that your jar is used in.


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


user009

unread,
Aug 26, 2010, 1:18:19 AM8/26/10
to android-platform
In this case the jar goes to services.jar. (frameworks/base/services/)
in LOCAL_JAVA_LIBRARIES :

Actually there is no application(.apk).
A JNI layer uses this jar class to pass on the broadcast receiver
(sms)message to native code.

What is the procedure enable permissions in such a case.

Thanks
Aby


On Aug 25, 10:35 pm, Anthony <m.bn...@gmail.com> wrote:
> The permission would go in the application that your jar is used in.
>
>
>
> On Wed, Aug 25, 2010 at 3:19 AM, user009 <user...@gmail.com> wrote:
> > Hi
>
> > I have a jar file that is added to BOOTCLASSPATH.
> > This jar file has a Broadcast receiver for SMS; which parses the sms
> > and sends to a native code (.so).
>
> > My question is how to set "android.permission.RECEIVE_SMS" for this
> > code/receiver. There is no java 'project' as such.
>
> > Where exactly is the xml(permission) setting for jar files in such a
> > case?
>
> > Thanks
> > Aby
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-platform" group.
> > To post to this group, send email to android-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > android-platfo...@googlegroups.com<android-platform%2Bunsubscrib­e...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/android-platform?hl=en.- Hide quoted text -
>
> - Show quoted text -

Anthony

unread,
Aug 26, 2010, 7:53:54 AM8/26/10
to android-...@googlegroups.com
I don't think you need to specify the permissions when running in system_server.

Why are you passing this to native code?

To unsubscribe from this group, send email to android-platfo...@googlegroups.com.

user009

unread,
Aug 27, 2010, 4:24:13 AM8/27/10
to android-platform
Yeah I think you are right.
For services.jar/SystemServer.java is it 'shell' permissions ?

This is actually Data Sms.

Thanks
Aby
> > > >http://groups.google.com/group/android-platform?hl=en.-Hide quoted

Anthony

unread,
Aug 27, 2010, 9:09:24 AM8/27/10
to android-...@googlegroups.com
No, not quite. The system process runs as user 1000 but the shell runs as root.

http://androidguts.com/index.php/User_ids

To unsubscribe from this group, send email to android-platfo...@googlegroups.com.

Dianne Hackborn

unread,
Aug 27, 2010, 12:59:00 PM8/27/10
to android-...@googlegroups.com
In a user/usedebug build the shell does not run as root.

The system process runs as 1000, and that uid effectively does not need to request permissions because it is also the one that enforces them.  You should be very careful about what code you run as uid 1000, and be sure to do a careful security audit of such code.
--
Dianne Hackborn
Android framework engineer
hac...@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.

Reply all
Reply to author
Forward
0 new messages