Android L | libusb_init returns LIBUSB_ERROR_OTHER (-99)

你离开我真会死。 提交于 2019-12-03 07:55:44

There is already a fix in this libusb fork:

https://github.com/martinmarinov/rtl_tcp_andro-

Now, not only you will need to pass the file descriptor, you will need to pass the device file path as well via UsbDevice.getDeviceName().

Looks like Android L have an additional restriction about accessing to /dev deirectory. I have no more ideas about this

Update

Security Enhancements in Android 5.0

...

Android sandbox reinforced with SELinux. Android now requires SELinux in enforcing mode for all domains. SELinux is a mandatory access control (MAC) system in the Linux kernel used to augment the existing [discretionary access control (DAC) security] model](http://en.wikipedia.org/wiki/Discretionary_access_control). This new layer provides additional protection against potential security vulnerabilities.

...

Workarounds

  1. Install SELinuxModeChanger and change SELinux mode to permissive
  2. https://github.com/Gritzman/libusb

There is a custom libusb 1.0 which is capable of solving this issue by doing LibusbInit by passing the path of the usb device , this can bypass readdir command http://www.libusb.org/ download from the home webpage itself.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!