5

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.

Community
  • 1
  • 1
MichaelR
  • 83
  • 6
  • "I think it's ART" -- should it be "I **don't** think it's ART..."? – 323go Nov 24 '14 at 18:34
  • Looks like selinux is denying you. – Dan Albert Nov 24 '14 at 21:50
  • Thanks Dan. Installing "SELinuxModeChanger" on my nexus 5 and changing the SELinux mode to Permissive seems to fix the problem. The question is how to make my app work under the default Enforcing mode. – MichaelR Nov 25 '14 at 10:33
  • possible duplicate of [Android L | libusb\_init returns LIBUSB\_ERROR\_OTHER (-99)](http://stackoverflow.com/questions/25662307/android-l-libusb-init-returns-libusb-error-other-99) – CAMOBAP Dec 05 '14 at 07:39

1 Answers1

0

I uploaded a solution that works. it's based on libusb 1.0.9 and working with Lollipop.

https://github.com/Gritzman/libusb

Nork
  • 46
  • 3