[RUU]VipeRUU Jewel 3.16.651.3 || Updated 3.19.13 ||

-viperboy-

Inactive Recognized Developer
Jun 24, 2007
7,836
12,990
0
PA

DISCLAIMER
I will not be held responsible if this damages, bricks, ruins, destroys, or sets your phone on fire. Proceed at your own risk and make sure to follow instructions. For the love of God, do not try to use this on a phone other than the HTC EVO 4G LTE for Sprint or you WILL brick your phone.​

Q: What is VipeRUU?
A: An alternative way to flash an RUU, basically it flashes it through a special mode in the bootloader. This will put you back to complete unrooted stock and update your bootloader to the latest! Instead of using HTC's .exe to do it, I created this way for numerous reasons.
Q: What reasons?
A: Well, there are a few. The first reason (and most important) is to protect the people that get these files for us. While I do not know these people, I would like to keep seeing these files around.

The second reason is that I believe you won't see RUU's around much anymore. HTC has made it clear that they are OK with the RUU's out there, but they have not showed any intention of making more publicly available. This means that any future files that become available, HTC may be tracking them. I have no idea, but just my personal belief, and I'd like to be safe about it - hence using decrypted and unsigned rom.zips and VipeRUU to flash it.

Lastly, because I believe you will see a reduction in RUU's (but possibly not official ROM files) I wanted to make a way that any device can utilize VipeRUU to still flash the rom.zip files just like you would run an RUU.
Q: Whatever, what are the requirements to use this?
A: You must be S-OFF to use this tool, unlike when you use an RUU. The reason why is because the rom.zip files have been decrypted via RUUVEAL unpacked, and repacked, which means that it no longer has HTC's signature, so an S-ON bootloader won't accept it. Again, this is just for any sources security.

There are 2 tools to gain S-OFF and they're easy to use, please check them out - Facepalm or DirtyRacun. Note: Facepalm doesn't appear to work on 3.16. You can try BabyRacun and then Facepalm and it might work, but I didn't try that.

You also need a Windows PC. This was tested on both Win7 and Win8 x64. I was going to write a Linux version, but I don't know if there is a big need for it or not. If there is, please let me know.
Q: OK cool, how do I use this?
A: It's very simple! Download the file below and unzip it. Double-click on VipeRUU.bat. If you get an error complaining about security, right-click, properties, unblock. Then run it again. You need to be booted into Android (aka, your phone turns on and boots to Sense/CM/whatever) to use this.
Q: But what if I can't get into Android?? Surely there is something I can do!?
A: Yes, I designed a "backdoor" to allow you into VipeRUU. However, BE CAREFUL! This skips important checks that VipeRUU does when it start (most importantly, if your phone really is an EVO 4G LTE!) but it will allow you to do this procedure from the bootloader. All you have to do is create a text file in the "files" folder called "bypass.txt" and then start the program. You'll be alerted with a few warnings when doing this.
Q: Why don't you just release the RUU since I'm S-ON?!
A: I do not have the RUU, sorry. Just do an S-OFF procedure I talked about above, it's not that hard :)
Sharing
The use of this tool is open for anyone to use. I just ask that you leave everything as it is and change only the needed lines in the code for other devices. I will have information below on how to adapt this for other devices. If you have any fixes or suggestions, please send them my way.​
Credits
Indirect for helping with the code
IRC testers - jocarog (I forget the others, please let me know so I can credit you!)​
 
Last edited:

-viperboy-

Inactive Recognized Developer
Jun 24, 2007
7,836
12,990
0
PA
Here is the code:

Code:
@ECHO off
color 0c
mode con:cols=80 lines=35
::VERSION
SET VERSION=v1.0.0
::PROGRAMS
SET ADB=files\adb.exe
SET FASTBOOT=files\fastboot.exe
SET MD5SUM=files\md5sum.exe
::INFO
SET DEVICE=HTC EVO 4G LTE (jewel)
SET RUUVERSION=3.16.651.3
::FILES
SET ROMZIP=files\rom.zip
SET ROMZIPMD5=9f95e8c2c8c9d3ae6834ea081434ac62
SET ROMZIPMD5CHECK=files\md5.txt
::eek:THERS
SET BYPASS=files\bypass.txt
SET LOG=files\log.txt
SET UNLOCKCODE=files\Unlock_code.bin

ECHO.
ECHO Initializing...
del %LOG% 2>NUL
del %ROMZIPMD5CHECK% 2>NUL
%adb% kill-server > NUL
%adb% start-server > NUL

ECHO.
ECHO Getting device information...
ping 127.0.0.1 -n 3 > NUL

IF EXIST %BYPASS% (
	GOTO forceBypass 
) ELSE (
	GOTO initVipeRUU
)

:forceBypass
ECHO.
ECHO *** BYPASSING NORMAL CHECKS ***
ECHO.
ECHO I hope you know what you're doing... please confirm.
ECHO. 
pause
SET BYPASS=1
SET STATUS=UNKNOWN
GOTO MENU

:initVipeRUU
%adb% shell getprop ro.product.device > %LOG%
find "jewel" %log% > NUL
IF %ERRORLEVEL%==0 SET ISADB="YES" && SET STATUS=Connected (adb) && GOTO verifyDevice
IF %ERRORLEVEL%==1 GOTO noDevice

:verifyDevice
SET /p CHECKDEVICE=<%LOG%
IF %CHECKDEVICE% == jewel GOTO MENU
IF NOT %CHECKDEVICE% == jewel GOTO wrongDevice

:noDevice
CLS
ECHO.
ECHO Your device wasn't detected. Please make sure the device is plugged in and
ECHO booted into Android.
ECHO.
ECHO Please also make sure that you have installed the drivers located in the 
ECHO "files\drivers" folder and try again.
ECHO.
pause
EXIT

:wrongDevice
CLS
ECHO.
ECHO Device isn't an %DEVICE%!
ECHO.
ECHO This would have bricked your phone, exiting...
ECHO.
pause
exit

:MENU
CLS
ECHO ===============================================================================
IF %BYPASS% == 1 ECHO. && ECHO                      *** BE ADVISED, RUNING IN BYPASSED MODE! ***
ECHO.
ECHO                                     VipeRUU %VERSION%
ECHO                                      by -viperboy-  
ECHO                                      and Indirect
ECHO.   
ECHO Device: %DEVICE%                          RUU Version: %RUUVERSION%   
ECHO.
ECHO Status: %STATUS%  
ECHO.
ECHO ===============================================================================
ECHO.
ECHO		1) Start RUU Process
ECHO.
ECHO		2) Unlock bootloader
ECHO.
ECHO		3) Flash Recovery (do after step 2)
ECHO.
ECHO		4) Toggle Security Flag (S-OFF to S-ON)
ECHO.
ECHO		5) Exit
ECHO.
SET /P CHOICE=Please choose an option: 
IF %CHOICE% == 1 GOTO flashRUU
IF %CHOICE% == 2 GOTO unlockBootloader
IF %CHOICE% == 3 GOTO doRecovery
IF %CHOICE% == 4 GOTO doSecurityFlag
IF %CHOICE% == 5 EXIT
IF NOT DEFINED %CHOICE% GOTO ERROR

:flashRUU
CLS
ECHO.
ECHO Rebooting to bootloader...
%adb% reboot bootloader 2>NUL
ECHO.
ECHO Starting RUU mode...
%FASTBOOT% oem rebootRUU 2>NUL
ECHO.
ECHO Checking MD5 before flashing...
ECHO.
%MD5SUM% %ROMZIP% > %ROMZIPMD5CHECK%
find "%ROMZIPMD5%" %ROMZIPMD5CHECK% > NUL
IF %ERRORLEVEL%==0 ECHO MD5 matches! Proceeding...
IF %ERRORLEVEL%==1 GOTO badMD5
ECHO.
ECHO Performing pre-update...
%FASTBOOT% flash zip %ROMZIP% 2>NUL
ECHO.
ECHO Flashing...
::Keep fastboot from crashing
ping 127.0.0.1 -n 6 > NUL
%FASTBOOT% flash zip %ROMZIP% 2>NUL
ECHO.
ECHO ROM.zip flash sucessful!
ECHO.
SET /P STAYINBOOTLOADER=Stay in bootloader? (y/n): 
IF %STAYINBOOTLOADER% == y %FASTBOOT% reboot-bootloader 2>NUL && ECHO. && ECHO Rebooting to bootloader...
IF %STAYINBOOTLOADER% == Y %FASTBOOT% reboot-bootloader 2>NUL && ECHO. && ECHO Rebooting to bootloader...
IF %STAYINBOOTLOADER% == n %FASTBOOT% reboot 2>NUL && ECHO. && ECHO Rebooting to Android...
IF %STAYINBOOTLOADER% == N %FASTBOOT% reboot 2>NUL && ECHO. && ECHO Rebooting to Android...
ECHO.
pause
GOTO MENU

:unlockBootloader
IF EXIST %UNLOCKCODE% (
	GOTO hasUnlockCode 
) ELSE (
	GOTO getUnlockCode
)

:hasUnlockCode
CLS
ECHO.
%FASTBOOT% flash unlocktoken %UNLOCKCODE% 2>NUL
ECHO Please continue the steps from your phone.
ECHO.
pause
GOTO MENU

:getUnlockCode
CLS
ECHO.
ECHO Please copy the code below...
ECHO.
%FASTBOOT% oem get_identifier_token
ECHO.
ECHO See http://bit.ly/116rKCs if you are unsure what to copy.
ECHO.
ECHO You can continue the process at http://www.htcdev.com/bootloader/
ECHO When you get your Unlock_code.bin, please place it in the
ECHO "files" folder and run this step again to unlock your
ECHO bootloader.
ECHO.
pause
GOTO MENU

:doRecovery
CLS
ECHO.
ECHO Your device needs to be unlocked.
ECHO.
SET /P RECCHOICE=Are you sure you want to do this? (y/n): 
IF %RECCHOICE% == y GOTO flashRecovery
IF %RECCHOICE% == Y GOTO flashRecovery
IF %RECCHOICE% == n ECHO. && ECHO Cancelled! && pause && GOTO MENU
IF %RECCHOICE% == N ECHO. && ECHO Cancelled! && pause && GOTO MENU
IF NOT DEFINED %RECCHOICE% ECHO. && ECHO Cancelled! && ECHO. && pause && GOTO MENU

:flashRecovery
%fastboot% flash recovery files\recovery.img 2>NUL
ECHO.
ECHO Recovery flashed!
ECHO.
pause
GOTO Menu

:doSecurityFlag
CLS
ECHO.
ECHO This needs to be done IMMEDIATELY AFTER you flash the RUU! IF you have a 
ECHO custom HBOOT, it WILL brick your device!!! You must be completely stock!
ECHO.
ECHO You will have to completely go through an S-OFF process if you
ECHO ever wish to have S-OFF again. This is NOT RECOMMENDED, unless you
ECHO are returning your phone for warranty work.
ECHO.
SET /P SECUCHOICE=Are you sure you want to do this? (y/n): 
IF %SECUCHOICE% == y GOTO writeSecureFlag
IF %SECUCHOICE% == Y GOTO writeSecureFlag
IF %SECUCHOICE% == n ECHO. && ECHO Cancelled! && pause && GOTO MENU
IF %SECUCHOICE% == N ECHO. && ECHO Cancelled! && pause && GOTO MENU
IF NOT DEFINED %SECUCHOICE% ECHO. && ECHO Cancelled! && pause && GOTO MENU

:writeSecureFlag
%fastboot% oem writesecureflag 3
pause
GOTO menu

:badMD5
ECHO.
ECHO Bad md5 when checking rom.zip! Please redownload VipeRUU, as flashing
ECHO a file with a bad md5sum can brick your phone!
ECHO.
pause
exit

:ERROR
ECHO.
ECHO Invalid option, please try again!
ECHO.
PAUSE
GOTO MENU
I just realized there are a few more places in the code that you need to change things to make it work for another device. I will clean that up at a later point, but if you follow the below information, you can make it work on any Android device. Make sure you're rom.zip is named "rom.zip"

Change these at it applies to your device/files:
Code:
SET DEVICE=HTC EVO 4G LTE (jewel)
SET RUUVERSION=3.16.651.3
SET ROMZIPMD5=9f95e8c2c8c9d3ae6834ea081434ac62
Change "jewel" to whatever your device name is when running getprop ro.product.device
Code:
:initVipeRUU
%adb% shell getprop ro.product.device > %LOG%
[COLOR="Red"]find "jewel" %log% > NUL[/COLOR]
Change "jewel" here as well to your device name found via getprop ro.product.device
Code:
:verifyDevice
SET /p CHECKDEVICE=<%LOG%
[COLOR="red"]IF %CHECKDEVICE% == jewel GOTO MENU
IF NOT %CHECKDEVICE% == jewel GOTO wrongDevice[/COLOR]
The above 2 I will make easier to edit later, but for now, this will work.
 
Last edited:

JManekia

Senior Member
May 20, 2012
613
240
0
What is the use of RUU? Is this a stock unrooted ROM? Is this to be used to unroot? Or is this for developers only? Can I flash this as a stock rom?
 

-viperboy-

Inactive Recognized Developer
Jun 24, 2007
7,836
12,990
0
PA
Re: [RUU]VipeRUU Jewel 3.16.651.3 || Updated 3.19.12 ||

What is the use of RUU? Is this a stock unrooted ROM? Is this to be used to unroot? Or is this for developers only? Can I flash this as a stock rom?
An RUU is a ROM Update Utility. It's how HTC updates devices officially. It can flash everything in this mode, the ROM, radios, firmware, etc. This will take you back to complete stock 3.16, bootloader and all.

For the end user, it's just a way to recover the phone if something major went wrong.

Sent from my EVO using Tapatalk 2
 

JManekia

Senior Member
May 20, 2012
613
240
0
Re: [RUU]VipeRUU Jewel 3.16.651.3 || Updated 3.19.12 ||

But it wont unroot the phone and lock the boatloader correct?

Sent from my EVO using xda app-developers app
 

-viperboy-

Inactive Recognized Developer
Jun 24, 2007
7,836
12,990
0
PA
Re: [RUU]VipeRUU Jewel 3.16.651.3 || Updated 3.19.12 ||

But it wont unroot the phone and lock the boatloader correct?

Sent from my EVO using xda app-developers app
"Back to complete stock" would mean it does all of that, yes. I would encourage you to Google RUU and read up on it a bit.

Sent from my EVO using Tapatalk 2
 

scottspa74

Senior Member
Apr 3, 2009
9,152
3,122
0
everett
Re: [RUU]VipeRUU Jewel 3.16.651.3 || Updated 3.19.12 ||

Thanks viperboy. Check the date on OP, though. It says 3/19/12, I thought , wow, this is old, lol.
Then realized this device wasn't available yet as of 3/19/12

Sent from my EVO using xda premium
 

scottspa74

Senior Member
Apr 3, 2009
9,152
3,122
0
everett
Re: [RUU]VipeRUU Jewel 3.16.651.3 || Updated 3.19.12 ||

Why would HTC stop releasing RUUs? I thought they built them as a way to restore borked phones. Kind of like Samsung and Odin. I could be off, honestly, I've never used an RUU, this was just my impression from reading over the years.

Sent from my EVO using xda premium
 

tonyevo52

Senior Member
Feb 1, 2013
794
445
0
Re: [RUU]VipeRUU Jewel 3.16.651.3 || Updated 3.19.12 ||

If you used this, it would be like going to sprint and picking up a new phone... This is the ultimate "i screwed my phone up fix".. Pretty awesome!

Sent from my EVO using xda premium
 

-viperboy-

Inactive Recognized Developer
Jun 24, 2007
7,836
12,990
0
PA
Thanks viperboy. Check the date on OP, though. It says 3/19/12, I thought , wow, this is old, lol.
Then realized this device wasn't available yet as of 3/19/12

Sent from my EVO using xda premium
Christ lol sorry, fixed.

Why would HTC stop releasing RUUs? I thought they built them as a way to restore borked phones. Kind of like Samsung and Odin. I could be off, honestly, I've never used an RUU, this was just my impression from reading over the years.

Sent from my EVO using xda premium
They never released them, they were always being leaked :D

If you used this, it would be like going to sprint and picking up a new phone... This is the ultimate "i screwed my phone up fix".. Pretty awesome!

Sent from my EVO using xda premium
Yup!

^^^^^^^^^^^
Doesn't fix QHUSBDLMODE bricks though, right ?

Sent from my EVO using xda premium
Nope!
 

AarSyl

Senior Member
Aug 21, 2012
2,799
937
193
NJ
So, apparently I used CWM to flash an older rom not compatible with TWRP 2.4.1, and I broke my miscellaneous partition. Will flashing this restore my partition, just as flashing an RUU would?

______________________________
HTC Evo 4G LTE
 

scottspa74

Senior Member
Apr 3, 2009
9,152
3,122
0
everett
I Dont think so (don't quote me). But you asked in the right place. Viperboy had the fix for that posted in viper ROM thread a while back. I'm sure he can help you.

Sent from my EVO using xda premium
 
  • Like
Reactions: Blackcircle

-viperboy-

Inactive Recognized Developer
Jun 24, 2007
7,836
12,990
0
PA
So, apparently I used CWM to flash an older rom not compatible with TWRP 2.4.1, and I broke my miscellaneous partition. Will flashing this restore my partition, just as flashing an RUU would?

______________________________
HTC Evo 4G LTE
Yes it will fix that. This is literally the same thing as running an RUU, just with a few extra features.

Sent from my LG-LS970 using Tapatalk 2
 
  • Like
Reactions: AarSyl and Riff76