如何在任何USB设备上使用USB API? [英] How to use USB API with any USB device?
问题描述
我已经创建了一个应用程序,它可以在USB设备连接时使用USB API打开一个新标签。
但现在我想改进一下。之前,当我使用USB API时,我必须在清单中定义它的 vendorID
和 productID
。这意味着我的应用程序只能使用一个USB设备。
现在我想让任何USB与我的应用程序进行交互。任何人都可以给我一个想法吗?
我相信这是不可能出于安全原因。您可以指定多个PID / VID对,但不能要求任意的PID / VID对。 陈述理由,以防止应用程序来自指纹识别硬件,方法是枚举所有连接的USB设备,这很有可能是唯一的设备。
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?
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.
这篇关于如何在任何USB设备上使用USB API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!