[HTC Sensation] kgs1992:
**Very informative guide, meant for everyone**

A better version is available on my site, here.​

S-OFF voids warranty! At no point do I claim that this guide

restores

your warranty in any way.

This guide includes steps to restore stock software, which will conceal that your phone's software was modified.

It is up to you to chose how you use this guide.

Remember that hiding the fact that you have modified the phone for purposes of warranty claim is unethical & I don't support this in any way.​

1. Let's discuss about RUU first:

1.1 What is an RUU?

RUU stands for ROM Update Utility

Simply put, a RUU is executable (.exe) Windows program that contains the various files required for changing your phone's software via HTC.​

1.2 The RUU contents

Files for it's own configuration & execution

adb and fastboot files for communicating with your device

A signed HTC ROM to flash all partitions

Other miscellaneous files

1.3 Method of execution:

The RUU can be started by double-clicking the executable file when the phone is connected to the PC via fastboot USB (in the bootloader). The RUU works by passing commands to your device which will enable it to flash the ROM on your phone.

Once the installation starts, the RUU executable does nothing except show you the current status of installation.

When the installation is successful or when there is an error, it displays the appropriate message.​

1.4 Security features:

The RUU will ALWAYS check your CID & MID before installation. If your phone's CID or MID does not match the RUU's list of supported CIDs & MIDs, it will not install.

Before flashing, the software number of the RUU and the phone's current software number are compared.

If your device is S-ON, then you cannot flash an RUU with version less than your phone's current version. The same applies for hboot version​

1.5 General PRECAUTIONS to take during RUU execution:

Always use USB 2.0 ports on the computer

Never use USB Hubs or extensions

Use a secure cable, preferably the one you got from HTC. The cable should not be loose or flimsy.

Never pull out the USB cable unless you are absolutely sure that the RUU is not making any changes to the phone.

If you are using a laptop, charge the battery first & keep the battery as well as the charger connected until RUU has finished execution.

Read & follow the guide to the letter.

2. Naming convention & finding the right RUU

RUUs for the HTC Sensation & Sensation XE are named as

RUU_PYRAMID or PYRAMID_LE_(Provider/Location name)_(Software base).(Provider/Location).x_RADIO_(Radio version)

As an added note, RUU for the Sensation is PYRAMID, RUU for the Sensation 4G is PYRAMID_TMOUS, and the RUU for the Sensation XE is PYRAMID_LE.

To find the right RUU for yourself, you need to know two things:

Your CID & corresponding region code

Your Current software version

2.1 To find your CID:

You will need sdk & and drivers, please take a look here. If you already have it, continue.

Reboot to bootloader powering down the phone & then Holding Vol down + Power button

Connect your phone to the PC while in the bootloader. The phone should say fastboot USB, if not, select fastboot on the phone & check if it says fastboot USB, if not, change the USB port you are using.

Navigate to the platform tools folder located inside android-sdk folder

Hold down shift and right-click anywhere in the empty space inside the window.

Select the option: Open command window here.

Next, type

fastboot getvar cid

You will now be shown your current CID.

2.2 To get provider/location code

Note down your CID and check corresponding provider/location here or search/post in this thread.

Here is a list of variants:

x.xx.61.x - Orange UK (United Kingdom)

x.xx.69.x - Orange PL (Poland)

x.xx.73.x - Orange FR (France)

x.xx.75.x - Orange ES (Spain)

x.xx.110.x - T-Mobile UK (United Kingdom)

x.xx.111.x - T-Mobile DE (Germany)

x.xx.113.x - T-Mobile CZ (Czech Republic)

x.xx.161.x - Vodafone UK (United Kingdom)

x.xx.163.x - Vodafone FR (France)

x.xx.165.x - Vodafone IT (Italy)

x.xx.168.x - Vodafone GR (Greece)

x.xx.206.x - O2 UK (United Kingdom)

x.xx.401.x - World Wide English (Europe Unbranded)

x.xx.415.x - Arabic (UAE/Middle East)

x.xx.468.x - Turkey

x.xx.497.x - Morocco

x.xx.498.x - WWE Brightpoint US (United States)

x.xx.531.x - T-Mobile US (United Kingdom)

x.xx.666.x - Bell Canada

x.xx.707.x - Asia WWE (World Wide English)

x.xx.709.x - Asia TW (Taiwan)

x.xx.720.x - Asia India

x.xx.771.x - Hutchison 3G UK (United Kingdom)

x.xx.841.x - Telsra WWE (World Wide English)

x.xx.862.x - Voda-Hutch AU (Australia)

x.xx.901.x - TIM IT (Italy)

x.xx.911.x - SK Telecom (South Korea)

x.xx.1400.x - HTC China

x.xx.1403.x - HTC China CMCC (China Mobile Communications Corporation)​

2.3 To find your software version:

If you have S Off, this doesn't matter, but try to flash the latest RUU.

Go to "Settings" > "About phone" > "Software Information" > "More" > "Software number" on your device.

The right software version for you is any version higher than or equal to this.

This is sometimes inaccurate (especially if you're on a custom ROM).

Another way to check is this:

You will need sdk & and drivers, please take a look here. If you already have it, continue.

Reboot to bootloader powering down the phone & then Holding Vol down + Power button

Connect your phone to the PC while in the bootloader. The phone should say fastboot USB, if not, select fastboot on the phone & check if it says fastboot USB, if not, change the USB port you are using.

Navigate to the platform tools folder located inside android-sdk folder

Hold down shift and right-click anywhere in the empty space inside the window.

Select the option: Open command window here.

Next, type

fastboot getvar version-main

You will now be shown your current software number.

The right software version for you is any version higher than or equal to this.
​

2.4 To find your RUU

Please find your suitable RUU using key words

"RUU" "Pyramid" (Sensation) or "Pyramid LE" (Sensation XE) or "Pyramid TMOUS" (Sensation 4G) "Firmware Base.Provider/Location code"

PYRAMID is for Normal Sensation

PYRAMID LE is for Sensation XE

PYRAMID TMOUS is for Sensation 4G

They are not cross compatible.

For example, If you want the RUU for Sensation XE Europe 3.32 based, find "RUU Pyramid LE 3.32.401 "

Execlutable RUUs can be found here*:

http://www.tsar3000.com/Joomla/inde...riginal-roms&catid=65:htc-downloads&Itemid=98

http://www.shipped-roms.com/index.php?category=android&model=Pyramid

For the extracted rom.zip file from RUU, look here*:

http://goo.im/stock/pyramid/ruu

*Please note, these files aren't hosted by me, so credit goes to whoever is uploading and hosting them.

That being said, it is your responsibility to check the source & ascertain if they are reliable.

Remember, an incomplete zip could possibly brick your device, especially S-OFF devices.
​

3. RUU to restore stock

The main reason that people flash RUUs is because they want to get back to stock.

Here is how it's done:

Is your device S-ON or S-OFF?​

S-ON

​

Click to show instructions:

Is your bootloader unlocked via HTC Dev? (If it is, it should say *** UNLOCKED *** at the top)​

Yes, it says UNLOCKED on the bootloader:

Follow points 3.1 & 3.2 to restore your phone back to stock.​

No, it doesn't say UNLOCKED on the bootloader:

Follow point 3.2 only to restore your phone back to stock.​

S-OFF​

Click to show instructions:

Is your bootloader unlocked via HTC Dev? (If it is, it should say *** UNLOCKED *** at the top)​

Yes, it says UNLOCKED on the bootloader:

Follow points 3.1 & 3.2 to restore your phone back to stock.

Optionally use 3.3 to turn back to S-ON.​

No, it doesn't say UNLOCKED on the bootloader:

Follow point 3.2 only to restore your phone back to stock.

Optionally use 3.3 to turn back to S-ON.​

​

3.1 Relocking the bootloader

You will need sdk & and drivers, please take a look here. If you already have it, continue.

Reboot to bootloader by Holding Vol down + Power button

Connect your phone to the PC while in the bootloader. The phone should say fastboot USB, if not, select fastboot on the phone & check if it says fastboot USB, if not, change the USB port you are using.

Navigate to the platform tools folder located inside android-sdk folder

Hold down shift and right-click anywhere in the empty space inside the window.

Select the option: Open command window here.

Next type:

fastboot oem lock

Finally, type

fastboot reboot-bootloader

Bootloader should now say *Relocked* & may or may not display a Security Warning

3.2 Using RUU to restore partitions

Find your right RUU using 2 in this guide.

Flash your RUU as you normally would by double clicking the executable & following the instructions, you phone must be connected to PC via fastboot USB (in the bootloader).

If you get a Hboot Pre-update message, re-run the RUU once again with your phone connected in fastboot USB.

If the previous step fails, follow points listed under 4. Flashing RUU manually.

Reboot your device to bootloader, your bootloader should now say *Locked* or *Relocked*

3.3 Turning S On after RUU flash

You will need sdk & and drivers, please take a look here. If you already have it, continue.

This is optional, but if you want to do it, it must be done only after flashing the RUU! If your device has a hboot that isn't LOCKED, RELOCKED or UNLOCKED, do not do this!!

Reboot to bootloader powering down the phone & then Holding Vol down + Power button

Connect your phone to the PC while in the bootloader. The phone should say fastboot USB, if not, select fastboot on the phone & check if it says fastboot USB, if not, change the USB port you are using.

Navigate to the platform tools folder located inside android-sdk folder

Hold down shift and right-click anywhere in the empty space inside the window.

Next type:

fastboot oem writesecureflag 3

Finally, type

fastboot reboot-bootloader

Bootloader should now say S ON.

If the bootloader says *Security Warning*

Remove the battery and then re-insert it

Reboot to bootloader by holding down the volume key and pressing the power button.

Connect your phone to the computer via USB.

Re-run the RUU executable again.

The bootloader should now say S On.

4. Flashing RUU manually

4.1 Getting PG58IMG.zip from RUU

Run the RUU executable as you normally would, but don't proceed to the second step i.e. when a second window appears, do nothing. Do not proceed, just ignore it for now, but don't close the window.

Right-click the Windows Start button and select "Open Window Explorer" option.

If you use Windows XP

Copy-paste this in the navigation bar:

C:\Documents and Settings\%USERNAME%\Local Settings\Temp\

If you use Windows Vista/7

Press & hold Windows key on the keyboard and then press R (Win key + R). Once the box pops up, copy paste this:

%temp%

Right click anywhere inside explorer window (not on any folder) and select Sort by then select Date.

Locate the latest one created (first in the list & it will most likely have random numbers in the name) & open it.

You will find a second folder with a set of random numbers. Open it, inside you will find a number of files and the rom.zip

Copy the rom.zip file to another location.

Now, close the RUU executable folder & rename the rom.zip file as PG58IMG.zip

4.2 Adding your CID to the PGIMG.zip

This is only required if the RUU you have is not for your CID and you don't have SuperCID.

Check your cid by referring to 2.1 in this guide.

Double click the PG58IMG.zip file to open it.

Double click android-info.txt to open in notepad.

Add your CID to the end of the file uising the ones already in there as an example.

Make sure there are no spaces in or after your CID

Press Ctrl +S and then close the window.

You will now see a pop up window. Click yes to modify the archive.

4.3 How to Super CID

This is only required if the RUU you want to flash is not for your CID and you did not follow 4.2.

This requires that your bootloader should not say S-On.

Follow all steps in 2.1 and then continue.

Now type the following code:

fastboot oem writecid 11111111

Now type :

fastboot reboot-bootloader

Wait for the phone to reboot into bootloader.

Type this:

fastboot getvar cid

Your CID should now be 11111111

If this method failed, try 4.2

4.4 How to flash PG58IMG

4.4.1 Without a PC, via bootloader

Put the PG58IMG.zip onto the root of your SD Card

Reboot to bootloader by Holding Vol down + Power button

You will then be asked if you want to install the file, select yes by pressing Vol up.

Don't touch anything till the install completes

After the install is complete, when prompted to reboot, open the back casing of the phone and take out the SD Card.

Then press the power button once to reboot.

If you experience a boot loop, reboot to bootloader and re-flash the PG58IMG.zip

If booted into bootloader, select fastboot > reboot.

If booted into fastboot, select reboot.

Connect the SD Card to a computer and delete the PG58IMG.zip file

If this method fails, try 4.4.2​

4.4.2 With a PC, via fastboot USB

You will need sdk & and drivers, please take a look here. If you already have it, continue.

Reboot to bootloader by Holding Vol down + Power button

Connect your phone to the PC while in the bootloader. The phone should say fastboot USB, if not, select fastboot on the phone & check if it says fastboot USB, if not, change the USB port you are using.

Navigate to the platform tools folder located inside android-sdk folder

Copy the PG58IMG.zip file from step 4.1 to this folder

Hold down shift and right-click anywhere in the empty space inside the window.

Enter the following command

fastboot erase cache

You may not see any output, then enter the command

fastboot oem rebootRUU

You phone will now go into the RUU mode.

Wait for around 30 seconds, then enter the command

fastboot flash zip PG58IMG.zip

The installation will begin and you will be able to see the progress at every step.

Once done, enter the command

fastboot reboot

If you experience a boot loop, repeat 4.4.2 again.

5. Common errors & Troubleshooting:

If you get any error while running the executable, it is recommended that you use the method to extract the rom.zip & flash it.

This is because the error code returned by the executable is not very clear.

Stuck at <waiting for device>

Drivers not present or not installed correctly; Install the correct drivers.

Phone is not in fastboot USB mode. Remove USB Cable; remove & reinsert phone battery; hold volume down + power; select FASTBOOT; connect USB.

error: cannot load 'xyz'

You typed the wrong filename or the file isn't present in the folder. Check that the file is present & that the filename is correct, then repeat the command.​

Error 150: ROM upgrade utility error

This is most likely an error when you use Windows Vista.​

Error [170]: USB Connection error

The RUU cannot connect to your device.

Drivers not present or not installed correctly; Install the correct drivers.

Phone is not in fastboot USB mode. Remove USB Cable; remove & reinsert phone battery; hold volume down + power; select FASTBOOT; connect USB.

Other unknown error. Extract rom.zip & flash manually via SD Card.

ERROR [155 to 159]: IMAGE ERROR

One of these error messages will appear when your device is S-ON & use the incorrect RUU having lower software number/hboot version than what is currently on your phone.​

FAILED (remote: not allowed)

You did not reboot to RUU mode before running the flash command.

You are trying to use a command that you cannot use on a Locked and/or S-ON device.

(bootloader) [ERR] Command error !!! or INFO[ERR] Command error !!!

You are trying to issue an invalid command.

You are trying to use a command that you cannot use on a Locked and/or S-ON device.

FAILED (remote: signature verify fail)The zip that you extracted is broken or the RUU you downloaded is is corrupted. Get the zip again or use a different RUU.​

FAILED (remote: 99 unknown fail)

Your bootloader is still unlocked. You didn't relock your bootloader. Relock your bootloader using this command:

fastboot oem lock

FAILED (remote: low battery)

Battery is too low. Reboot to bootloader by typing

fastboot reboot-bootloader

& let the phone charge for a while.​

FAILED (remote: 90 hboot pre-update! please flush image again immediately)

Normal after Hboot version changes. You need to run only the flash command again (not the whole set of commands, just the fastboot flash command.)​

FAILED (remote: 42 custom id check fail)

The RUU doesn't contain your CID. Either add your CID to the zip (needs S-OFF) or try changing your CID (usually works only on an S-OFF device)​

FAILED (remote: 92 supercid! please flush image again immediately)

Your device is S-ON & has Super CID. You need to run only the flash command again (not the whole set of commands, just the fastboot flash command.)​

FAILED (remote: 43 main version check fail)

Your device is S-ON & you are trying to use an RUU that has software number less than your current software number.​

FAILED (remote: 44 hboot version check fail)

Your device is S-ON & you are trying to use an RUU that has hboot version less than your current hboot version.​

FAILED (status read failed (Too many links))

Disregard & continue. It is not really an error as such.​

FAILED (data transfer failed (Too many links))

Reboot the phone to fastboot USB. Remove USB Cable; remove & reinsert phone battery; hold volume down + power; select FASTBOOT; connect USB.

Then, try the commands again.​

Any other error that says '(Too many links)'

Reboot the phone to fastboot USB. Remove USB Cable; remove & reinsert phone battery; hold volume down + power; select FASTBOOT; connect USB.

Then, try the commands again.

If you still get the error, please post the complete error code here & when the error occurred so that it can be solved & added to this list.​

Any other error that says 'please flush image again immediately'

You need to run only the flash command again (not the whole set of commands, just the fastboot flash command.) Please post the complete error code here & when the error occurred so that it can be added to this list​

Any error that isn't present in this list

Please post the complete error code here & when the error occurred so that it can be solved & added to this list.​