hey all,
i am developing an Application that uses libusb via jni.
this application is currently targeted only to rooted, usb-host
Android 3+ machines.
the scenario is as follows:
<java Activity>
loads <jni_wrapper.so>
which wraps <my_main_lib.so>
that uses <libusb.so>
that needs rw access to: /dev/bus/usb/<device>
all the .so native libraries are part of an infrastructure that i
install (as root) on /system/lib,
which then can be used by java Activities, run by the simple users.
that means that the whole usb communication must be done from the
native side.
i got everything to work fine, except for one issue - the usb
permissions:
the default permissions of /dev/bus/usb/ entries are (0660, uid= root,
gid= usb).
obviously, a standard java process running a native code does not meet
any of the above requirements,
forcing me to "chmod 666" the corresponding /dev entry, to get this
working.
this solution is not so good, though, because it does not survive
reboot, or unplugging/replugging of the device (permissions go back to
0660).
the solution i'm looking for needs to:
- survive reboot/replugging
- be installed ~once~ by the root, and not involve bothering the user
every time to gain permissions
- be generic and run on all (/most) android 3+ machines
- [not mandatory] gives the minimal credentials necessary
directions i thought of:
- is there something like udev rules on linux?
- changing the default permissions the usb devices get upon plugging?
- making my process join the "usb" group?
any ideas? :-)
thanks!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en