问题
I currently have an Android application connecting to a device via USB OTG. The communication is done using the libusb 1.0.9 and it's working pretty well for other devices with api level < 21. (The communication must be native due to performance issues) When running the app under Android L, I get the following error from libusb_init(NULL):
type=1400 audit(0.0:107): avc: denied { read } for name="usb" dev="tmpfs" ino=24433 scontext=u:r:untrusted_app:s0 tcontext=u: object_r:usb_device:s0 tclass=dir
A/libc(12605): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 12605 (mapp.sdk.sample)
I'm compiling libusb 1.0.9 using latest NDK 10c on my Nexus 5. I don't think it's ART runtime issue as the app works on Android 4.4.4 with ART enabled instead of Dalvik. Anyone familiar with this issue? (this looks similar ) Can this be related to PIE?
Thank you.
回答1:
I uploaded a solution that works. it's based on libusb 1.0.9 and working with Lollipop.
https://github.com/Gritzman/libusb
来源:https://stackoverflow.com/questions/27111533/android-l-5-0-libusb-1-0-9-no-permissions