[GUIDE] How to extract RUU & manually flash rom.zip HTC One M7
So, you may have made a bad flash, having trouble to S-OFF or just want to go back to 100% stock ROM and recovery. In that case, the easiest solution is to run your RUU (ROM Update Utility). But unlike the conventional method, this guide is about extracting the rom.zip from your RUU for a faster and more comprehensive installation. The extracted rom.zip will also allow the possibility to decrypt the RUU in order to get access to all the individual files inside the encrypted archive. So, if you want to flash, for example, only the stock recovery, you can do it without having to flash the entire RUU ROM, which will restore the phone's entire software.
Note: Your HTC One can be either S-ON or S-OFF in order to successfully flash RUU rom.zip. But if your device is S-OFF, you do not need to re/lock your bootloader.
Follow the instructions in the given order to avoid any hiccups or possible bricking of your device:
You will need to know your HTC One's MID and CID. These codes will allow you to find the required RUU for your phone.
You need adb and fastboot. Go to your Bootloader. Select Fastboot. Connect your HTC One with its original USB cable to your PC. Do:
fastboot getvar all
and you should see a list of important information about your device. In particular, note the modelid
(MID) and cidnum
(CID). If you get nothing, there is an issue with the USB connection between your phone and PC.
Find the correct RUU. Here's a thread: http://forum.xda-developers.com/show....php?t=2428276
to find the correct RUU from the filename but more importantly, make sure that both the MID and CID match exactly with your device. You also need to pay attention if you need the M7 UL or M7 U version, which is in the filename of the RUU. If you can't find your RUU from that site, just google or search on XDA. However, not all HTC One variants have RUUs. But if you are already S-OFF, you can change your MID and CID, which will allow you to use any RUU: http://forum.xda-developers.com/show....php?t=2322820
Extract the RUU and grab the rom.zip file. This is the most important file you need from the RUU and afterwards you can delete the RUU exe if you want. To get the rom.zip from your RUU exe file, you just need to run the RUU exe file once, and then when the window is ready and waiting for you to press on the "Next" button, just leave it open and go to your temp folder. I'm using Windows XP SP3 32-bit and my temp folder is located at this path: C:\Documents and Settings\Administrator\Local Settings\Temp
Now, you will see several files and folders. Sort everything in that temp folder based on "Date Modified" with the most recent folder showing up above all other folders. This is the folder you want. The folder name will be bunch of letters and numbers. Inside that folder you will find several files, but what you need is rom.zip and android-info.txt. Copy both these files and paste them somewhere safe on your hard drive. The android-info.txt contains crucial information about the compatibility of that RUU for your phone. Here's the android-info.txt extracted from my RUU exe:
You can then verify that you have the correct RUU if the modelid
matches that of your phone and if you can see your cidnum
in that list. If either (or both) of the modelid or cidnum does not match that of your phone, the RUU process will fail. The mainver
is the firmware that is going to be flashed onto your phone.
For easy reference, create a new folder and name it exactly like the RUU exe file and put the rom.zip and android-info.txt in there so you won't have trouble identifying that rom.zip file later if you need to flash it again. Now, you can close the RUU installation window and all the files in that temp folder containing rom.zip will be instantly erased. Note that if you open the rom.zip with Winzip/Winrar, you will see a list of all the files but if you try to extract or double-click to open any of these files, you will get an error saying that the file is corrupt. This warning is only due to the files being encrypted by HTC, since the RUU is an official release and is digitally signed. To access those encrypted files, you will need to decrypt them on Linux.
Go to your bootloader. Do:
fastboot oem rebootRUU
This will reboot your HTC One and you will see a black screen with a silver HTC logo.
Now, you will need to access the rom.zip file and flash it. I have copied my rom.zip to my adb folder located at: C:/mini-sdk/rom.zip
So, i type:
fastboot flash zip C:/mini-sdk/rom.zip
Don't touch anything during the flash process. It will start and after some time, you will see FAILED error. Don't worry, it's the file preparation process if you have firmware higher than that of the RUU. Just do the same command again and the flash process will complete successfully this time. Look at the Command Prompt to know when the flash is complete. At the same time if you look at your phone, you will notice a green progress bar. When the flashing is complete on the Command Prompt, you will notice that the green bar is stuck at about 95%. This is normal. It's just a bug in the progress bar - what matters is the output from the Command Prompt window.
Then, you reboot. Do:
This will restart your phone. Let it boot up. It might take a little longer for the first boot up sequence. You will then have completely stock software (firmware & ROM). Go to your bootloader and check. Your S-ON/OFF and Bootloader lock/unlock are unchanged from before the RUU rom.zip flashing procedure. You can now also receive OTA updates.
I hope this has been helpful. Just press the THANKS button!