Hi Dianne ,
How can i add uses-permisson to an apk.If i need to acees /dev/mem using an
native interface.
I will put my problem in 2 steps.
1) I am trying to control I/O using an apk with the help of native
method(JNI).In my native method I am trying to open /dev/mem and mmaping
the i/o address.
But native code fails in opening /dev/mem. I have explicitly installed apk
in system/apk on a remounted file system.
2) If i run a linux executable on the same android machine it works.
So is there any way to run this apk as root by adding permission in
manifest file.I have tried changing permission for dev/mem in apk itself(no
success)
String command = String.format("chmod 777 /dev/mem");
try {
p = Runtime.getRuntime().exec(new String[] {"su", "-c",
command});
.............
Regards,
Govind
On Tuesday, February 23, 2010 1:39:06 AM UTC+5:30, Dianne Hackborn wrote:
>
> Sorry, no .apk can run as root. The android system is designed carefully
> to run very few things as root, and that is way lower level than an .apk.
> Not even the system process (hosting the package manager, activity
> manager, window manager, and various other essential system services) runs
> as root or can cause something else to run as root.
>
> Typically how device access is handled is by defining a uid that the
> device is a group of and a permission in permissions.xml mapping to that
> uid, so an .apk can use <uses-permission> to be included in that uid group.
>
> On Sun, Feb 21, 2010 at 10:09 PM, ksk <[email protected] <javascript:>>wrote:
>
>> Hi,
>>
>> I have an application(apk) which normally gets uid as
>> app_16. Internally it calls a Shared library, which tries to write to
>> HCI socket(bluetooth socket). Here the socket which is created has
>> bluetooth UID and GID. It is not allowing to write to that socket.
>>
>> Can any body give me suggestion what all permissions should be given
>> in manifest file to make it work. I have bluetooth and bluetooth admin
>> in Manifest file.
>>
>> or Any thing should be added to framework such that my apk and library
>> gets permissions to aceeses HCI socket.
>>
>> regards
>> KSK.
>>
>
>
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected] <javascript:>
>
> 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 Security Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/android-security-discuss.
For more options, visit https://groups.google.com/groups/opt_out.