我正在寻找有关以下内容的指导或明确答案。我想使用 Google Android USB Driver 并修改 android_winusb.inf
以支持任意数量的 Android 设备。我能够成功添加 HTC Evo 平板电脑,但是当我尝试添加 LG (Optimus) 或三星 (Indulge, Admire) 时,驱动程序似乎安装正常,但 ADB 看不到它。
您能否让 Google Android 驱动程序适用于任何 Android 手机?如果是……怎么办?
我已经尝试了 %SingleAdbInterface%
和 %CompositeAdbInterface%
的多种排列方式以及供应商和产品 ID 的变化。
最佳答案
您需要修改 3 件事才能使 Google USB 驱动程序适用于任何 Windows 上的任何 Android 手机:
- 将您的设备 ID 添加到
android_winusb.inf
文件 - 对修改后的驱动程序进行数字签名
- 将您设备的供应商 ID 添加到
adb_usb.ini
白名单(不再需要)
以下是详细信息:
1.将您的设备 ID 添加到 android_winusb.inf
文件
要添加的格式是:
;Comment usually the device name
%SingleAdbInterface% = USB_Install, USB\; here you put VID and PID
%CompositeAdbInterface% = USB_Install, USB\; same as above but add the MI
在我继续之前,VID
是 USB 供应商 ID。
如何获取 vid 和 pid :它们在您要合并的驱动程序中;但是如果你没有设备的驱动程序,你可以通过打开设备管理器来获取它;然后右键单击设备-选择属性-在新对话框中转到详细信息选项卡>在属性下拉菜单中选择硬件ID。例如,您会看到如下内容:
USB\VID_2207&PID_0000&REV_0222&MI_01
USB\VID_2207&PID_0000&MI_01
为复合 adb 设备取这个值,并为单个 adb 设备删除 MI,你得到
;MSI WindPad Enjoy 7 plus
%SingleAdbInterface% = USB_Install, USB\VID_2207&PID_0000
%CompositeAdbInterface% = USB_Install, USB\VID_2207&PID_0000&REV_0222&MI_01
;
复制这 2 行两次,一次复制到 [Google.NTx86] 部分,另一行复制到 [Google.NTamd64] 部分
为您想要支持的每台设备重复操作
现在是 [Strings] 部分的可选编辑:编辑
[Strings]
ProviderName = “Google, Inc.”
SingleAdbInterface = “Android ADB Interface”
CompositeAdbInterface = “Android Composite ADB Interface”
SingleBootLoaderInterface = “Android Bootloader Interface”
WinUSB_SvcDesc = “Android USB Driver”
DISK_NAME = “Android WinUsb installation disk”
ClassName = “Android Device”
收件人:
[Strings]
ProviderName = “Google, Inc.”
SingleAdbInterface = “MSI ADB Interface”
CompositeAdbInterface = “MSI Composite ADB Interface”
SingleBootLoaderInterface = “MSI Bootloader Interface”
WinUSB_SvcDesc = “MSI USB Driver”
DISK_NAME = “MSI WinUsb installation disk”
ClassName = “MSI Tablet”
<强>2。对修改后的驱动程序进行数字签名:
虽然原始的 google usb 驱动程序是由 google 签名的,但修改 android_winusb.inf 将阻止在 windows 8 上安装它并显示错误消息
The hash file is not present in the specified catalog file. The file is likely
corrupt or the victim of tampering.
这仅适用于 Windows 8。Windows 7 或更早版本不会显示此错误消息。您必须重新生成目录文件(可能使用 Windows SDK)并签名
解决方法:内部测试的解决方法是禁用 Windows 签名验证:临时或永久:
暂时:
到屏幕左上角或左下角打开魅力栏并点击设置魅力。
选择更改电脑设置
选择常规
向下滚动,然后单击“高级启动”下的“立即重新启动”。
点击“疑难解答”。 点击“高级选项” 单击“Windows 启动设置” 点击重启。
或
运行命令 并输入:
shutdown -o -r -t 0
然后在重新启动后从列表中选择“禁用驱动程序签名强制”。在重新启动之前安装驱动程序。
永久:
按窗口+Q
搜索 cmd
右键点击cmd
从操作栏中选择以管理员身份运行
输入命令:
bcdedit -set loadoptions DISABLE_INTEGRITY_CHECKS
bcdedit -set TESTSIGNING ON
3.将您设备的供应商 ID 添加到 adb_usb.ini
白名单(不再需要):
adb
曾经有一个硬编码的受支持供应商 ID 的白名单。如果您的设备供应商不在列表中 - adb
将完全忽略它。为了让 adb
识别此类设备,用户必须手动将他们的供应商 ID 添加到 %USERPROFILE%\.android\adb_usb.ini
- 每行一个 ID。
在命令行中:
echo 0x2207 >> "%USERPROFILE%\.android\adb_usb.ini"
幸运的是,Google 在最近的 adb
版本中删除了 VendorID 过滤。所以这一步不再需要了。
最后您可以通过以下方式测试安装:
adb kill-server
adb start-server
adb devices
并在安卓设备的开发者选项中启用调试
这应该会重新启动 ADB 服务器并列出设备。如果驱动程序工作正常,则应列出该设备。
关于android - Google Android USB 驱动程序和 ADB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9709263/