For those who CANNOT root: It seems to be a driver problem

blazercist

New Member
Joined
Jun 21, 2010
Messages
10
Reaction score
0
Like the title says I think this is a driver issue.

I've been beating my head against the wall trying to get my phone recognized by adb in recovery mode with little success.

What I've learned:

My droid incredible has a Hardware Id matching the hack:
;HTC Incredible
%SingleAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C9E
%CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C9E&MI_01
%SingleBootLoaderInterface% = USB_Install, USB\VID_0BB4&PID_0C94

I can issue "adb devices" at the command prompt and my phone is listed.

This is only in the normal OS, however in recovery mode the Hardware Id changes to:

;HTC Incredible
%SingleAdbInterface% = USB_Install, USB\VID_0BB4&PID_0FF9
%CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0FF9&REV_0100
%SingleBootLoaderInterface% = USB_Install, USB\VID_0BB4&PID_0FF9

If I add the above to the .inf file I can successfully install the driver when the phone is in recovery mode, otherwise Windows complains that it hasn't found a driver for my device. (I had to change the permissions of USBSTOR.SYS so that none of the users had read permissions - this made it so that the USB Mass Storage driver wouldn't auto install and I could manually select the android_winusb.inf driver)

However, after installing the driver this way "adb devices" will not recognize my phone in recovery mode. Don't let this confuse you!!! Windows recognizes the phone as "Android ADB Composite Interface", but "adb devices" list is empty. I believe this is the major problem with the "device not found" error never changing.

This is where my understanding of drivers ends, but to me it seems that perhaps something isn't lined up quite correctly for some of us as far as the driver Hardware Id and the adb tool.

If any of the devs or someone with a greater knowledge of the driver architecture/adb tool care to comment on this to clear it up I'd greatly appreciate it.
 
OP
B

blazercist

New Member
Joined
Jun 21, 2010
Messages
10
Reaction score
0
Nevermind, now I understand what going on...

The phone is not supposed to be recognized because adb is not supposed to be running in recovery at the time when the phone is recognizable by the driver, hence the race. We are booting into recovery and praying that adb starts while the phone is in recovery and keeps running until we can communicate with it via the driver(I think?) Soooo, the question really is what causes adb to run in recovery because it seems that using the SD trick we can reliably cause it to run long enough to get in.

Now I'm still stuck, I don't understand why some people can get it to run adb in recovery almost every time while I cannot and have not ever gotten it to run adb in recovery mode.

Oh well, I'm sure the devs will come up with some way to force it eventually so I'll just stop posting and be patient.
 
OP
B

blazercist

New Member
Joined
Jun 21, 2010
Messages
10
Reaction score
0
Ok, right after I posted I thought about it a bit and realized what might cause adb to run in recovery and IT WORKED!

My guess is that if you run adb shell in the normal OS it creates a lockfile so that multiple instances can't run, if you then pull the battery while adb shell in running the lockfile will remain on the filesystem.

After that you put the battery back in and boot into recovery, after trying this it worked on the first try for me.

Finally after over a week of trying I have su!
 
OP
B

blazercist

New Member
Joined
Jun 21, 2010
Messages
10
Reaction score
0
@ mclarryjr: What exactly didn't work? Let me lay out the process for you. Please read through once as the process is a little confusing.

1. Uninstall HTC Sync and HTC Driver Installer.
2. Add both:
;HTC Incredible
%SingleAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C9E
%CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C9E&MI_01
%SingleBootLoaderInterface% = USB_Install, USB\VID_0BB4&PID_0C94

and

;HTC Incredible
%SingleAdbInterface% = USB_Install, USB\VID_0BB4&PID_0FF9
%CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0FF9&REV_0100
%SingleBootLoaderInterface% = USB_Install, USB\VID_0BB4&PID_0FF9

to android_winusb.inf under [Google.NTx86] and [Google.NTamd64]

3. Change the permissions of C:/Windows/System32/drivers/USBSTOR.SYS make sure that none of your users have any permissions to read it.
4. Boot your Incredible into recovery mode (with the triangle !)
5. You should see an error installing the device, go into Device Manager and Update Driver, choose the android_winusb.inf file (ignore all the warnings and install anyway)

6. Now reboot your phone into its normal mode.
7. Once the phone is booted and ready to go, use the command prompt and issue "adb shell" you should see $ and a blinking cursor (I issued a few commands like ls, cat file, mkdir, most of which were met with error permission denied)
8. Now with your phone still in the regular OS and adb shell still running and connected pull the battery.
9. Reinsert the battery and run loop.bat at the command prompt.
10. Hold volume down/power to boot into recovery.
11. The SD card errors out.
12. Click out your SD card.
13. Press volume down and then power.
14. Once the white HTC Incredible screen shows you should look at it very carefully for a black line or a blink, immediately upon seeing this you must click your SD card back in.
15. You should get the directory error within 15-20 seconds.
 

glowskull03

New Member
Joined
May 12, 2010
Messages
4
Reaction score
0
@ mclarryjr: What exactly didn't work? Let me lay out the process for you. Please read through once as the process is a little confusing.

1. Uninstall HTC Sync and HTC Driver Installer.
2. Add both:
;HTC Incredible
%SingleAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C9E
%CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C9E&MI_01
%SingleBootLoaderInterface% = USB_Install, USB\VID_0BB4&PID_0C94

and

;HTC Incredible
%SingleAdbInterface% = USB_Install, USB\VID_0BB4&PID_0FF9
%CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0FF9&REV_0100
%SingleBootLoaderInterface% = USB_Install, USB\VID_0BB4&PID_0FF9

to android_winusb.inf under [Google.NTx86] and [Google.NTamd64]

3. Change the permissions of C:/Windows/System32/drivers/USBSTOR.SYS make sure that none of your users have any permissions to read it.
4. Boot your Incredible into recovery mode (with the triangle !)
5. You should see an error installing the device, go into Device Manager and Update Driver, choose the android_winusb.inf file (ignore all the warnings and install anyway)

6. Now reboot your phone into its normal mode.
7. Once the phone is booted and ready to go, use the command prompt and issue "adb shell" you should see $ and a blinking cursor (I issued a few commands like ls, cat file, mkdir, most of which were met with error permission denied)
8. Now with your phone still in the regular OS and adb shell still running and connected pull the battery.
9. Reinsert the battery and run loop.bat at the command prompt.
10. Hold volume down/power to boot into recovery.
11. The SD card errors out.
12. Click out your SD card.
13. Press volume down and then power.
14. Once the white HTC Incredible screen shows you should look at it very carefully for a black line or a blink, immediately upon seeing this you must click your SD card back in.
15. You should get the directory error within 15-20 seconds.


I don't know if i'm missing something here...

1. I uninstalled the htc drivers and sync and added the 2 entries to android_winusb.inf.
2. I'm not sure about the USBSTOR.SYS I don't see where I can remove permissions even for myself I'm the only user on my machine.
3. I reboot my phone into recovery mode and then plug in my phone, I get the installing driver message and i go through and update the driver with the android_winusb.inf file.
4. I then reboot my phone to normal mode and when it comes backup i can't see the "Android Phone" in device manager unless I change the setting on my phone to "HTC Sync" is that correct? At which point it appears in device manager as Android Phone -> Android Composite ADB interface
5. Next I go to the command prompt and type "adb shell" but still the get the good ol error "error: device not found"

Please help I've at this for days trying several different methods flying around in different sites.
 
OP
B

blazercist

New Member
Joined
Jun 21, 2010
Messages
10
Reaction score
0
I should have clarified, you don't need to put your phone into HTC Sync mode only USB debugging has to be enabled.

In order to change the permissions of USBSTOR.SYS you need to take ownership of the file, there are other users on your machine, the SYSTEM user and Trusted Installer. This part is a windows issue and there are plenty of guides that tell you how to take ownership of system files.

Also, if you can't adb shell into a phone in its normal state then you don't have the driver installed... as I stated the phone has two different Hardware Ids so just because you installed the driver correctly while the phone was in Recovery Mode doesn't mean the driver is installed properly for the normal mode. Hint: its the same driver so just go through the Update driver thing again while the phone is in normal mode.
 

glowskull03

New Member
Joined
May 12, 2010
Messages
4
Reaction score
0
Thanks for the pointers but still no luck. I finally got the drivers installed properly and I'm now able to get the adb shell when in regular mode. After i reboot to recovery mode I keep failing to get the all wonderful error I'm looking for I just keep getting "error: device not found"
 

Phonegeek

New Member
Joined
Apr 30, 2010
Messages
19
Reaction score
0
to android_winusb.inf under [Google.NTx86] and [Google.NTamd64]

Where do I find this file?
 

glowskull03

New Member
Joined
May 12, 2010
Messages
4
Reaction score
0
@phonegeek - you need to download the android sdk. once you download it run the executable, the window that pops up scroll all the way down the list and select usb 3.0 and install it. It will create a directory in the sdk folder usb_driver which contains that file
 

Phonegeek

New Member
Joined
Apr 30, 2010
Messages
19
Reaction score
0
When I run the sdk file it just errors out. I don't get a list of options. I used the one from the 10 minute root video and I downlowded one form adroid developers and it does the same thing. Do I need to have the phone pluged in first. What am I doing wronge.
 
Last edited:

sdorn

Member
Joined
Feb 19, 2010
Messages
49
Reaction score
0
When I run the sdk file it just errors out. I don't get a list of options. I used the one from the 10 minute root video and I downlowded one form adroid developers and it does the same thing. Do I need to have the phone pluged in first. What am I doing wronge.

You should download the usb driver from the unrevoked reflash wiki. Go over to xda developers and follow the link in the thread for the reflash tool. They have a specially modified usb driver you should be using.

Here is the link to the usb driver wiki.

http://www.unrevoked.com/rootwiki/doku.php?id=public:windows_hboot_driver_install
 

jerrberr

New Member
Joined
Jun 25, 2010
Messages
1
Reaction score
0
I'm on Win7 and have a 2gb PNY microsd.
What finally worked for me after 2 weeks:
1. Download the android SDK usb drivers
2. Add:
;HTC Incredible
%SingleAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C9E
%CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C9E&MI_01
%SingleBootLoaderInterface% = USB_Install, USB\VID_0BB4&PID_0C94
;HTC Incredible
%SingleAdbInterface% = USB_Install, USB\VID_0BB4&PID_0FF9
%CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0FF9&REV_0100
%SingleBootLoaderInterface% = USB_Install, USB\VID_0BB4&PID_0FF9

to android_winusb.inf under [Google.NTx86] and [Google.NTamd64]

3. Change the permissions of C:/Windows/System32/drivers/USBSTOR.SYS make sure that none of your users have any permissions to read it. I added a right-click menu option using the following registry entry in order to take take ownership of the USBSTOR.SYS system file:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\runas]
@="Take Ownership"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\*\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"

[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Take Ownership"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"

4. Back up then delete usbstor.inf and usbstor.PNF and from C:\Windows\inf
5. Make sure that the phone is plugged in so that it shows in Device Manager.
6. Uninstall HTC Sync and HTC Driver Installer if you haven't already - reboot Windows 7 - you should be prompted - before you reboot or while rebooting windows, unplug phone from USB
7. Remove Android Composite ADB Interface Driver from Device Manager if you haven't already - reboot Windows 7 - you should be prompted - before you reboot or while rebooting windows, unplug phone from USB
8. Shut down phone and reboot into recovery mode (with the triangle !)
9. Plug phone into usb.
10. You should see an error installing the device, go into Device Manager and Update Driver, choose the android_winusb.inf file (ignore all the warnings and install anyway)
11. After the drivers installed, I ran adb shell in loop mode from the cmd prompt. I got the deamon not running - starting daemon - daemon started successfully messages. I got the magic error message immediately - no removing sd card or other fiddling required!

I haven't tried duplicating this yet, so this may be a fluke one time thing. I also haven't tried any other method for getting adb in recovery since this - going to root now!


FLUKE! ONE! TIME! THING! cannot duplicate. Also, my superuser.apk didn't install correctly, so I can't use titanium backup - which is what I wanted in the first place. I can't write to read-only system! I can't uninstall Superuser Permissions!

Also, now Windows installs the phone internal memory and sdcard as generic disk drives or as HTC Android Phone USB Device under Disk drives in Device manager - It no longer errors out on driver installation. UGH!
 
Last edited:

glowskull03

New Member
Joined
May 12, 2010
Messages
4
Reaction score
0
Not sure if this will make a difference but is there a need to uninstall the adb interface driver? When in regular mode with debugging enabled i can access adb shell and under device manager under "Android Phone" I can see "Android Composite ADB Interface". When I reboot the phone into recovery mode should I still be able to see the device under device manager? Because currently when I reboot into recovery I cant see my phone in device manager until i reboot into normal mode.
 
Top