How to use USB API with any USB device?

我们两清 提交于 2019-12-13 06:49:11

问题


I've created an app that uses the USB API to open a new tab when the USB device is connected.

But now I want to improve it a bit. Before, when I use USB API I must define its vendorID and productID in the manifest. It means my app only use exactly one USB device.

Now I want any USB to interact with my app. Anybody can give me an idea to do it?


回答1:


I do believe it's impossible for security reasons. You can specify more than one PID/VID pair, but you cannot ask for arbitrary ones.

The stated reason for this is to prevent apps from fingerprinting hardware by enumerating all connected USB devices, which has a good chance to be a unique set.



来源:https://stackoverflow.com/questions/24137321/how-to-use-usb-api-with-any-usb-device

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