[Desire HD Android Development] Yoshi_523:
---Update Jan 31st 2011---

I have now included my own backups of the original HBoot and Recovery images from a newly replaced (stock Vodafone) Desire HD. I have edited the guide to include these image files.

--The reason for this guide is that when I tried to restore my phone to it's original state for warranty purposes I found that each of the 4 or more threads or guides I read on XDA and elsewhere had parts missing, weren't complete and seemed to trail on with questions about how to actually get the whole job done (with no one clear answer). After finally getting it all to work I decided it may be a good idea to put everything together in 1 complete guide.--

This is a complete, no nonsense guide to restore your HTC Desire HD back to it's original state for warranty purposes. This guide is for restoring to Vodafone Australia stock ROM version 1.32.178.5. This guide also covers restoring the corresponding radio version 12.28b.60.140eU_26.03.02.26_M. To the best of my knowledge this this is the correct ROM & radio versions as shipped at the end of December 2010 by Vodafone. This guide will also complete the process of putting back radio s-on, eng s-on, original hboot and unroot. This guide is aimed to include everything so the beginner could do it, in that sense I apologise if there are too many unnecessary details for the rest of you, please skip through to the important parts. Please note all Unix commands (such as those after you type "adb") are case sensitive. Be sure to put the exact upper case and lower case for the the file names you have chosen. Be sure your phone battery is well charged. If you can, use a laptop with the battery in and running on AC power or a desktop PC with a UPS, this is just to reduce any chance of your computer or phone powering off during flashing. Lastly the normal disclaimer you see everywhere, that procedures here could brick your phone or brick your phone if not carried out correctly, basically this should all work like it did for me but I can't be held responsible if your phone is reduced to a paper weight.

INSTALL ANDROID SDK

Firstly you need to have the Android SDK installed. If you don't follow this link: http://developer.android.com/sdk/installing.html

Make sure to follow the section on installing optional components as you need to install the USB driver components once Android SDK is installed. If you don't have Java SDK installed, trying to install Android SDK will let you know it needs this before it will install. One issue I found here is with Windows 7 64-bit the Android SDK 2.3 version will not install on to Java SDK 64-bit version, so make sure you download and install the Java SDK that says for "Windows" and not the 64-bit version. It is also a good idea to install the HTC MySync software that comes straight from the HTC website for your phone, this has USB drivers too.

HAVE INSTALLED FULL ROOT ACCESS & HBOOT

(CLOCKWORK RECOVERY, CUSTOM HBOOT, ENG S-OFF & VISIONARY+)

Most of you will already have all this done. Just check this easy guide and make sure you have already done all of these steps from where is says Method 1 to the end of the page: http://whirlpool.net.au/wiki/desire_hd_installing_roms

I make reference back to this step later in the guide so you will need to do this again.

MAKE A BACKUP

Seeing as this procedure will wipe everything from your phone you may want to backup everything for one easy restore after phone warranty/replacement. To make a Nandroid backup enter bootloader (power off phone then whole holding volume down press power button once to power on). Select recovery then backup/recovery and start a backup. It will be saved under a folder clockworkmod/backup/xxxxxxxxx/ on your micro SD card. One you get your phone back from warranty you follow the same procedures to restore just make sure you complete the One click Radio S-Off as linked to below and also install the full root access and hboot as described above. For restoring the backup, once in the bootloader and Recovery again (I'd recommend choosing factory wipe in the bootloader) just choose restore and select the following folder from the backup you made above.

IF LOCKED OUT USING 1.72.405.3 THEN USE THE DOWNGRADE PROCEDURES

Now if you are using 1.72.405.3 (or higher) or a custom ROM based on 1.72.405.3 it is quite likely you from the added HTC security features in these ROMS you have lost root access, custom hboot or the ability to change radio back to s-on with stock CID. If this is the case then follow this downgrade first by jkoljo: http://xdaforums.com/showthread.php?t=905003

After the downgrade is complete make sure to remove file "PD98IMG.zip" from your micro sdcard and then follow the link above to carry out the full root procedures & hboot again.

INSTALL STOCK VODAFONE (AU) ROM

Follow this link to download Kazuroka's Vodafone Australia Stock Branded ROM 1.32.178.5: http://depositfiles.com/files/3x1c6v6hj

Create a folder on you micro SD card such as "stockrom" as follows: "/clockworkmod/backup/stockrom/" then copy the zip file there. Enter bootloader as described above. Choose recovery, then wipe/factory reset, choose backup/restore, then restore and select the zip file from the folder you just copied to your MicroSD card. After everything is done it will ask you to reboot. If so some reason when you select the option at the end to reboot and you just get a blank screen, wait for a while and be absolutely sure your phone your phone won't turn on then just remove and replace battery and then turn on.

CHECKING / INSTALLING STOCK RADIO

This stock ROM you just installed in the last step does not in my experience reload this stock radio. Here's how to check... At the home screen press menu, settings, About phone, Software Information and look under Baseband version to check which radio version you have installed. The stock radio that ships from Vodafone that matches this ROM is I believe 12.28b.60.140eU_26.03.02.26_M. If you have any other numbers here it means you have a different radio version installed than the one that came with the phone. I would suggest you follow this guide to install the stock radio version back if you have a different one installed. You will need to redo everything in the link above that was for titled installing full root access & hboot. Now download the stock radio file (thanks to Drakknar) from this link: http://www.multiupload.com/EUAUJCXGPN

Now if you've installed full root access & hboot as in the link above you will have a folder on your PC where you extracted fastboot. For me it is "C:\fastboot\". Open the radio zip file you just downloaded on your PC and copy the "radio.img" to the folder you have containing fastboot. Reboot phone into the bootloader as described above. Connect your phone via the USB cable to your PC. Make sure you've selected fastboot on your phone. It will display something like fastboot USB connection. On your PC open a the command prompt (Windows key + R to bring up the run box then type cmd and press ok). Go to the folder where fastboot is. For me without the "" marks I type:

"cd\fastboot"

then to install the radio I type:

"fastboot-windows flash radio radio.img"

This should all finish well then you can reboot your device and close command prompt. Sometimes flashing the radio can result in a line across the screen on the first time booting up but in my case it goes away the next time I restart the phone. Now once started up check in settings again to be sure you now have the the right radio version installed.

PUTTING BACK STOCK CID & RADIO S-ON

Reboot into the bootloader and check what it says under system info. If you have CID-11111111 it means you have super CID and radio s-off. You may have used jkoljo's One Click Radio S-Off to do this, no matter even if you haven't this is the easiest way restore it back also. Follow this link (thanks to jkoljo) for his One Click Radio S-Off: http://xdaforums.com/showthread.php?t=857537

In his 2nd post you will see the link to download "Easy Radio tool v2_2.zip". Connect phone to PC using USB cable. Select charge only on phone and also make sure USB debugging is selected in settings, apps. Extract the zip file to a folder on your PC somewhere. Run "Desire HD easy radio tool_V2_2". While running make sure phone does not sleep and the screen stays on as it will pop up with a superuser request you will need to select yes to. On the Desire HD Radio Tool select Stock CID then put in "VODAP021" without the "" marks. Making sure the first "O" is the

letter

and the second "0" is the

number zero

. Click Do it! and be sure it all finished without any error displayed. Next select Radio S-On and click Do it!. Close program and restart phone. Check system info in bootloader and you should now see CID-VODAP021.

PUTTING BACK STOCK HBOOT & ENG S-ON

--edit Thanks to dazweeja for pointing this out. I've been told replacing the hboot and the recovery image to stock have quite a risk of bricking your phone if anything goes wrong. I'd suggest extra caution making sure you type the commands correctly.--

Tell tale signs your phone is modded are ENG S-OFF on the top line of entering the bootloader and also when you click on recovery it goes though to another list saying Clockwork Recovery. You will also want to remove root (superuser access) during this proccess. Now to remove root you can either run Visionary+ and select Unroot Now or what I did is just redo the step above that was to flash Kazuroka's Vodafone Stock ROM. After reflashing you only need to install a file browser from the market such as Astro or Androzip and then use it to install Visionary+ from you micro SD card. The only option you need to select in Visionary+ is Temproot now. This means root access will be gone after reboot. Now to remove Eng S-Off and put back the stock hboot & recovery image. Download my backup of the original recovery image from here: http://xdaforums.com/attachment.php?attachmentid=504042&stc=1&d=1296394732

Also download my backup of the original HBoot from here: http://xdaforums.com/attachment.php?attachmentid=504041&stc=1&d=1296394732

Extract the two zip files "Original_VHA_HBoot.zip" and "Original_VHA_Recovery_Image.zip" and you will get "recovery_orig0.bin" and "hboot_orig0.bin". Connect your USB cable to your phone and select "Disk drive, Mount as disk drive" and select "Done". The MicroSD card will now pop up as a drive in Windows. Copy the two files "recovery_orig0.bin" and "hboot_orig0.bin" to the new drive that popped up which is your MicroSD card on your phone. Make sure you copy these two files to the root folder of your MicroSD card (root folder means the base not a folder named "root"). After copying these two files, then on your phone, pull down the status menu sliding your finger from the top down. It should say "Ongoing" and underneath Select "Disk drive" now choose "Charge only" then select "Done" and make sure USB Debugging is on (in Menu, Settings, Applications, Development, USB debugging). On your computer open a command prompt and go to the "platform-tools" folder of your Android SDK installation. For me its:

"cd\program files (x86)\android\android-sdk-windows\platform-tools\"

then type

"adb shell"

"su" (if you get permission denied, you have to do run Visionary+ and select temproot now)

"busybox dd if=/sdcard/recovery_orig0.bin of=/dev/block/mmcblk0p21"

"busybox dd if=/sdcard/hboot_orig0.bin of=/dev/block/mmcblk0p18"

"sync" (wait 10 seconds then after that, you can close the command prompt)

Power off phone and then re-enter bootloader. If everything worked you will now see:

ACE PVT SHIP S-ON

HBOOT-0.85.0007

Also you'll notice that System Info is gone and also if you do select RECOVERY it will no longer go to Clockwork Recovery list but instead to a screen showing a picture of a phone with a red exclamation mark. Selecting Recovery means you'll need to pull the battery to reboot your phone. If you don't want to pull the battery, don't select RECOVERY but instead select FASTBOOT then POWER DOWN.

REMOVE VISIONARY+ (AND OTHER APPS) AS WELL AS CHECK FOR UNROOT

As described in the last section to check your device is unrooted... Make sure you've rebooted since you last did a temproot in Visionary+. Open a command prompt and go to the "platform-tools" folder of the Android SDK. Make sure phone is connected to PC with charge only and USB Debugging. Type:

"adb shell"

"su"

If you get permission denied then all good, your phone is unrooted, you can close command prompt. At the home screen go into apps then hit the menu button and select remove app. You will see a list of apps on the left tab that are downloaded apps. For me the apps I uninstalled were Visionary+, Superuser, and Androzip. Choose clear data, force stop, and uninstall for each app. Now depending on if you are going to keep your MicroSD card or send it in with the phone for warranty, will depend on if you need to to backup and wipe the MicroSD card. If you do need to send it in, connect the phone to your PC with the USB cable and select Disk drive Mount as disk drive and done. In windows you'll need to make sure you can see hidden files & folders. In Windows 7 open explorer (Windows Button + E) then select Organise, Folder and search options and select the View tab. Make sure you have selected Show hidden files, folders, and drives. Make a folder on your hard drive such as "phonecard backup". Go to your phone memory card for example "removable disk f:" or whatever the drive letter may be, select everything (ctrl + A) and then holding ctrl drag and drop everything into the "phonecard backup" folder on your hard drive. Once finished In Windows right click the taskbar icon and select eject removable disk. On your phone, remove the usb cable. Under settings, SD & phone storage, select Unmount SD card, then select Format SD card, Erase everything. The other optional thing you can do is a factory reset. On talking to HTC regarding warranty or repairs they asked if I'd done a factory reset. They also said this was the first thing they would do to try and resolve my issue. I figure it's a good step to do and you can tell them you've done a factory reset without it resolving your issue. In the same menu, SD & phone storage, select Factory data reset, reset phone, erase everything.

DONE! YOUR PHONE SHOULD NOW BE BACK TO STOCK & READY TO TAKE BACK FOR WARRANTY IF NEEDED!

--Note I have put together this guide from the works of a number of XDA members. Full credit for all the files, guides, tools (and help) I used here go to, jkoljo, sfjuocekr, Drakknar, Kazuroka, dazweeja, OzJD and leith51. Thank you--