Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
xraystyle
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 13
Join Date: Jul 2010
Default How To: Get back to stock 2.1, stock recovery and S-ON for an RMA

The other day my phone's touchscreen developed a dead spot. Verizon was kind enough to send me a "Like-New" replacement and requested that I return the old phone. The only problem with that was I had hacked the hell out of it and didn't want them to see what I did and charge me.

I had rooted the phone, installed Clockwork Recovery, set S-OFF with Unrevoked Forever, updated to the latest radio and installed all kinds of different ROMs before finally settling on CM6. Now I had to find a way to install either stock 2.1 or stock 2.2 with the correct radio for either one, flash back the stock recovery, and finally set the phone back to S-ON. If you find yourself in a similar situation, you'll probably want to read this instead of spending 6 hours pulling your hair out, like I did. Here's what I finally came up with:

STEP 1: Get ADB Running.
Make sure you have ADB up and running. If you're rooted with a custom ROM and you don't have ADB running you have more problems than I can help you with. If you use a Mac, see Step 1A below to make things a little easier when using ADB.

Step 1A: (Mac Users Only) Make Your Life Easier.
Let's add the android SDK tools folder to your .bash_profile. What does this do, you ask? It makes it so that you can run any ADB commands without having to be in your SDK Tools directory. How do we do this?

Open a terminal window. Type
Code:
nano ~/.bash_profile
This will open a text editor in the terminal and create a new text file in your home directory called .bash_profile, which will be invisible in the Finder.

Enter the following:
Code:
PATH=$PATH:/Applications/Utilities/android-sdk-mac_86/tools
export PATH
!!IMPORTANT!! I have my "android-sdk-mac_86/tools" folder inside my "Utilities" folder, which is inside the "Applications" folder. If you have your android sdk folder somewhere else you will have to change the above text to reflect the proper path to your folder.

Hit ctrl-x. Not cmd-x, ctrl-x.
The editor will ask you if you want to save changes. Press "Y".
It will ask you what you want the file name to be. Just press enter, as we've already named it .bash_profile.
Quit and re-open terminal.
You can now use any command in the SDK tools folder from any directory.

STEP 2: Install Fastboot.
Make sure you have the HTC Fastboot tool installed. If you don't, you can get it here: http://developer.htc.com/adp.html
Download it for your particular operating system.
Another tip for Mac users: Once you download and unzip it, rename it from "fastboot-mac" to just "fastboot", then place it in your SDK Tools directory.

STEP 3: Downgrade To 2.1 With Old Radio.
We now need to downgrade our radio and get back to stock 2.1. The best way I found to do this was explained in this thread: http://forum.xda-developers.com/showthread.php?t=757927
Download the zip and follow the instructions.
Hat tip to Berzerker7 for the write-up, and aiccucs for putting together the zip file in that thread.
The next step will be a little bit of backtracking, but it's mostly painless, and it still seems to be the easiest way to do this.

STEP 4: Set NAND To S-ON.
We now need to set the NAND to S-ON. Problem is, in step 3 we flashed the stock recovery back onto the phone. Not a huge issue.
First, go to unrevoked.com and download unrevoked3. Run it. This will re-root the phone and install Clockwork recovery. Once this is done, go here: http://unrevoked.com/rootwiki/doku.php/public/forever and download the unrevoked-forever S-ON Tool.
Copy this file to your SD card and rename it "update.zip"
You can do that with adb like this:
Code:
adb push /path/to/unrevoked-forever-son.zip /sdcard/update.zip
Reboot into recovery and use Clockwork to apply the patch, which will set the NAND back to S-ON.

STEP 5: Get The Phone To Accept Stock Recovery With S-ON
This was the biggest problem that I ran into. The phone would regurgitate every zip I found which contained a stock recovery when the phone was set S-ON. I finally found a way around that.

First, download this PB31IMG.zip file: http://d01.megashares.com/index.php?d01=CHoQD3B
This IMG file was posted by Diego Mejia, on a youtube video he uploaded. Thanks to Diego, his work was very helpful in this process.

Here's the catch: in order to apply this PB31IMG.zip, we need to downgrade HBOOT or we'll get an error, due to the fact that we had set S-ON in the previous step.

Here is a link to a post on androidforums.com with an attached zip file called "revert.zip": http://androidforums.com/incredible-...ion-hboot.html
Credit is due to adrynalyne for coming up with this process and posting the files, I just tweaked his instructions a bit to make them work for me.

Once the "revert.zip" file has been downloaded, follow adrynalyne's instructions on what to do with the files. Reposted below:
Quote:
Boot the phone into Clockwork Recovery.
Go to partitions, and mount data.
Type the following commands in a terminal window:
Code:
adb push flash_image /data
adb push mtd0.img /data
adb shell
chmod 777 /data/flash_image
cd /data
flash_image misc mtd0.img
exit
adb reboot oem-78
Watch for your phone to reboot to a silver HTC logo.

Then type:
Code:
fastboot devices
Verify your device shows up/responds/etc.
If the "fastboot" command works you should see an "H" followed by a string of random numbers and letters. So far, so good.

STEP 6: Reapply Stock 2.1 With Stock Recovery.
Once you've run the "fastboot" command successfully, go ahead and pull the battery. Leave the phone off. Go back to the PB31IMG.zip you downloaded in step 5, and copy it to the root of your SD card. Put the SD card back in the phone and boot it into recovery. If you've done all this correctly, the phone should recognize the PB31IMG.zip as valid and ask if you want to apply it. Do so. This will reflash the stock 2.1 ROM with the stock recovery while the phone is set S-ON. You can now send your phone back to Verizon.

STEP 7: Profit.

--B
 
xraystyle
Old
#2  
Junior Member - OP
Thanks Meter 0
Posts: 13
Join Date: Jul 2010
Hey Mods, any chance of a sticky?

--B
 
Berzerker7
Old
#3  
Senior Member
Thanks Meter 153
Posts: 621
Join Date: Jan 2010
There's a much easier/faster way to do this:

Just S-ON before you downgrade a first time, and then flash_image misc right away. The PB31IMG will take and you'll be at 2.1 with a single RUU flash.
 
xraystyle
Old
#4  
Junior Member - OP
Thanks Meter 0
Posts: 13
Join Date: Jul 2010
Quote:
Originally Posted by Berzerker7 View Post
There's a much easier/faster way to do this:

Just S-ON before you downgrade a first time, and then flash_image misc right away. The PB31IMG will take and you'll be at 2.1 with a single RUU flash.
Interesting. I couldn't get RUU to jive for some reason and didn't happen upon the bit about the flash_image until I'd already gone around in circles for several hours. Cool if the shortcut works, though! Where was your info at one o'clock this afternoon when I needed it?

--B
 
Berzerker7
Old
#5  
Senior Member
Thanks Meter 153
Posts: 621
Join Date: Jan 2010
Quote:
Originally Posted by xraystyle View Post
Interesting. I couldn't get RUU to jive for some reason and didn't happen upon the bit about the flash_image until I'd already gone around in circles for several hours. Cool if the shortcut works, though! Where was your info at one o'clock this afternoon when I needed it?

--B
Not reading your topic. lol
 
ACD168
Old
#6  
Senior Member
Thanks Meter 134
Posts: 1,528
Join Date: Aug 2010
I found it easier, to just since your rooted already, just put it to S-on, then run the stock RUU for 2.2. and your done in two steps. no need for all the codes.... I just did it, got my refurb yesterday,...
 
TheLynxy
Old
#7  
TheLynxy's Avatar
Member
Thanks Meter 5
Posts: 97
Join Date: Jun 2010
Thanks for the informative post! This will help a lot of people in the future.

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Careers in Android: What Hiring Managers Won’t Tell You – XDA Developer TV

XDA Developer TV Producer Jayce released a video a … more

Coloring Your Logcat World

Getting feedback for your app during development is as simple as adding logging info where necessary and looking … more

Guide Your Sheep to Safety with Finger Shepherd

Just a coupe of days ago, we brought you news about a game calledAgent Sheep. In that … more

Nandroid Manager Receives Major Update

Do you find yourself obsessively jumping from ROM to ROM? And do you hate having to restore a full … more