我目前有一个 Android 应用程序通过 USB OTG 连接到设备。 通信是使用 libusb 1.0.9 完成的,它在 api 级别 < 21 的其他设备上工作得很好。 (由于性能问题,通信必须是本地的) 在 Android L 下运行应用程序时,我从 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)
我正在 Nexus 5 上使用最新的 NDK 10c 编译 libusb 1.0.9。 我不认为这是 ART 运行时问题,因为该应用程序在启用 ART 而不是 Dalvik 的 Android 4.4.4 上运行。 有人熟悉这个问题吗? (this 看起来很相似) 这和 PIE 有关系吗?
谢谢。
最佳答案
我上传了一个有效的解决方案。 它基于 libusb 1.0.9 并使用 Lollipop。
关于java - Android L 5.0 和 libusb 1.0.9 - 没有权限?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27111533/