Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Android USB Driver and ADB

I am looking for guidance or a definitive answer on the following. I want to use the Google Android USB Driver and modify the android_winusb.inf to support any number of Android devices. I was able to add an HTC Evo tablet successfully, but when I try to add LG (Optimus) or Samsung (Indulge, Admire) the driver seems to install fine, but ADB does not see it.

Can you make the Google Android Driver work for any Android phone? If so... how?

I have tried many permutations of %SingleAdbInterface% and %CompositeAdbInterface% with the variations of Vendor and Product ids.

like image 975
pqu3 Avatar asked Mar 14 '12 19:03

pqu3


People also ask

What is ADB driver for Android?

Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device.

How do I download ADB drivers on Android?

Locate and expand Android Phone in the right pane. Right-click on Android Composite ADB Interface and select Update Driver. This will launch the Hardware Update Wizard. Select Install from a list or specific location and click Next.

How do I download ADB drivers?

Press the "Have Disk" button. Select "Android ADB Interface" from the list of device types. Confirm the installation of the driver by pressing "Yes". Confirm the installation again by pressing "Install".


2 Answers

You need to modify 3 things in order to make Google USB driver work for any android phone on any Windows:

  1. Add your device's ID to android_winusb.inf file
  2. Digitally sign the modified driver
  3. Add your device's vendor ID to adb_usb.ini whitelist (no longer required)

and here are the details:

1. Add your device's ID to android_winusb.inf file

the format to add is:

;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 

before I go on, VID is the USB Vendor ID.

How to get the vid and pid : they are in drivers you are merging; but if you don’t have a driver for the device you can get it by opening device manager; then right-click the device – select properties-in new dialog go to Details tab >in property drop menu select hardware ids. for example you see something like:

hid

USB\VID_2207&PID_0000&REV_0222&MI_01 USB\VID_2207&PID_0000&MI_01 

take this value for composite adb device and remove MI for single adb device, you get

;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 ; 

copy this 2 line TWICE , once to [Google.NTx86] section and another to [Google.NTamd64] section

REPEAT for every device you want to support

Now an optional edit for [Strings] Section: edit

[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” 

To:

[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. Digitally sign the modified driver:

Although the original google usb driver was signed by google , modifying android_winusb.inf will prevent installing it on windows 8 showning an error message hasherror

The hash file is not present in the specified catalog file. The file is likely corrupt    or the    victim of tampering. 

This is only in Windows 8. Windows 7 or earlier do not show this error message. You have to regenerate catalog file (probably with Windows SDK) and sign

Workaround: A workaround for internal tesing is to diable windows signature verification : either temporarily or permanently:

temporarily:

Go to left upper or lower corner of screen to open charms bar and click settings charm.

choose Change PC settings

choose General

Scroll down, and click ‘Restart now’ under ‘Advanced startup’.

Click ‘Troubleshoot’. Click ‘Advanced Options’ Click ‘Windows Startup Settings’ Click Restart.

or

run cmd and type:

shutdown -o -r -t 0 

then after restarting choose ‘Disable driver signature enforcement‘ from the list . install your driver before restarting.

Permanently:

press Window+Q

search for cmd

right click cmd

choose run as administrator from action bar

type in cmd:

bcdedit -set loadoptions DISABLE_INTEGRITY_CHECKS bcdedit -set TESTSIGNING ON 

3. Add your device's vendor ID to adb_usb.ini whitelist (no longer required):

adb used to have a hard-coded whitelist of supported Vendor IDs. If your device's vendor was not on the list - the adb was ignoring it completely. To make adb recognize such devices users had to manually add their vendor IDs to %USERPROFILE%\.android\adb_usb.ini - one ID per line.

in the command line:

echo 0x2207 >> "%USERPROFILE%\.android\adb_usb.ini" 

Fortunately, Google has removed the VendorID filtering in more recent adb versions. So this step is no longer required.

Finally you can test installation by :

adb kill-server adb start-server adb devices 

and enabling debugging in developer options on android device

This should restart ADB Server and list devices. If driver is working ok, the device should be listed.

like image 172
Muhammad Annaqeeb Avatar answered Oct 06 '22 21:10

Muhammad Annaqeeb


Locate the following file

C:\Users\[your name]\.android\adb_usb.ini

And make the following changes:

# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT. # USE 'android update adb' TO GENERATE. # 1 USB VENDOR ID PER LINE. 0x2207 

I added 0x2207 to the file. This number is part of the hardware id, which can be found under the device's hardware information.

Mine was:

USB\VID_2207&PID_0010&MI_01

(I tried executing android update adb, but it did nothing.)

like image 22
user1450232 Avatar answered Oct 06 '22 22:10

user1450232