android app permission for /dev

927 views
Skip to first unread message

jo

unread,
Nov 19, 2013, 4:39:33 PM11/19/13
to andro...@googlegroups.com
Hi,

I am a newbie, in Android-ndk

I Developed a Linux devices driver which create a node call /dev/driver.
Libdriver.so is its shared library found in /system/lib/libdriver.so

In order to use my driver since user interface, I also developed a jni interface call lib_jni_drv.so (/system/lib/lib_jni_drv.so)

My big problem is the fact that my app do not have read/write permission acces to open /dev/driver through libdriver.so

logcat :
E/Trace(1257): error opening trace file: Permission denied (13)

I load my app since eclipse for Android.

I add these line in my manifest.xml
<uses-permission android:name="android.permission.ACCESS_SUPERUSER"></uses-permission> 

and  change the permission of /dev/driver libdriver.so et lib_jni_drv.so
chmod 777 /dev/driver

without any improvement.

Do you have any suggestions?

 Thanks by advance
 

Baodong Chen

unread,
Nov 19, 2013, 8:42:23 PM11/19/13
to andro...@googlegroups.com
you should modify ueventd.XXX.rc and add a line like this:
/dev/driver             0666   system      system

"0666" is permission and "system" is user and group

and recreate the image.
the file is located in device/vendor/product/ directory


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/groups/opt_out.

jo

unread,
Nov 20, 2013, 10:07:28 AM11/20/13
to andro...@googlegroups.com
I changed file ueventd.am335xevm.rc because I am working on the beaglebone black, but I still have the same error.

1 - What  should I put in my manifest.xml file, for the permission?


I didnt find anything related to read/write acces to /dev ?

2- Is there a tutorial, book, pdf, website which explain what you have to do, when you create a Linux driver, and try to use it since an Android app?

"Embedded Android" wrote by karim yaghmour explain Android architecture, but doesn't deal with link between Java app and HAL...

Thanks!

Baodong Chen

unread,
Nov 21, 2013, 6:45:50 AM11/21/13
to andro...@googlegroups.com
On Wed, Nov 20, 2013 at 11:07 PM, jo <geli...@gmail.com> wrote:
I changed file ueventd.am335xevm.rc because I am working on the beaglebone black, but I still have the same error.

1 - What  should I put in my manifest.xml file, for the permission?


I didnt find anything related to read/write acces to /dev ?
android file system permission follows standard linux permission scheme, that is owner/group/other,your app would have a specific user id when installed.
you should check permission of the device file with command "ls -l /dev/driver" to see whether your change to ueventd.am335xevm.rc has taken effect.
Reply all
Reply to author
Forward
0 new messages