[How to] Restore to Complete stock T-Mobile HTC One w/ Locked bootloader & S-on - One (M7) General

This is gonna be a lengthy tutorial, I'll be very clear and specific in my details and requirements, you are entirely responsible for what you do to your device, I can confirm here works and the end result is a completely stock device which is updateable, etc, any mistakes, missed steps and any other user error is your fault, so read and follow instructions carefully, that is all. Links for files, requirements, etc will be provided at the end of this tutorial.
Let's begin:
Requirements:
1. Nandroid backup of T-Mobile stock 1.27 rom, since we have no ruu to work with, link provided. (credit to whomever uploaded it)
2. CWM recovery along with ROM manager from the playstore, I may or may not make a flashable zip of the nandroid, depends on when I get time to do so.
3. Root and s-off
4. revone s-off tool (bin file to be specific)
5. a pc or some other way of unzipping the nandroid backup, do not use your device to unzip it, it may or may not unzip correctly, chances are you'll waste your time unzipping over and over pointlessly.
6. adb toolkit (mini kit at the end)
7. knowledge on how to use adb, etc is a plus.
8. KNOW HOW TO READ
9. An HTC one that's at least rooted.
10. Patience
Steps:
1. Gather all your required files, take the all in one toolkit I link which contains revone, adb, stock recovery and cwm. You can placed the downloaded nandroid wherever you want to.
2. Unzip the nandroid backup and place it on the internal memory of the device in the "sdcard/clockworkmod/backup/" folder, do not rename the unzipped file.
3. Run the cwm flash script to replace your recovery with cwm touch recovery, device needs to be in android, not fastboot, device will reboot to android upon successfully flashing cwm recovery.
4. Open rom manager and select "Manage and Restore Backups", it should detect the nandroid, select it and choose to restore, let the device reboot and restore the nandroid.
5. Once complete, do a factory reset(optional) and reboot
6. Next step would be to flash the stock recovery by using the script provided followed by the stock hboot, if hboot flashing fails look at the bottom for the step to fix this.
7. now that's we're on stock recovery and stock rom, our next step would be to lock the bootloader and put the device to s-on, this is where it get's technical:
Lock bootloader using revone:
1. open a command prompt then cd to the folder of your mini sdk, example: cd C:/Users/Random Name/Downloads/mini-sdk
2. In the command prompt window push the revone bin file via "adb push revone /data/local/tmp"
3. Open adb shell: adb shell
4. then: cd /data/local/tmp
5. followed by: chmod 755 revone
6. then: ./revone -P
7. once it reports success it should say whether it requires reboot or not: ./revone -s 0 -l (this changes the bootloader status to **Locked**, -t to remove tamper, -u to **Unlocked** and S-Off, -r for **Relocked**, use as required)
8. Bootloader is now back to locked status, type: reboot bootloader
S-On
Device will be in fastboot mode where you should see **Locked** follow below it by S-Off
1. To change it to s-on, in the command prompt type: fastboot oem writesecureflag 3
2. then fastboot reboot
3. Device will boot into android, you will be prompted by a software update, which you can do at your own leisure whether you'd like to or not, your call.
Voila, you're back on Official stock, completely untouched device.
Optional steps, if needed.
Back to Stock CID:
While in fastboot use the command: fastboot oem writecid T-MOB010 (this needs to be done before you s-off) (script provided)
Flashing stock firmware package
Now flashing this package may fail, it is to be done while you're s-off.
You may flash the firmware.zip package via command line by the following commands:
1. fastboot oem rebootRUU
2. fastboot flash zip firmware.zip (this is named tmo.zip in the package)
3. fastboot reboot-bootloader
(was it a success?, if yes, proceed to locking the bootloader and s-on)
IF flashing the firmware package fails, flash the hboot manually via the command below (hboot provided in a separate zip in case of this):
1. fastboot oem rebootRUU
2. fastboot flash zip boot.zip
3. fastboot reboot-bootloader
should this fail as well, run the super cid script, re-do the above steps, then run the stock tmo cid script.
Then proceed with s-on/lock bootloader. There are a few kinks to be worked out, sadly I have not the time to do this at the moment.
Nandroid backup: https://mega.co.nz/#!gpIFGR7L!c5o74Ex6k3wkVlWKWgSrJBrguShtjHXeB6YQPmoqAmM (credit to uploader, I'll look for the correct screen name as soon as I can)
In case of no signal: which shouldn't be flash a radio: http://forum.xda-developers.com/showthread.php?t=2245615
Mini sdk with scripts: http://d-h.st/z8c
Revone: http://forum.xda-developers.com/showthread.php?t=2314582
NOTE: Video coming soon, credits whomever until I give it accordingly, this was put together in a rush, so didn't get the chance to look see at all the screenies, screenshots and video to come.

dark nightmare said:
this is gonna be a lengthy tutorial, i'll be very clear and specific in my details and requirements, you are entirely responsible for what you do to your device, i can confirm here works and the end result is a completely stock device which is updateable, etc, any mistakes, missed steps and any other user error is your fault, so read and follow instructions carefully, that is all. Links for files, requirements, etc will be provided at the end of this tutorial.
Let's begin:
Requirements:
1. Nandroid backup of t-mobile stock 1.27 rom, since we have no ruu to work with, link provided. (credit to whomever uploaded it)
2. Cwm recovery along with rom manager from the playstore, i may or may not make a flashable zip of the nandroid, depends on when i get time to do so.
3. Root and s-off
4. Revone s-off tool (bin file to be specific)
5. A pc or some other way of unzipping the nandroid backup, do not use your device to unzip it, it may or may not unzip correctly, chances are you'll waste your time unzipping over and over pointlessly.
6. Adb toolkit (mini kit at the end)
7. Knowledge on how to use adb, etc is a plus.
8. Know how to read
9. An htc one that's at least rooted.
10. Patience
steps:
1. Gather all your required files, take the all in one toolkit i link which contains revone, adb, stock recovery and cwm. You can placed the downloaded nandroid wherever you want to.
2. Unzip the nandroid backup and place it on the internal memory of the device in the "sdcard/clockworkmod/backup/" folder, do not rename the unzipped file.
3. Run the cwm flash script to replace your recovery with cwm touch recovery, device needs to be in android, not fastboot, device will reboot to android upon successfully flashing cwm recovery.
4. Open rom manager and select "manage and restore backups", it should detect the nandroid, select it and choose to restore, let the device reboot and restore the nandroid.
5. Once complete, do a factory reset(optional) and reboot
6. Next step would be to flash the stock recovery by using the script provided followed by the stock hboot, if hboot flashing fails look at the bottom for the step to fix this.
7. Now that's we're on stock recovery and stock rom, our next step would be to lock the bootloader and put the device to s-on, this is where it get's technical:
Lock bootloader using revone:
1. Open a command prompt then cd to the folder of your mini sdk, example: Cd c:/users/random name/downloads/mini-sdk
2. In the command prompt window push the revone bin file via "adb push revone /data/local/tmp"
3. Open adb shell: Adb shell
4. Then: Cd /data/local/tmp
5. Followed by: Chmod 755 revone
6. Then: ./revone -p
7. Once it reports success it should say whether it requires reboot or not: ./revone -s 0 -l (this changes the bootloader status to **locked**, -t to remove tamper, -u to **unlocked** and s-off, -r for **relocked**, use as required)
8. Bootloader is now back to locked status, type: Reboot bootloader
s-on
device will be in fastboot mode where you should see **locked** follow below it by s-off
1. To change it to s-on, in the command prompt type: Fastboot oem writesecureflag 3
2. Then fastboot reboot
3. Device will boot into android, you will be prompted by a software update, which you can do at your own leisure whether you'd like to or not, your call.
Voila, you're back on official stock, completely untouched device.
Optional steps, if needed.
Back to stock cid:
While in fastboot use the command: Fastboot oem writecid t-mob010 (this needs to be done before you s-off) (script provided)
flashing stock firmware package
now flashing this package may fail, it is to be done while you're s-off.
You may flash the firmware.zip package via command line by the following commands:
1. Fastboot oem rebootruu
2. Fastboot flash zip firmware.zip (this is named tmo.zip in the package)
3. Fastboot reboot-bootloader
(was it a success?, if yes, proceed to locking the bootloader and s-on)
if flashing the firmware package fails, flash the hboot manually via the command below (hboot provided in a separate zip in case of this):
1. Fastboot oem rebootruu
2. Fastboot flash zip boot.zip
3. Fastboot reboot-bootloader
should this fail as well, run the super cid script, re-do the above steps, then run the stock tmo cid script.
Then proceed with s-on/lock bootloader. There are a few kinks to be worked out, sadly i have not the time to do this at the moment.
Nandroid backup: https://mega.co.nz/#!gpifgr7l!c5o74ex6k3wkvlwkwgsrjbrgushtjhxeb6yqpmoqamm (credit to uploader, i'll look for the correct screen name as soon as i can)
in case of no signal: Which shouldn't be flash a radio: http://forum.xda-developers.com/showthread.php?t=2245615
mini sdk with scripts: http://d-h.st/z8c
revone: http://forum.xda-developers.com/showthread.php?t=2314582
note: Video coming soon, credits whomever until i give it accordingly, this was put together in a rush, so didn't get the chance to look see at all the screenies, screenshots and video to come.
Click to expand...
Click to collapse
you the best! Thanks

I assume if i replace the at&t nandroid with a bell nandroid one i can restore to bell following the rest of the steps?

redzone321 said:
I assume if i replace the at&t nandroid with a bell nandroid one i can restore to bell following the rest of the steps?
Click to expand...
Click to collapse
Yup, you just need to know what the bell cid is, in case you changed to super cid.

I'm getting an MD5 mismatch in CWM...should I just try downloading again

mcdsmaster8824 said:
I'm getting an MD5 mismatch in CWM...should I just try downloading again
Click to expand...
Click to collapse
You can try unzipping via computer and not your phone, if you absolutely have to use your phone, you can try zarchiver, otherwise, may be a bad download.

Hi,
Great that we have this thread.
Should flashing back to stock t-mobile firmware be a step in case someone flashed another firmware package during their many travels of flashing their device? I'm thinking some people may have tried out latest firmware packages like 2.17 or 2.24 and I'm thinking flashing a 1.27.531.x nandroid may not work on a higher firmware package?
http://forum.xda-developers.com/showthread.php?t=2355814
TMOUS Custom Firmware Package - 1.27.531.8
Sent from my HTC One using Tapatalk 2

gustav30 said:
Hi,
Great that we have this thread.
Should flashing back to stock t-mobile firmware be a step in case someone flashed another firmware package during their many travels of flashing their device? I'm thinking some people may have tried out latest firmware packages like 2.17 or 2.24 and I'm thinking flashing a 1.27.531.x nandroid may not work on a higher firmware package?
http://forum.xda-developers.com/showthread.php?t=2355814
TMOUS Custom Firmware Package - 1.27.531.8
Sent from my HTC One using Tapatalk 2
Click to expand...
Click to collapse
I already thought of that, hence the firmware package in the bottom notes.

My bad for not reading all the way through! Glad we have this.
Sent from my HTC One using Tapatalk 4 Beta

Thanks for this great guide!
Would it be possible to add a section for restoring to the stock bootloader for anyone like me who flashed to Google Edition RUU (which replaces boot/recovery/ROM)?

dozybolox13 said:
Thanks for this great guide!
Would it be possible to add a section for restoring to the stock bootloader for anyone like me who flashed to Google Edition RUU (which replaces boot/recovery/ROM)?
Click to expand...
Click to collapse
Bootloader/recovery/stock rom are all a part of this guide buddy, the hboot section is your bootloader, there's the recovery section right there as well (last step before s-on/locked status) and the nandroid that you'll be restoring is the stock rom, once I get time tonight, I'll work on making the nandroid a flashable rom instead to make things easier.

Worked perfectly, thanks!

thank you!

Nandroid backup is "temporary unavailable" on mega - can you post a mirror?
Thanks
Edit: Was able to finally download with megadownloader and restore my device - your guide worked brilliantly, thanks!

I have a problem
Dark Nightmare said:
This is gonna be a lengthy tutorial, I'll be very clear and specific in my details and requirements, you are entirely responsible for what you do to your device, I can confirm here works and the end result is a completely stock device which is updateable, etc, any mistakes, missed steps and any other user error is your fault, so read and follow instructions carefully, that is all. Links for files, requirements, etc will be provided at the end of this tutorial.
Let's begin:
Requirements:
1. Nandroid backup of T-Mobile stock 1.27 rom, since we have no ruu to work with, link provided. (credit to whomever uploaded it)
2. CWM recovery along with ROM manager from the playstore, I may or may not make a flashable zip of the nandroid, depends on when I get time to do so.
3. Root and s-off
4. revone s-off tool (bin file to be specific)
5. a pc or some other way of unzipping the nandroid backup, do not use your device to unzip it, it may or may not unzip correctly, chances are you'll waste your time unzipping over and over pointlessly.
6. adb toolkit (mini kit at the end)
7. knowledge on how to use adb, etc is a plus.
8. KNOW HOW TO READ
9. An HTC one that's at least rooted.
10. Patience
Steps:
1. Gather all your required files, take the all in one toolkit I link which contains revone, adb, stock recovery and cwm. You can placed the downloaded nandroid wherever you want to.
2. Unzip the nandroid backup and place it on the internal memory of the device in the "sdcard/clockworkmod/backup/" folder, do not rename the unzipped file.
3. Run the cwm flash script to replace your recovery with cwm touch recovery, device needs to be in android, not fastboot, device will reboot to android upon successfully flashing cwm recovery.
4. Open rom manager and select "Manage and Restore Backups", it should detect the nandroid, select it and choose to restore, let the device reboot and restore the nandroid.
5. Once complete, do a factory reset(optional) and reboot
6. Next step would be to flash the stock recovery by using the script provided followed by the stock hboot, if hboot flashing fails look at the bottom for the step to fix this.
7. now that's we're on stock recovery and stock rom, our next step would be to lock the bootloader and put the device to s-on, this is where it get's technical:
Lock bootloader using revone:
1. open a command prompt then cd to the folder of your mini sdk, example: cd C:/Users/Random Name/Downloads/mini-sdk
2. In the command prompt window push the revone bin file via "adb push revone /data/local/tmp"
3. Open adb shell: adb shell
4. then: cd /data/local/tmp
5. followed by: chmod 755 revone
6. then: ./revone -P
7. once it reports success it should say whether it requires reboot or not: ./revone -s 0 -l (this changes the bootloader status to **Locked**, -t to remove tamper, -u to **Unlocked** and S-Off, -r for **Relocked**, use as required)
8. Bootloader is now back to locked status, type: reboot bootloader
S-On
Device will be in fastboot mode where you should see **Locked** follow below it by S-Off
1. To change it to s-on, in the command prompt type: fastboot oem writesecureflag 3
2. then fastboot reboot
3. Device will boot into android, you will be prompted by a software update, which you can do at your own leisure whether you'd like to or not, your call.
Voila, you're back on Official stock, completely untouched device.
Optional steps, if needed.
Back to Stock CID:
While in fastboot use the command: fastboot oem writecid T-MOB010 (this needs to be done before you s-off) (script provided)
Flashing stock firmware package
Now flashing this package may fail, it is to be done while you're s-off.
You may flash the firmware.zip package via command line by the following commands:
1. fastboot oem rebootRUU
2. fastboot flash zip firmware.zip (this is named tmo.zip in the package)
3. fastboot reboot-bootloader
(was it a success?, if yes, proceed to locking the bootloader and s-on)
IF flashing the firmware package fails, flash the hboot manually via the command below (hboot provided in a separate zip in case of this):
1. fastboot oem rebootRUU
2. fastboot flash zip boot.zip
3. fastboot reboot-bootloader
should this fail as well, run the super cid script, re-do the above steps, then run the stock tmo cid script.
Then proceed with s-on/lock bootloader. There are a few kinks to be worked out, sadly I have not the time to do this at the moment.
Nandroid backup: https://mega.co.nz/#!gpIFGR7L!c5o74Ex6k3wkVlWKWgSrJBrguShtjHXeB6YQPmoqAmM (credit to uploader, I'll look for the correct screen name as soon as I can)
In case of no signal: which shouldn't be flash a radio: http://forum.xda-developers.com/showthread.php?t=2245615
Mini sdk with scripts: http://d-h.st/z8c
Revone: http://forum.xda-developers.com/showthread.php?t=2314582
NOTE: Video coming soon, credits whomever until I give it accordingly, this was put together in a rush, so didn't get the chance to look see at all the screenies, screenshots and video to come.
Click to expand...
Click to collapse
I tried this on my Htc one and it didn't work. i accidentally formatted my data and when i try to reboot it says no os installed. I tried side loading it, and tried flash zip, but i still could load into any rom. Please help.

ro34po43 said:
I tried this on my Htc one and it didn't work. i accidentally formatted my data and when i try to reboot it says no os installed. I tried side loading it, and tried flash zip, but i still could load into any rom. Please help.
Click to expand...
Click to collapse
What recovery are you using and what rom are you trying to sideload with? If you're gonna safely sideload, use twrp and a stock rom.

Thank you so much for this!
Just out of curiosity, have you had time to upload any screenshots or a video of the process yet?

idonthavetimeforthis said:
Thank you so much for this!
Just out of curiosity, have you had time to upload any screenshots or a video of the process yet?
Click to expand...
Click to collapse
Like your name he doesn't have time for it

thank you
thank you very much for writing this organized tutorial - there could be a little more detail about how to flash the recovery's for those that don't use windows (easy enough to open the bat scripts), but very good and very convenient to have all the files in one place
thanks again

I didn't bother reading the entire thread, so if there's a link I apologize, but I'm another sad soul who took the T-Mobile 1.27.531.11 update. Whomp whomp. Well anywho. In my many attempts to S-Off, I've become well versed in restoring back to stock. So if you're stuck and don't know what to do, PM me and I shall help thee! I will provide links to stock/custom recoveries, the .11 RUU, and walk ya through it
Sent from my HTC One using xda app-developers app

Related

[Tutorial] Root, Unlock, Recovery and flashing a Custom ROM

Just a quick step by step tutorial to get a Custom ROM working on your HTC One or if you just want to unlock and root!
This guide is especially for the new users, experienced HTC users should already be familiar with this process.
Step 1: Unlock
Go on http://www.htcdev.com and create yourself an account on HTCDEV.
Download these adb/fastboot files
Make a new folder on your C:/ drive called fastboot for example.
Extract the zip downloaded in step 2 to the new folder
Go Here http://www.htcdev.com/bootloader/ and select "All Other Supported Models" and "then begin unlock bootloader"
Yes, Tick both Boxes, Proceed
Skip up to step 8 as we have all we need for the first 7 steps
Power off your phone by holding the power button down for 10 seconds
Power your phone on by holding power and volume down
Highlight Fastboot With Volume+or- then press Power
Plug your phone into your PC and open a Command Prompt.
(windows XP - Click Start > Run > type CMD in box then press OK
(Windows 7 - Click Start > type CMD in search box then press Enter)
Change directory to your folder where we put fastboot files cd c:\fastboot
Type this into your command prompt window fastboot oem get_identifier_token
Select & copy the text as per step 9 on the HTCDev website
Paste your identifier token into the box at the bottom and submit
You Will Very Shortly Receive an email from HTCDev with a link to the second part of the instructions and your "Unlock_code.bin" attached
Download the "Unlock_code.bin" from the email and save it to the same folder that we extracted fastboot files to in step 2
Type this into your command prompt window fastboot flash unlocktoken Unlock_code.bin
The Display Will change on your phone, press Vol + to accept and power to confirm.
Step 2: Recovery
Download the Android SDK (optional)
Download the recovery of your choice, here a few links:
- CWM
- CWM 2
- TWRP
Place the Recovery file you downloaded where the fastboot.exe is (Either in the location of your downloaded fastboot drivers or in the Android SDK directory)
Now open the cmd and navigate to the folder where the Recovery File is located or just open a cmd with shift and right click at the correct directory
Now type:
fastboot flash recovery name_of_the_recovery.img
For example:
fastboot flash recovery recovery-clockwork-touch-6.0.2.8-m7.img
Now your recovery is installed
Step 3: Root
This step is only needed if you want a stock rooted ROM, if you want a custom ROM, skip this step.
Now root your phone with SuperSU by Chainfire or SuperUser by koush
Download SuperSU from this link or SuperUser from this link
Flash it with the Recovery:
Power off your device and then hold the VOL DOWN + Power to boot into the Bootloader
Navigate with VOL and Power to Recovery
Now flash the .zip:
- install zip from sdcard
- choose zip from sdcard
- select the downloaded SuperSU/SuperUser zip file and flash it
- Reboot now
Now you are able to flash any Custom ROM.
Step 4: Custom ROM
With htcdev unlock you need to flash the boot.img after every ROM installation
Note: Most of the custom ROMs have a script which lets the boot.img flash automatically with the ROM, so probably the steps after flashing the ROM are not needed.
If you are in a bootlop though, I recommend you to perform these steps and flash the boot.img with fastboot
Download the ROM you want to flash
Open the ROM zip with an archive manager and extract the boot.img out of it and place it in your fastboot directory
Copy the ROM to your sdcard
Now boot into bootloader again (explained above) and choose recovery with your volume keys and power button
In recovery wipe data and cache aka fullwipe before flashing your ROM if you are moving to a new base (for example from CyanogenMod to a Sense ROM, don't forget to backup your data files, like apps) (Often ROM chefs leave a note in their thread if a fullwipe is needed or not, just follow their advices)
Now flash your ROM by installing zip from sdcard
If this is finished, reboot and reboot into bootloader again
Connect your phone to your PC in fasboot mode (choose in bootloader with power button)
Open a cmd in your fastboot folder with your boot.img and type these two commands:
fastboot flash boot boot.img
fastboot erase cache
Then reboot your phone and wait some minutes to see your ROM booted
Enjoy
Video tutorials (for One S but the steps are the same):
Video-Tutorial by Flow-Wolf:
Bootloader Unlock:
Recovery Installation:
Root:
Custom ROM Installation:
I recommend using SuperUser by koush insted of SuperSU. I also made Super Boot to root stock ROM but I need someone with WWE HTC One...
I added a link for koush's SuperUser
hi
i done everything like its writen here, but i cant boot into recovery.. it cames the screen "entering recovery" and then the device is reboot
noob.fl said:
hi
i done everything like its writen here, but i cant boot into recovery.. it cames the screen "entering recovery" and then the device is reboot
Click to expand...
Click to collapse
Yes currently the recoveries are not working, be patient until they work, I will leave a note in the OP
thanks for responce - i will wait :laugh:
ist there any other opinion to put the su binary into system? maybee with adb?
noob.fl said:
thanks for responce - i will wait :laugh:
ist there any other opinion to put the su binary into system? maybee with adb?
Click to expand...
Click to collapse
adb can't write system on stock, you would need a modified boot.img
noob.fl said:
thanks for responce - i will wait :laugh:
ist there any other opinion to put the su binary into system? maybee with adb?
Click to expand...
Click to collapse
I have modified boot.img but it's from .401 ROM. You want to try?
mike1986. said:
I have modified boot.img but it's from .401 ROM. You want to try?
Click to expand...
Click to collapse
im since a longer time no more so familar with htc... can it harm my device or it does not care and the one will run? if cot my one since to day, and its a damn expensive device to brick it at first time... but if it works - je i will try
its like all other androiddevices to flash? fastboot flash boot boot.img?
noob.fl said:
im since a longer time no more so familar with htc... can it harm my device or it does not care and the one will run? if cot my one since to day, and its a damn expensive device to brick it at first time... but if it works - je i will try
its like all other androiddevices to flash? fastboot flash boot boot.img?
Click to expand...
Click to collapse
There is no chance to brick but there is a chance for bootloop
if got the softwarw nr 1.27.206.1 with kernel [email protected]#1 - will it works with your 401 kernel?
Can you pull the system partition so we can enjoy some stuff from the One on other HTC devices?
tell me how to do and i will share
http://d-h.st/2DO
Unpack and run the runme.bat
Dumping may need a while, upload it to dropbox for example
Imho all devs should work together here instead of trying to be the first guy with a deodexed stock ROM
these are just windowsfiles - does not working on my linux, sorry
torxx said:
http://d-h.st/2DO
Unpack and run the runme.bat
Dumping may need a while, upload it to dropbox for example
Imho all devs should work together here instead of trying to be the first guy with a deodexed stock ROM
Click to expand...
Click to collapse
Do i understand it right i do not need to install recovery to get the system dump?
Simply go to your adb dir and type that in terminal:
adb pull /system ./system
optional:
adb kill-server
7za a -tzip system.zip system\ -r (needs the 7za file)
rmdir system /s /q
to pack a zip
simpelsense said:
Do i understand it right i do not need to install recovery to get the system dump?
Click to expand...
Click to collapse
no, all through adb
noob.fl said:
these are just windowsfiles - does not working on my linux, sorry
Click to expand...
Click to collapse
Using ADB (I assume you already isntalled it)
adb devices
adb pull /system ./system
adb kill-server
It will write it in your ADB folder
torxx said:
no, all through adb
Click to expand...
Click to collapse
thought pulling system is a little more magic.

[GUIDE] How to Return to 100% Stock

This Guide will help you reset your HTC One back to 100% stock form with no trace of modifications. S-Off Required!
In order for you to be able to reset your device to complete stock it will require that you have S-Off.
For those that still have S-On and cannot gain S-Off due to having one of the updated firmwares there is not much you can do other than restore a stock rom and stock recovery. S-On users can find my 2.24.401.x stock rom with recovery included here:
http://www.htc1guru.com/2013/09/gurureset-aroma/
I am working on more versions now.
If you restore one of the stock Nandroid backups with a 1.2x version, you will probably have issues with the touch screen not working since the updated touchscreen drivers in the newer firmware updates, prevent the touch screen from working in the stock level 4.1.2 software. Keep checking the Download section for Guru Resets as I will be adding more stock rom versions.
If you have a working touch screen on the stock software, after restoring the stock kernel and stock recovery, your bootloader will show RELOCKED instead of LOCKED once you lock it.
I have easily unlocked bootloader, got S-off and super CID for many different HTC One devices from a few carriers, but that is because they came with hboot 1.44 so revone worked without issues to gain S-Off. If you buy a new phone now, regardless if what firmware version and/or software it come with, after you unlock the bootloader be sure the first thing you do is to make a Nandroid backup of your phone in its stock form. If it is a stock Nandroid on the newer 2.24.401.x base, please contact me as I would love to host it as many people could use that if not s-off.
If you are lucky enough to buy a new phone that comes with early hboot 1.44, I advise you get S-off right after you make that stock Nandroid backup. S-off really comes in handy for so many things. There is no danger of bricking your phone unless you start flashing things you don;t understand and other actions without fully understanding the repercussions. If you are unsure about something then just make a post and someone here should be able to provide you with the correct information.
If you don’t know what these terms mean do a search, they have been answered many, many times. Here are some quick links to some common items for modifications::
–Easily unlock bootloader, flash custom recovery, flash ROM, and ADB sideload (in case you forgot to copy your ROM to your phone) plus much more:
http://forum.xda-developers.com/showthread.php?t=2242635
–Easily get S-off by using revone (We will also use this tool reset Security back to S-On)
http://forum.xda-developers.com/showthread.php?t=2314582
***I advise you to get S-off before doing anything else and keep S-off unless you are going to return the device. The latest OTA/firmware contains an hboot that revone will not currently unlock, but if you have s-off you can downgrade your hboot if needed***
–Easily get Super CID
http://forum.xda-developers.com/showthread.php?t=2317536
Now you can do some of these things easily:
*Remove red warning from boot screen + custom hboot:
http://forum.xda-developers.com/showthread.php?t=2316726
http://forum.xda-developers.com/showthread.php?t=2156368
*Flash custom splash screens:
http://forum.xda-developers.com/showthread.php?t=2324746
*Flash new firmware:
Concise and easy for noobs: http://forum.xda-developers.com/showpost.php?p=43551752&postcount=5082
Also http://forum.xda-developers.com/showpost.php?p=43328416&postcount=33758
Post #2 has the download for the custom firmware to flash without screwing anything else up:
http://forum.xda-developers.com/showthread.php?t=2182823
______________________________________________________________________________________
Resetting your device to stock
—————————————————————————
So now for the good stuff. You totally modded the hell out of your One and something happens where you need to return the device to your carrier/vendor. First thing, always go to your carrier/vendor for hardware exchanges NOT direct to HTC. For the most part US carriers don’t care much about modded software on the devices in regards to warranty but HTC does. However just because the person in the device exchange center doesn’t check for root, doesn’t mean someone won’t flag your phone when repairing it. So why take the chance, it only takes a few minutes to return to 100% stock.
Secondly unless your device is totally unusable, I advise you to call the ATT(or your carrier) warranty number and they will send you a replacement and a return shipping label, and then you have 12 days to return it. This way you can access data and settings on your first device if needed and make sure that everything is cool with your replacement before you reset your first device to stock and send it back.
As it is required for most of the modifications mentioned above these steps require that you have your devices drivers installed on your PC and also ADB. If you need help setting up ADB: http://forum.xda-developers.com/showthread.php?t=1427008
---Instructions for returning to 100% stock from S-off:
Before we begin please note that these instructions are for a device with S-off and the stock CID. Your CID should be stock unless you changed it in order to get a specific country/region OTA or as a lot do for flashing ease and just use Super CID.
In order to run the RUU to reset everything to stock, the CID will have to match the device for which the RUU was intended.
So you can’t really mess anything up because if your CID is not correct the RUU will not run and not flash anything.
**-Technically if you have S-off you can run any RUU and it should run fine but your phones image won’t be stock from your carrier if not the correct RUU. I like to set the stock CID back now so we don’t forget. However if using another variant/RUU, since you are s-off, you can do this step after running the RUU.**
If you have stock CID or the CID matches the RUU you can proceed to step 1.
If you have any other CID you need to change it before beginning. In this example I am talking about the US ATT variant for which he stock CID is CWS__001
Code:
adb reboot-bootloader
Phone should boot to the bootloader. Now run:
Code:
fastboot oem writecid CWS__001
Now verify that the stock CID shows on the bootloader screen by running:
Code:
fastboot reboot-bootloader
Reboot device if CID on bootloader screen shows the stock CID. If not retry
*****The next step will wipe the entire contents of the device which includes all of your data. Be sure to back it up to a PC so you can transfer it onto the new device if needed.*****
These instructions are assuming you are running a Windows OS. If you are not then these exe RUU’s won’t be of much use. You will have to use the RUU.zip files which can accomplish the same results as a RUU from flashing in fastboot. You can replace step 1 below with these steps:
Restoring using a RUU.zip
Download the RUU.zip file and place in your ADB/fastboot folder. I would recommend renaming the zip file to something simple like ruu.zip.
Boot your phone into the bootloader by holding the power and vol up/down buttons at the same time until you see the bootloader screen or if you have your phone booted you can use the ADB command:
Code:
adb reboot-bootloader
Now use these fastboot commands:
Code:
fastboot oem rebootRUU
Should see the Silver HTC logo. Now issue this command to flash your phone using the ruu.zip file:
Code:
fastboot flash zip ruu.zip
Now the first time you issue a command to flash firmware/ruu in fastboot it only prepares the flash. You have to issue the exact command again:
Code:
fastboot flash zip ruu.zip
The green status bar usually does not reach the 100% mark. When the output in the command window is complete, you can reboot:
Code:
fastboot reboot
or
Code:
fastboot reboot-bootloader
**Notes about the RUU.zip method. You still need to have the proper CID for the RUU. You can run the RUU.zip with super CID, but you will have to lock your bootloader first. If you are running the RUU.zip as base to downgrade all your firmware because you are going to then going to restore a stock Nandroid so the RUU might not be made for your MID, so you may need to edit the android-info.txt inside the ruu.zip to include your MID or CID.
Restoring using a RUU.exe
1. - Now we need to download the RUU (ROM Update Utility) that flash our device back to mostly stock. It can be downloaded HERE for US AT&T users. Other carriers should be able to find their appropriate RUU in this thread:
http://forum.xda-developers.com/showthread.php?t=2428276 or here: http://www.htc1guru.com/downloads/
If there is not a RUU for your phone, but there is a Stock Nandroid backup, you should still complete the step above. Just make note of your original CID and change yours to CWS__001 so the RUU will run. This will reset all your firmware and other modifications (like modified hboot and splash screens) back to the default stock level regardless of region.
Once downloaded run the RUU_M7_UL_JB_50_Cingular_US_1.26.502.12_Radio_4A.14.3250.13_10.33.1150.01_release_318450_signed_2.exe and it will guide you through resetting the device. After it finishes your device will be almost back to stock. It will have the stock images for recovery, boot, ROM, radio, firmware hboot, etc.
Stock Nandroid restores will require these additional steps before proceeding to step 2:
When you ran the RUU (Either EXE or ZIP) all data was wiped and your custom recovery was reset back to stock, It is recommended to keep this stock recovery in place and use a command that only works on the hboot 1.44 (which you know have form the RUU)
Download the latest version of the recovery that matches the stock Nandroid backup (Either CWM or TWRP) and place it in your ADB/fastboot folder.
Now use this command to boot that custom recovery without installing it:
Code:
fastboot boot TWRP.img or fastboot boot CWM.img
It should load the custom recovery. Now make a test backup and allow it to complete.
Now boot your phone (Do not take OTA updates if prompted) and look to see where exactly the recovery placed the backup. You can install a simple file manager from the play store for this. Take note of the location and folder structure that the recovery has used for the backup.
Now copy the downloaded stock backup files from your PC to that location in the last step. Be sure the folders are in the correct place.
Now reboot into the bootloader and then boot the custom recovery again using that same command as before:
Code:
fastboot boot TWRP.img or fastboot boot CWM.img
Restore the backup and reboot when finished. Important – Do not accept any OTA updates until the complete phone reset process is finished.
Now delete all your backup files and installed applications by doing a factory reset from Settings – Backup and Reset – Erase All Data From Phone. Software and firmware on your phone should be back to stock and you can continue with the next step in the guide.
**Before continuing with the guide make sure you have changed your CID back to stock if you changed it to a non stock one in order to run a RUU to downgrade firmware.**
******If you continue with the next 2 steps to lock the bootloader and you do not have a stock hboot, you will instantly BRICK your device. Shouldn't be an issue if the RUU ran correctly, however you may want to boot into the bootloader and verify that it shows version 1.44.0000 for the hboot. Also your custom recovery should be gone and back to stock (If you boot into the stock recovery it will just look like a red warning triangle with no options). If you are still able to boot into your custom recovery, it is a sign that not all partitions have been flashed back to stock and you should find out why before proceeding]******
Now that we have lots of users who have S-Off from other methods than revone, mainly the new rumrunner method here are the generic instructions for any S-Off device and not just for user with revone:
Before you can proceed with the 2 following threads for removing Tampered and then Locking you need to have Superuser installed. There are links to how to do this in each thread. You can also use this toolkit. Just remember to delete the SuperUser and busybox apk if installed before you return the phone.
2. - First remove the Tampered Flag. Instructions are in this thread
http://forum.xda-developers.com/showthread.php?t=2477792
3. - Second Lock the bootloader. Instructions are in this thread
http://forum.xda-developers.com/showthread.php?t=2475914
The older REVONE commands/instructions for Tampered and Locking:
I recommended using revone to gain S-off, so that is how we will undo it. If you don't still have it we will need the revone file again. It can be downloaded here: http://revolutionary.io/revone (From thread: http://forum.xda-developers.com/showthread.php?t=2314582and http://forum.xda-developers.com/showthread.php?t=2315467)
Push revone to your device:
Put the downloaded revone file in your adb/fastboot folder and push it using this command:
Code:
adb push revone /data/local/tmp/
open a adb shell by typing:
Code:
adb shell
Now change to that directory:
Code:
cd /data/local/tmp
Now set permissions
Code:
chmod 755 revone
Now re-lock the bootloader:
Code:
./revone -l
Remove Tampered flag:
Code:
./revone -t
The newer revisions of revone don't do the actual locking any longer but it should output the command you need to run to fully re-lock:
Type exit to exit the adb shell session and issue the command to re-lock the device:
Code:
fastboot oem writesecureflag 3
Now verify that it worked by booting into the bootloader:
Code:
adb reboot bootloader
You should see it say LOCKED at the top and S-On, just like it was out of the box!
I doubt anyone at the warranty repair center is going to snoop around a device that says Locked and S-On, but I like to cleanup and remove the revone file.
Just reboot the phone and skip over the setup wizard
Now start another adb shell session:
Code:
adb shell
Now change back to the folder where we put revone
Code:
cd /data/local/tmp
Now run this command to delete the revone file
Code:
rm revone
Now since you had to install SuperUser to perform the previous 2 steps make sure you unroot by deleting the Superuser.apk and busybox.apk (If installed) from the /system/app folder and also the su binary from /system/xbin on your phone.
If you ran a RUU your systems firmware and software is all reset back to stock. If you restored via Stock ROM reset or Nandroid you should be running the stock software but it could be on non stock (version mismatch) firmware.
In either case your bootloader should display Locked and no Tampered just like out of the box. Now all that’s left is to S-On. To do that issue this fastboot command:
Code:
fastboot oem writesecureflag 3
Done - device should be just like it was out of the box with no indication of any modding.
*******I am not responsible for any problems you encounter. I am simply informing you of what is needed to complete a restoration to Stock. Read all steps and commands carefully and perform them in the correct order.********
Credits/Thanks
Thanks to all those with threads I mentioned that contain great info and support. Especially scotty1223 for his Tampered removal and Locking threads.
This Guide is always available at my site: http://www.htc1guru.com/guides/return-stock-guide/
[EDIT]9-10-13 Post overhaul with how to combine Nandroid and RUU process to reset.
[EDIT]10-19-13 Post was changed to reflect new S-off, so changed the Tampered and Locking steps from revone
Great guide, this should be a sticky!
Kindly excuse me and no offense to the OP. But if you have S-OFF, all you have to do is change your CID back to your original and then run the RUU and you are nearly done Next thing is you have to lock the bootloader and have S-ON and that is it. You are now back to stock.
Very helpful guide. But it can't be said enough times YOU WILL BRICK YOUR DEVICE going S-ON with a non-stock HBOOT
The guide does mention this in the relevant section, but it should probably be noted somewhere near the top of the OP. In big red letters.
Sent from my HTC One using xda app-developers app
NxNW said:
Very helpful guide. But it can't be said enough times YOU WILL BRICK YOUR DEVICE going S-ON with a non-stock HBOOT
The guide does mention this in the relevant section, but it should probably be noted somewhere near the top of the OP. In big red letters.
Sent from my HTC One using xda app-developers app
Click to expand...
Click to collapse
That's why I think it's safer to just run the RUU because that will flash the stock HBOOT and then you can have S-ON back without the worry of bricking the device.
Nice work. But this block is incorrect and may lead to problems:
crushalot said:
2. - You will need the stock splash screen so we need to do the same procedure as above with the stock splash screen. Download the stock splash screen here: http://d-h.st/F7H (From thread:http://forum.xda-developers.com/showthread.php?t=2324746)
Rename the file so it has no spaces like stock_splash.zip and put it in your ADB/fastboot folder.
Reboot into bootloader:
Code:
adb reboot bootloader
Now run this command:
Code:
fastboot oem rebootRUU
You should see the screen turn to a silver HTC logo. Now run this command:
Code:
fastboot flash zip stock_splash.zip
If you get an output in the console that says "(bootloader) ...... Successful" proceed to next step. If any errors use this thread for troubleshooting: http://forum.xda-developers.com/showthread.php?t=2324746
Click to expand...
Click to collapse
Those splashes in my thread are designed to be flashed in recovery. They will not work in RUU mode because the zip file is constructed incorrectly for it. Best approach would be to just flash the stock splash in recovery in step one.
Alternatively, keep the instructions as is and use the stock splash from this post: http://forum.xda-developers.com/showpost.php?p=42374127&postcount=1
iElvis said:
Nice work. But this block is incorrect and may lead to problems:
Those splashes in my thread are designed to be flashed in recovery. They will not work in RUU mode because the zip file is constructed incorrectly for it. Best approach would be to just flash the stock splash in recovery in step one.
Alternatively, keep the instructions as is and use the stock splash from this post: http://forum.xda-developers.com/showpost.php?p=42374127&postcount=1
Click to expand...
Click to collapse
Yes, you are right sorry. So many threads I messed up the link. Kinda the reason I wanted to put all this in one place. I will update the OP and revise the first few steps to make it easier since the RUU should include the stock hboot and splash.
Thanks for all the feedback.
I thought you needed SU permission to run revone? Am I mistaken?
Do you need root access to push revone to the /data/local/tmp directory?
After running the RUU.exe file, wouldn't you lose root?
I just want to double check.
Dan37tz said:
I thought you needed SU permission to run revone? Am I mistaken?
Do you need root access to push revone to the /data/local/tmp directory?
After running the RUU.exe file, wouldn't you lose root?
I just want to double check.
Click to expand...
Click to collapse
No you don't need root to use it as it has a root hack in the binary itself. That's why in ieftm's post on the usage of revone to S-off has optional wording on step 3
"3. (optional) If your device is unlocked and rooted please switch to root using su."
However I can confirm that it has worked better for me when I didn't run it as SU.
No you do not need root to push files using adb, well at least not to /data. You probably would to push to /system
Correct, after running the RUU you lose root. That is why I manually flashed the hboot and splash back myself while still on my rooted rom with utilities and most importantly a recovery in which I could use to get back running and try again if something failed.
Rex2369 said:
Kindly excuse me and no offense to the OP. But if you have S-OFF, all you have to do is change your CID back to your original and then run the RUU and you are nearly done Next thing is you have to lock the bootloader and have S-ON and that is it. You are now back to stock.
Click to expand...
Click to collapse
Thanks updated post to simplify.
NxNW said:
Very helpful guide. But it can't be said enough times YOU WILL BRICK YOUR DEVICE going S-ON with a non-stock HBOOT
The guide does mention this in the relevant section, but it should probably be noted somewhere near the top of the OP. In big red letters.
Sent from my HTC One using xda app-developers app
Click to expand...
Click to collapse
Thanks but the updated post now avoids the possibility as we just let RUU flash all stock parts
Rex2369 said:
That's why I think it's safer to just run the RUU because that will flash the stock HBOOT and then you can have S-ON back without the worry of bricking the device.
Click to expand...
Click to collapse
Thanks. Reflected in updated OP
Very nice!!! Concise and to the point!!! THANK YOU !!!
It worked like a charm, I have AT&T Version, had S-ON, SuperCID, 1.29.401.12 firmware (not AT&T), and custom ROM. This brought me back right to Stock.
Now back to AT&T, my camera lens on the inside for some reason got hazy with a hue to it after having the phone for about a month.
To the OP you have done well. Hope to see more tutorials from you.
Sent from my HTC One
great guide!
TIP for Mac Users: I couldn't get the RUU to run in Windows 7 or Windows 8 VMware environments, but Windows XP did the trick.
Use VMWare with Windows XP Pro SP3.
what ruu i need for HTC_001?
what ruu i need for HTC_001?
So running RUU does not remove S-OFF? Also does updating from stock 4.1.2 to 4.2.2 with the official OTA remove S-OFF? I want to try the OTA but I'm a bit paranoid about losing the lovely S-OFF .
No running the RUU does not remove S-off. It just resets everything else except bootloader and Security (S-off) back to stock form.
The 4.2.2 OTA does not remove remove S-off, however if you have s-off I would recommend running a custom ROM as they are already way better than the stock 4.2.2 rom.
If you want a pure stock like rom that is 4.2.2 based and better than the HTC version I would recommend ARHD or RGUI. If you like to be able to customize things a little but stay close to stock then TrickDroid is they way to go. If you really like to tinker and customize than Viper will blow your mind.
tomer861 said:
what ruu i need for HTC_001?
Click to expand...
Click to collapse
from the CID, I assume your in Europe somewhere. What is your location and carrier?
Others that I saw with that CID said there is no RUU for that CID yet. I am not sure is that has changed or not. You will have to read through this thread:
http://forum.xda-developers.com/showthread.php?p=39588860
They at least have a nandroid backup of a HTC__001 so you could restore that and as long as your hboot, splash screen and firmware are stock, you could proceed with relocking.
isnt it possible to get completly back to the way it was by putting back a nandroid backup by clockwork? (by starting clockwork, not with the flashed version)
borgqueenx said:
isnt it possible to get completly back to the way it was by putting back a nandroid backup by clockwork? (by starting clockwork, not with the flashed version)
Click to expand...
Click to collapse
Not impossible. I just went back to stock on my first HTC One using TWRP. After restoring I flashed the stock recovery, used revone to lock the bootloader and put S-ON.

How To Correctly Apply OTA Updates

I should ask for a sticky for this but these instruction will work EVERY TIME if you are running either custom recovery or Root.
You will need the latest adb/fastboot from google, you can either install the SDK or download any of the many smaller adb/fastboot and libs for your OS
You will need STOCK 4.4/4.3/4.2 recovery depending on what version of android you are currently on. Download the factory image from here. Open the zip within the package and pull out recovery.img and rename it stockrecovery.img
Copy your custom recovery to the adb folder name it twrp.zip or short name for whatever you are using I am using twrp.
You will need the correct OTA you are seeking to apply - rename it to something short simple and obvious - for this example I will use otaupdate.zip
If you wish to root get the latest patch (I believe its up to 1.75 now) and copy it to the adb/fastboot folder.
BACKUP YOUR DEVICE FIRST AND COPY IT TO YOUR PC
If you are already Rooted:
If you are using SuperSU - go to the application options and completely unroot and reboot if needed
BACKUP YOUR DEVICE FIRST AND COPY IT TO YOUR PC
If not rooted start here:
I am assuming most of you are Windows users. Open your file explorer and open the ADB folder.
On the left hand folder where ADB is located, press shift and right click the ADB folder and select "Open command window from here". This will open a command prompt window for you to run all your adb/fastboot commands from. This is the same folder where you copied your recoveries and updates to.
BACKUP YOUR DEVICE FIRST AND COPY IT TO YOUR PC
Copy your custom recovery and stock recovery to your adb folder
Copy and rename the OTA to the adb folder
Copy your root.zip patch to the /sdcard downloads folder (if you wish root)
>adb reboot bootloader - if you are already stuck in bootloop you can attempt >fastboot reboot-bootloader to run these steps
>fastboot flash recovery stockrecovery.img
>fastboot reboot-bootloader
Go into recovery and wait till dead droid appears
Press power and Volume Up at same time to go into the stock recovery menu
Using the volume buttons move and down the blue list of options and select: Apply update from ADB
You will now have orange text at the bottom of the screen - follow the instructions to side load by typing >adb sideload otaupdate.zip in your command prompt window
Wait and watch the progress, at this point you should see the ota processing steps of which there a few and will vary depending on the package. When its complete there will be a "install complete" or similar message
Reboot and let the update complete the system optimizations and go in validate your device is working and the version is what you wanted
>adb reboot bootloader
>fastboot flash twrp.zip
>fastboot reboot-recovery
Using your newly installed custom recovery you can now apply zips/root etc
Reboot as needed and update root if using older .zip to current binaries and enjoy your updated device.
And yes you only need to backup once prior to starting but many people skip that step -DON'T BE ONE OF THOSE PEOPLE.
Hopefully I've not missed a bit.
You can also use these same instructions if you're stuck in boot loop or applied a patch without first replacing stock or unrooting - just boot to bootloader using fastboot and replace recovery and apply the patches. This will usually work just fine and prevent much heart ache on your part.

[GUIDE] Unlock/Flash/Root for the Pixel 2 (walleye)

Introduction
Hello everyone, this is a guide to assist you with customizing your Pixel 2! I will be going over installing fastboot and adb, unlocking your bootloader, how to flash the factory images for clean flashes and upgrades, and how to root. Please feel free to ask any questions if you need clarification. Enjoy!
This information has been distilled from Google's official factory image site and the Magisk thread.
Installing fastboot and adb
Thankfully, Google has provided just adb, fastboot, and systrace as a simple zip file, making this process super easy. You MUST be on at LEAST 26.0.2 for the commands in this guide to work. When in doubt, grab the latest copy and install them using the following instructions.
SDK Platform-Tools for Windows
SDK Platform-Tools for Mac
SDK Platform-Tools for Linux
Windows:
Unzip the folder somewhere on your hard drive.
Go to the folder containing the adb and fastboot files and type "cmd" in the path bar at the top.
A command prompt should open with the current folder showing on the prompt.
Type the following commands:
Code:
adb --version
fastboot --version
You should see some information appear. If that is the case, you were successful!
Mac/Linux:
Unzip the folder somewhere on your hard drive.
Navigate to that folder with your terminal.
Run the following commands:
Code:
sudo install adb dmtracedump e2fsdroid etc1tool fastboot hprof-conv make_f2fs mke2fs mke2fs.conf sload_f2fs sqlite3 /usr/local/bin
sudo mkdir -p /usr/local/lib64
sudo install lib64/libc++.so /usr/local/lib64
Type the following commands:
Code:
adb --version
fastboot --version
You should see the version information, along with telling you they are installed to /usr/local/bin. If so, you were successful!
Unlocking the bootloader
WARNING: This WILL wipe your entire phone. Please make copies or backups of any important data. This can also go wrong rendering your device inoperable. Proceed with caution.
On your phone, open Settings, navigate to "System" then "About phone", and tap on the build number 7 times.
Go one menu up, click on "Developer options", and turn on USB debugging and OEM unlocking.
In your terminal, type the following command:
Code:
adb reboot bootloader
Run the following command:
Code:
fastboot flashing unlock
Follow the prompts on your device then reboot!
Flashing factory images
NOTE #1: You CANNOT downgrade factory images. Google has prevented users from doing so to keep them safe from vulernabilities that were patched. You should only upgrade or reinstall the current image.
NOTE #2: If you have mounted /system as rw at any point (like in TWRP), you must upgrade using the factory image method. OTAs will fail because they cannot verify the integrity of the disk since its verity data has been changed.
NOTE #3: Flashing the factory images requires an unlocked bootloader. Flashing the OTA zips does not (but if anything goes wrong, you may not be able to recover without an RMA).
Updating to a new release (factory image):
Download the latest factory image from Google's website.
Reboot into the bootloader:
Code:
adb reboot bootloader
Unzip the factory image.
Inside you will see a bootloader image, a radio image, an image zip file, and a couple of flash scripts.
If you are on Windows, open the "flash-all.bat" file in a text editor. If you are on Mac or Linux, open the "flash-all.sh" instead.
Remove the "-w" flag before the fastboot command towards the end of the file. This will prevent fastboot from formatting your device.
Run the flash all script! Open a command prompt, navigate to the folder with the script, and run one of the following commands:
Windows:
Code:
flash-all
Mac/Linux:
Code:
./flash-all.sh
Reboot once it is finished!
Updating to a new release (OTA zip):
Download the latest OTA zip from Google's website
Reboot into recovery:
Code:
adb reboot recovery
Hold down the power button and push volume up
Select "Apply update from ADB"
Run the following command from the folder containing the OTA zip:
Code:
adb sideload <zip_name>.zip
Reboot once it is finished!
Clean flashing a factory image (wipe everything):
Download the latest factory image from Google's website
Reboot into the bootloader:
Code:
adb reboot bootloader
Unzip the factory image.
Run the flash all script! Open a command prompt, navigate to the folder with the script, and run one of the following commands:
Windows:
Code:
flash-all
Mac/Linux:
Code:
./flash-all.sh
Reboot once it is finished!
Rooting with Magisk
NOTE #4: This section assumes you are not going to install TWRP. If you are, skip to the next section and just flash the latest Magisk zip after installing TWRP.
Download the Magisk zip from the official thread and install the manager from the zip.
Grab a boot image to patch (either the one from the latest factory image or a custom kernel one) and push it to your device:
Code:
adb push <path_to_file> /sdcard/Download
Open Magisk Manager and click the Install button.
Click "Install" at the first prompt then choose "Patch Boot Image File". A file manager will pop up.
Select the boot image you want to patch and let Magisk Manager patch it.
Pull it off your device:
Code:
adb pull /sdcard/MagiskManager/patched_boot.img
Reboot into the bootloader:
Code:
adb reboot bootloader
Flash the boot image and reboot.
Code:
fastboot flash boot patched_boot.img
fastboot reboot
Open Magisk Manager and you should be rooted!
Installing TWRP
NOTE #5: If you just want to temporarily boot TWRP to flash Magisk and your custom kernel, you can just skip flashing the installer zip in this process.
NOTE #6: TWRP can be unstable at times given the way that security has been set up on this device (lack of decryption, failing to boot, etc).
Download both the TWRP image and zip installer from the official site.
Temporarily boot the TWRP image.
Code:
fastboot boot <path_to_twrp_image>
Flash the TWRP installer zip.
Reinstall Magisk and your custom kernel if you had them.
Reboot and profit!
Common issues
Outdated fastboot/adb: This device requires the latest fastboot and adb binaries to work properly. A lot of common quick adb/fastboot installation guides link to installers that are old. Please manually install the latest using the information at the beginning of the thread!
Using a USB-3.0 or USB-C port: Some newer USB ports do not work with fastboot. Issues manifest as weird errors during a flash. Use a different USB cable/port.
Closing statements
If there are any procedures you would like to see added (like flashing a custom kernel or booting TWRP), I am happy to add them if requested. Also, when requesting help, please be as specific as possible where you get confused. I want this guide to be clear as possible.
Reserved
Reserved
Stuck on this step
Run the flash all script! Open a command prompt, navigate to the folder with the script, and run one of the following commands:
How do I navigate in command prompt? When I typed flash-all, it said it is not a internal command etc. When I dragged and dropped flash-all into the command prompt, it said C:\Users\W Balls\Downloads\SAMPWND_SYSTEMROOT_ADB_FILES>"C:\Users\****** Jim\Downloads\walleye-opd1.170816.025-factory-4752baae\walleye-opd1.170816.025\flash-all.bat"
error: cannot load 'bootloader-walleye-mw8998-002.0059.00.img'
rebooting into bootloader...
OKAY [ 0.004s]
finished. total time: 0.004s
error: cannot load 'radio-walleye-g8998-00122-1708311414.img'
rebooting into bootloader...
OKAY [ 0.010s]
finished. total time: 0.015s
W/ ( 6448): Unable to open 'image-walleye-opd1.170816.025.zip': No such file or directory
error: failed to open zip file 'image-walleye-opd1.170816.025.zip': I/O Error
Press any key to exit...
You are calling the flash-all.bat out of a differende directory (C:\Users\W Balls\Downloads\SAMPWND_SYSTEMROOT_ADB_FILES) therefore it can't find the system image files since they are located under C:\U sers\****** Jim\Downloads\walleye-opd1.170816.025-factory-4752baae\walleye-opd1.170816.025. Make sure you extract your image to that directory, open up a command promt and navigate to it with "cd C:\Users\W Balls\Downloads\SAMPWND_SYSTEMROOT_ADB_FILES" and call the flash-all.bat from there.
Check out this for basic command line stuff https://www.digitalcitizen.life/command-prompt-how-use-basic-commands
---------- Post added at 10:58 AM ---------- Previous post was at 10:56 AM ----------
I tried this and it seems the magisk manager isn't able to download magisk on its own at least on my device:
Code:
DownloadManager: [356] Stop requested with status HTTP_DATA_ERROR: Unable to resolve host "forum.xda-developers.com": No address associated with hostname
DownloadManager: [356] Finished with status WAITING_TO_RETRY
EDIT: Seems like DNS66 was blocking the download patching was scucessfull now.
This is weird, can't I make 2 posts in a row??
Anybody figure out a solution for flashing when on MacOs High Sierra? Platform tools 26.0 1 was a fix for high Sierra, yet 26.0.2 seemed to have lost that commit, so fastboot doesn't work at all. Wondering if it's safe to use 26.0.1 on the pixel 2
nathanchance said:
Flashing factory images
Click to expand...
Click to collapse
First, thanks for putting this together. I've rooted using your method.
Regarding OTA updates: I've read that if we've rooted, we will need to un-root before we can receive an OTA update. Is this always true, or only if we've installed a custom recovery like TWRP? It would be really handy to have a guide on how to un-root, update, then re-root.
Related - let's say that for whatever reason, we have to flash an OTA update manually, rather than actually getting it OTA. Do we lose root by doing so?
Thanks!
JayBlack_686 said:
First, thanks for putting this together. I've rooted using your method.
Regarding OTA updates: I've read that if we've rooted, we will need to un-root before we can receive an OTA update. Is this always true, or only if we've installed a custom recovery like TWRP? It would be really handy to have a guide on how to un-root, update, then re-root.
Related - let's say that for whatever reason, we have to flash an OTA update manually, rather than actually getting it OTA. Do we lose root by doing so?
Thanks!
Click to expand...
Click to collapse
Magisk's OTA section should clear up some of your doubts: https://github.com/topjohnwu/Magisk/blob/master/docs/tips.md#ota-installation-tips
nathanchance said:
Magisk's OTA section should clear up some of your doubts: https://github.com/topjohnwu/Magisk/blob/master/docs/tips.md#ota-installation-tips
Click to expand...
Click to collapse
Looks really straightforward, thank you! Might be cool to point to it in the OP. I bet I'm not the only one who was only vaguely aware of the impact that rooting has on how we get OTAs. Then again, maybe everyone else wants to run custom ROMs.
JayBlack_686 said:
Looks really straightforward, thank you! Might be cool to point to it in the OP. I bet I'm not the only one who was only vaguely aware of the impact that rooting has on how we get OTAs. Then again, maybe everyone else wants to run custom ROMs.
Click to expand...
Click to collapse
Good point, I'll add it here in a bit
Sent from my Pixel 2 XL using XDA Labs
OTA vs factory image
Howdy,
really appreciate @nathanchance for putting this together. Would you mind adding a few lines about the differences between OTA and factory images. As a layman i haven't got the foggiest idea which route to go and would appreciate some wisdom. Thanks!
Thank you so much for this guide but can anybody please explain how you can tell which image to patch ?
I am unable to get this to work magisk is showing this message: stock kernel cannot be patched please use a custom kernel
i downloaded: walleye-opd1.170816.010-factory-63083164.zip
unsure as to whether this is correct for my phone as they are quite a few and its unclear how to tell
i have a pixel 2 from the UK that was factory unlocked and i unlocked the boot loader
what am i doing wrong please help
tango650 said:
Howdy,
really appreciate @nathanchance for putting this together. Would you mind adding a few lines about the differences between OTA and factory images. As a layman i haven't got the foggiest idea which route to go and would appreciate some wisdom. Thanks!
Click to expand...
Click to collapse
The primary difference is that the OTA can be flashed on an unlocked bootloader and is designed not to wipe your phone.
UpGrad3 said:
Thank you so much for this guide but can anybody please explain how you can tell which image to patch ?
I am unable to get this to work magisk is showing this message: stock kernel cannot be patched please use a custom kernel
i downloaded: walleye-opd1.170816.010-factory-63083164.zip
unsure as to whether this is correct for my phone as they are quite a few and its unclear how to tell
i have a pixel 2 from the UK that was factory unlocked and i unlocked the boot loader
what am i doing wrong please help
Click to expand...
Click to collapse
Are you supplying the boot image to Magisk? Show me a screenshot of what Magisk says when it tries to patch.
Thanks @nathanchance for this. I'm not a technical person, but can follow directions. This is the 4th phone that I've rooted following directions of some very smart and talented people here on XDA. I don't do this kind of thing everyday, and am not up on programming or coding or whatever you guys call it now days.
All I ended up doing is taking the OTA from Google to the .025. Then followed the Magisk rooting instructions to get root. I had Unlocked it the first day I turned the phone on, I haven't put my SIM in yet, but will play around with it a little more, and finish setting it up,
Again, thanks for the GUIDE to this Pixel 2 phone.
nathanchance said:
The primary difference is that the OTA can be flashed on an unlocked bootloader and is designed not to wipe your phone.
Are you supplying the boot image to Magisk? Show me a screenshot of what Magisk says when it tries to patch.
Click to expand...
Click to collapse
That is what i get. I have even flashed the whole factory image to the phone and still get this
@UpGrad3 you need to extract the boot.img out of your zip (walleye-opd1.170816.010-factory-63083164.zip) file and process this one, I'll guess you tried with the whole zip?? Also you can "attach" pictures to the post and not include the full res with the image tags...
@drmason I did extract the img from the zip. I followed the instructions exactly which is why im so confused as to what is going on ? Ok sorry i will do in future.
Amended post
UpGrad3 said:
@drmason I did extract the img from the zip. I followed the instructions exactly which is why im so confused as to what is going on ? Ok sorry i will do in future.
Amended post
Click to expand...
Click to collapse
You got the boot.img from the zip file that was inside the zip file?
from https://forum.xda-developers.com/showpost.php?p=74429474&postcount=90
Step by step
1. Download and extract factory image. Mine was taimen-opd1.170816.010-factory-c796ddb4.zip
***2. Once extracted go into the folder and extract image-taimen-opd1.170816.010.zip.
There you will find the boot.img.
---------- Post added at 08:36 AM ---------- Previous post was at 08:27 AM ----------
nathanchance said:
Good point, I'll add it here in a bit
Sent from my Pixel 2 XL using XDA Labs
Click to expand...
Click to collapse
@nathanchance, one more suggestion for the OP: at one point I was looking at using the stock boot img and couldn't figure out how to get it. Later, I found the below post, where the first two steps are essentially "open the zip inside the zip for the boot.img" to extract the stock boot image. Maybe it's really obvious, but I didn't get it.
https://forum.xda-developers.com/showpost.php?p=74429474&postcount=90
@UpGrad3 you are using the latest Magisk Manager 5.4.1 for this?
JayBlack_686 said:
You got the boot.img from the zip file that was inside the zip file?
from https://forum.xda-developers.com/showpost.php?p=74429474&postcount=90
Step by step
1. Download and extract factory image. Mine was taimen-opd1.170816.010-factory-c796ddb4.zip
***2. Once extracted go into the folder and extract image-taimen-opd1.170816.010.zip.
There you will find the boot.img.
---------- Post added at 08:36 AM ---------- Previous post was at 08:27 AM ----------
this is where i was going wrong i was using a file that had bootloader in the name rather than going into the second zip and finding boot
@nathanchance, one more suggestion for the OP: at one point I was looking at using the stock boot img and couldn't figure out how to get it. Later, I found the below post, where the first two steps are essentially "open the zip inside the zip for the boot.img" to extract the stock boot image. Maybe it's really obvious, but I didn't get it.
https://forum.xda-developers.com/showpost.php?p=74429474&postcount=90
Click to expand...
Click to collapse
drmason said:
@UpGrad3 you are using the latest Magisk Manager 5.4.1 for this?
Click to expand...
Click to collapse
yes i was
although im now stuck on the bootscreen with the G any suggestions ?
Fixed.
incase it happens to anyone else. i restored the factory image again then started the root procedure. im now rooted and fully working

[GUIDE] Flash Firmware/Update Bootloader to 3.19 - S-ON, no Stock OS

This procedure has only been tested with my personal TMOB101 - x.xx.111.x Phone
Since there was no guide on how to do it I mixed and matched what I found to my personal needs.
Use at own risk
I doubt many people will need this but this might end some hour-long research sessions and save the sanity of a couple of people.
Requirements:
-PC with USB 2.0 ports
-unlocked bootloader
-HTCDev Account to lock/unlock bootloader
-Installed One M8 Drivers
-Uninstalled HTC Sync (not disabled)
-Portable Minimal ADB & Fastboot
-htc_fastboot.exe https://drive.google.com/file/d/0B8L4pkbzdlR3eTlJSjdKVEdHX1U/view source: @EddyOS here
-Signed Firmware.zip matching your phones CID
-S-OFF not required
If there are multiple firmware updates I strongly suggest to flash them in succeeding order
Step 1. - preparation:
Create a folder containing Portable Minimal ADB & Fastboot
Download htc_fastboot.exe and place it in the same folder
Download your required firmware zip file and place it in the same folder, rename it to firmware.zip
Step 2. - execution
start your phone in bootloader mode by pressing the power and the volume down button
connect it to an USB 2.0 port
Run cmd-here.exe from the minimal ADB & Fastboot package as admin.
reboot to bootloader
Code:
fastboot reboot-bootloader
lock bootloader
Code:
fastboot oem lock
reboot to RUU
Code:
fastboot oem rebootRUU
Your phone should reboot to display a silver HTC logo
Flash firmware update using htc_fastboot
Code:
htc_fastboot zip firmware.zip
wait until the phone indicates the finished process
reboot to bootloader
Code:
fastboot reboot-bootloader
Unlock bootloader following HTCs instructions
https://www.htcdev.com/bootloader/unlock-instructions
Flash your desired recovery and your desired rom as usual afterwards
_____________________________________________________
Useful to know:
I had no backup to stock available and wanted to upgrade my old phone from an outdated CMod build to a more recent LineageOS build that required Bootloader 3.19 - my version was 3.18
Whats your cid?
Code:
fastboot oem readcid
What firmware version does my CID require?
Check out @ckpv5 s post here
What is the purpose of flashing TWRP in this guide?
redpoint73 said:
What is the purpose of flashing TWRP in this guide?
Click to expand...
Click to collapse
good point, there is no purpose in flashing TWRP. I wrote this down at like five in the morning just as I did this after tinkering the whole night.
I will remove the step in the guide
You realize there are already instructions at the bottom of ckpv5's thread Post #5?
https://forum.xda-developers.com/showpost.php?p=60218734&postcount=5
redpoint73 said:
You realize there are already instructions at the bottom of ckpv5's thread Post #5?
https://forum.xda-developers.com/showpost.php?p=60218734&postcount=5
Click to expand...
Click to collapse
This did not work for me - either that or I messed up at some point.
upM8 said:
This did not work for me - either that or I messed up at some point.
Click to expand...
Click to collapse
Definitely pilot error. Maybe just some nuance you missed. This process has been done successfully by probably hundreds of users.

Categories

Resources