[tutorial] How to get back on stock with TWRP Stock Nandroid Backups

metafizik

Member
Mar 28, 2014
47
3
0
Wilson, NC, US
Could someone please tell me which of the Marshmallow TWRP Nandroid backups I need to restore to get the Android 6.x firmware on my wifes HTC One M8 (carrier is Cricket/AT&T network)? My CID is 11111111.

I made the mistake of restoring a stock KitKat Nandroid firmware and when I restored a Marshmallow Viper backup I had the WiFi doesn't work. I have never been able to get that Windows RUU Firmware to work & have no desire to boot any of my systems into Windows to try that again. I just need to get the firmware up to the latest stock so I can restore Viper again and have everything working. I don't care which one I restore as long as it is GSM since I will be immediately restoring a Marshmallow custom ROM
 

xunholyx

Recognized Contributor
Dec 3, 2012
7,501
5,131
253
Vancouver
Could someone please tell me which of the Marshmallow TWRP Nandroid backups I need to restore to get the Android 6.x firmware on my wifes HTC One M8 (carrier is Cricket/AT&T network)? My CID is 11111111.

I made the mistake of restoring a stock KitKat Nandroid firmware and when I restored a Marshmallow Viper backup I had the WiFi doesn't work. I have never been able to get that Windows RUU Firmware to work & have no desire to boot any of my systems into Windows to try that again. I just need to get the firmware up to the latest stock so I can restore Viper again and have everything working. I don't care which one I restore as long as it is GSM since I will be immediately restoring a Marshmallow custom ROM
CID is 11111111, so you are S-Off I presume? Well, wiping your phone is probably not a concern for you now, so it would probably be best for you to just flash an RUU.
You can flash any RUU since you are S-Off (I presume), but here is the RUU.zip for the AT&T version.
 
Last edited:
  • Like
Reactions: mrrocketdog

metafizik

Member
Mar 28, 2014
47
3
0
Wilson, NC, US
CID is 11111111, so you are S-Off I presume? Well, wiping your phone is probably not a concern for you now, so it would probably be best for you to just flash an RUU.
You can flash any RUU since you are S-Off (I presume), but here is the RUU.zip for the AT&T version.
Thank you for that xunholyx. Should I flash this zip with fastboot or can I use TWRP? I am guessing not TWRP as I presume it will replace the recovery?
 

xunholyx

Recognized Contributor
Dec 3, 2012
7,501
5,131
253
Vancouver
Thank you for that xunholyx. Should I flash this zip with fastboot or can I use TWRP? I am guessing not TWRP as I presume it will replace the recovery?
There are two ways to flash it.
The easiest way is to rename the RUU.zip by removing everything in the name of it except for 0P6BIMG (and .zip of course), putting that into the root of your extSD card (by "root of" I mean just on the card and not in a folder), and booting to bootloader. The process should start automatically.

You can also flash it in RUU mode
adb reboot bootloader
fastboot oem rebootRUU
fastboot flash zip **drag and drop the RUU.zip here**


You might get a fail without flashing the firmware first, (I seem to recall that with the M8 and the Marshmallow update)

Since you are going to flash a custom ROM anyway, you could also just flash the firmware alone, and not the RUU.zip. You can get the AT&T firmware.zip from here. It's a no-wipe firmware, so you won't lose anything like you would with flashing the RUU.
To flash the firmware, use one of the two methods I outlined above.

Good luck!
 

Bob in the UK

New member
Sep 9, 2013
2
2
0
Thank you to both Einwood and Redpoint73 for taking the time and trouble to read and answery my query #2538.

Just got back from a short break late yesterday and I followed what you suggested Redpoint73.

The phone is up and running as should be. It seems obvious now – DOH !!! :eek:

Genuinely grateful to you for you helping a noob.
 

redpoint73

Recognized Contributor
Oct 24, 2007
15,259
6,946
113
The phone is up and running as should be. It seems obvious now – DOH !!! :eek:

Genuinely grateful to you for you helping a noob.
The process (and your questions) were far from obvious. You were right to stop and ask. Nice work getting it done! And you're quite welcome.

---------- Post added at 09:33 AM ---------- Previous post was at 09:27 AM ----------

I just need to get the firmware up to the latest stock so I can restore Viper again and have everything working. I don't care which one I restore as long as it is GSM since I will be immediately restoring a Marshmallow custom ROM
Which firmware you flash matters quite a bit (not just GSM) as band support is determined in firmware for this device. xunholyx has you covered on that note (AT&T firmware). Flashing almost any other (except AT&T) will likely result in not having LTE, or not having data (3G) at all, since those bands are pretty much AT&T specific. Or for that matter not phone service at all, since I believe AT&T has shut off GSM in most regions at this point?
 
  • Like
Reactions: mrrocketdog

tasifahmed

Member
Dec 2, 2015
6
0
0
johor bahru
which firmware you installed for that ?

Sorry to bother you, Actually i was very confused between these RUU and Backup's. Thanks for support bro "Ckpv5"
Now Restored Htc one m8 Eye with stock Rom thanks for sharing
Relocked S-On
Hboot: 3.19
Radio: 1.29.213311711.15G
OS : 5.07.401.1
HTC One M8 Eye
modelid: 0P6B81000
cidnum: HTC__J15
many thanks for supporting
hello need to know about the firmware version
 

Alex IvanoVVV

Member
Jan 20, 2019
6
0
0
Favorite HTC One (M8)

Hello ckpv5. Please tell me the sequence of actions. What forward you need to download for my "HTC One (M8)". You really are a cool person. Here is the information:
Code:
fastboot getvar all
Code:
C:\Users\Алекс>fastboot getvar all
(bootloader) version: 0.5
(bootloader) version-bootloader: 3.19.0.0000
(bootloader) version-baseband: 1.29.214500021.12G
(bootloader) version-cpld: None
(bootloader) version-microp: None
(bootloader) version-main: 6.12.401.4
(bootloader) version-misc: PVT SHIP S-ON
(bootloader) serialno: SH***
(bootloader) imei: 35***
(bootloader) imei2: Not Support
(bootloader) meid: 00000000000000
(bootloader) product: m8_ul
(bootloader) platform: hTCBmsm8974
(bootloader) modelid: 0P6B10000
(bootloader) cidnum: HTC__032
(bootloader) battery-status: good
(bootloader) battery-voltage: 0mV
(bootloader) partition-layout: Generic
(bootloader) security: on
(bootloader) build-mode: SHIP
(bootloader) boot-mode: FASTBOOT
(bootloader) commitno-bootloader: 76df2b54
(bootloader) hbootpreupdate: 11
(bootloader) gencheckpt: 0
all: Done!
Finished. Total time: 0.031s
Unable to lock the boot loader to try flash RUU
Code:
fastboot oem lock
Code:
C:\Users\Алекс>fastboot oem lock
(bootloader) [PGFS] partition_update_pgfs: pg1fs_security
(bootloader) TZ_HTC_SVC_ENC ret = 0
(bootloader) [PGFS] partition_update_pgfs: pg2fs_sec_recovery
(bootloader) Lock successfully...
(bootloader) deinit_lcd
(bootloader) mipi display off
(bootloader) mdp_clock_off
(bootloader) turn off fd8c2308 failed 1 times. Try again...
(bootloader) disable_mmss_clk done
(bootloader) pll1_disable done
(bootloader) TZ_HTC_SVC_DISABLE ret = -1610744452 (0x9FFDFD7C)
(bootloader) [CRITICAL] SPMI write command failure:
        cmd_id = 0, error
(bootloader) = 4
(bootloader) [CRITICAL] SPMI write command failure:
        cmd_id = 0, error
(bootloader) = 4
(bootloader) [ERR]  Cannot halt SPMI arbiter!!
(bootloader) [INFO] Rebooting device
FAILED (Status read failed (Unknown error))
Finished. Total time: 1.252s
Thank you for understanding.
 

Einwod

Senior Member
Mar 1, 2011
4,260
2,131
253
61
Lardos, Rhodes, Greece.
Hello ckpv5. Please tell me the sequence of actions. What forward you need to download for my "HTC One (M8)". You really are a cool person. Here is the information:



Unable to lock the boot loader to try flash RUU


Thank you for understanding.
Everything you need to do is in the first 5 posts. Simply read, read again and follow the instructions. It's in plain English and could not be made any easier.
 

Gor-

New member
Feb 28, 2017
4
0
0
Many thanks

This post has been quite useful.

I spent the last few days trying to root the HTC One M8 without success, despite following each step of the Hansoons tool, i.e. getting to unlock the bootloader, installing TWRP, and after installing supersu via recovery. Each time I installed the SuperSU, I still got a message to the effect that SU binary not found or installed hence it could not work. I really needed to remove the abundant bloatware on the phone. In trying different SuperSU's, my phone ended up not booting fully and got stuck at the HTC logo.

These instructions, which I have tried to follow keenly seem to have led somewhere as my phone now is starting and optimizing apps. THANKS GOODNESS for you guys.

Could you kindly point me to how I could remove all the unnecessary bloatware on the software, since I did not manage to root it successfully.

THANK YOU VERY MUCH.
 

redpoint73

Recognized Contributor
Oct 24, 2007
15,259
6,946
113
This post has been quite useful.

I spent the last few days trying to root the HTC One M8 without success, despite following each step of the Hansoons tool, i.e. getting to unlock the bootloader, installing TWRP, and after installing supersu via recovery. Each time I installed the SuperSU, I still got a message to the effect that SU binary not found or installed hence it could not work. I really needed to remove the abundant bloatware on the phone. In trying different SuperSU's, my phone ended up not booting fully and got stuck at the HTC logo.
Few pointers here:

1) I don't personally recommend the toolkit. It doesn't do anything that you can't manually do yourself: one line fastboot commands. And doing them yourself is a valuable learning experience. As you have probably found, using a toolkit doesn't help much, when things go wrong (where some of those skills like fastboot commands start to come in handy).

Just as important, the toolkit contains very old versions of TWRP and SuperSU. Using an outdated version of either, is likely going to cause you big problems. Using old versions of both, well I think you can see where this is going . . .

2) Before trying to root, you should have made a backup of your stock ROM using TWRP. It's nice that this thread exists, for those that neglect this step. But it really is best practice to back it up yourself, rather than rely on the generosity of strangers. Put another way: always have a backup plan/escape plan, or otherwise know to get back to stock before trying to root or do other mods.

3) Correct version of TWRP and SuperSU may depend on your current firmware version. For the best (most specific) advice, do fastboot getvar all, and post the result here (delete IMEI and serial number before posting) so we can see more info about your particular phone.

But in a lot of cases, latest TWRP 3.2.3-1 from here is recommended (flash using fastboot): https://dl.twrp.me/m8/
And latest SuperSU 2.82 from here: https://forum.xda-developers.com/apps/supersu/stable-2016-09-01supersu-v2-78-release-t3452703
But to be honest, I would suggest Magisk at this point instead of SuperSU. SuperSU looks to be dead, while Magisk is still alive and supported. And Magisk has a ton of really awesome and useful features, that SuperSU does not: https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
 
Last edited:
  • Like
Reactions: mrrocketdog

Alex IvanoVVV

Member
Jan 20, 2019
6
0
0
Favorite HTC One (M8)

Thanks for the reply Einwod.
I ask you for help.
Code:
 When executing item 9, errors appear:
 - Error opening: '/ cache / recovery / .version' (Read-only file system)
 - Process extractTarFork () Failed with error: 255
 When cleaning Data, Cache, Dalvik error:
 - Cannot mount '/ data' (Invalid argument)
I type the command "fastboot flash recovery twrp-3.2.3-1-m8.img"
Code:
C: \ adb_run \ bin> fastboot flash recovery twrp-3.2.3-1-m8.img
 Sending 'recovery' (20166 KB) OKAY [2,131s]
 Writing 'recovery' (bootloader) radio_batt_level: NOT IMPLEMENTED!
 (bootloader) Start Verify: 3
 (bootloader) Write Protect set for the region, only partial space was era
 (bootloader) sed
 OKAY [0.589s]
 Finished.  Total time: 2.720s

Tell me what's wrong. Head round rides.

I read this forum, but I did not find any clear material for myself. Maybe the translator incorrectly translates !?
 

Einwod

Senior Member
Mar 1, 2011
4,260
2,131
253
61
Lardos, Rhodes, Greece.
Thanks for the reply Einwod.
I ask you for help.

I type the command "fastboot flash recovery twrp-3.2.3-1-m8.img"



Tell me what's wrong. Head round rides.

I read this forum, but I did not find any clear material for myself. Maybe the translator incorrectly translates !?
Are you sure the bootloader is unlocked? Did you get the key from HTCdev.com?
 

Alex IvanoVVV

Member
Jan 20, 2019
6
0
0
Favorite HTC One (M8)

Yes, I received the file "Unlock_code.bin" from HTCdev.com. Yes, I unlocked the bootloader. As evidenced by the inscription in the bootloader "*** Unlocked ***". And at the top of the inscription "*** Software status: Modified ***"
I'll tell you more about my actions:
Code:
Connecting HTC One (m8) to a PC via the "Mount" function in "Recovery 3.2.3-1".  
HTC One (m8) is determined.  But I can not copy TWRP backup files to it.  
Maybe there is no internal memory?  Files backup installed from USB media, USB formatted to NTFS.
By the way, the backup was done when the phone became bad.
I have a difficult situation? I try not to do unnecessary actions, fearing to get a brick. Very happy communication. I look forward to hearing from you.
 

redpoint73

Recognized Contributor
Oct 24, 2007
15,259
6,946
113
Yes, I received the file "Unlock_code.bin" from HTCdev.com. Yes, I unlocked the bootloader. As evidenced by the inscription in the bootloader "*** Unlocked ***". And at the top of the inscription "*** Software status: Modified ***"
I'll tell you more about my actions:
Code:
Connecting HTC One (m8) to a PC via the "Mount" function in "Recovery 3.2.3-1".  
HTC One (m8) is determined.  But I can not copy TWRP backup files to it.  
Maybe there is no internal memory?  Files backup installed from USB media, USB formatted to NTFS.
By the way, the backup was done when the phone became bad.
I have a difficult situation? I try not to do unnecessary actions, fearing to get a brick. Very happy communication. I look forward to hearing from you.
You posted elsewhere, the inability to relock the bootloader, and resulting errors. This is the main reason you shouldn't post the same problem in multiple threads. Jumping around to 4 different threads, with incomplete info in each. Very confusing for those trying to help you, and as a result, confusing you as well. I posed some questions and suggestions in another thread where you posted. Are you tracking all these threads? Did you see it? Hard to tell with no response; and you jumping around to different threads.

Inability to lock bootloader, along with inability to flash TWRP, and corrupted storage; means emmc is likely fried. Probably a brick.
 

Alex IvanoVVV

Member
Jan 20, 2019
6
0
0
I apologize. Yes right, get lost easily. I fully agree with you that the topic should be one. I am not well guided on the site. Sorry again. This is my first time on the xda-developers website.
Very upset. Since I am looking for ways to launch HTC One (M8).
Is it possible to restore HTC One (M8) by other programs?
Please advise a topic for me. What is the best topic for me?
 

redpoint73

Recognized Contributor
Oct 24, 2007
15,259
6,946
113
I apologize. Yes right, get lost easily. I fully agree with you that the topic should be one. I am not well guided on the site. Sorry again. This is my first time on the xda-developers website.
Very upset. Since I am looking for ways to launch HTC One (M8).
Is it possible to restore HTC One (M8) by other programs?
Please advise a topic for me. What is the best topic for me?
If I am right about emmc failure (and all indications point to that), that is a hardware issue. So no amount of software fixes will help.

All I can suggest, is to keep trying:
1) Relock the bootloader. If successful, flash the RUU 6.12.401.4.
2) Keep trying to flash TWRP. Try different versions, as far back as 2.8.7 is okay. If successful, restore stock TWRP backup 6.12.401.4 from this subject thread.

Other than those things, I don't think there is much else you can do.

Please advise a topic for me. What is the best topic for me?
This thread is only partially relevant (not really a thread for troubleshooting a problem like yours). But seeing as you've posted there more than any other thread, my opinion would be to just leave the discussion here. If the owner of this thread (ckpv5) disagrees, then take the discussion elsewhere.
 
  • Like
Reactions: mrrocketdog

SteffJay

Member
Sep 7, 2013
10
0
0
Tried & Fail

For those who need the signed firmware, below are the Marshmallow firmware that I have :

Important : If you're flashing this Marshmallow firmware on top of a lollipop and there are two Marshmallow versions,
install the first version then follow by the second version.
Don't install directly the second version as it is only partial firmware (except fw_6.20.709.2);
without the first version is installed prior to the second version your device firmware won't be correctly updated


CID ORANG001
MID 0P6B10000
fw_6.12.61.4

CID ORANGB10
MID 0P6B10000
fw_6.14.69.4

CID ORANG309
MID 0P6B10000
fw_6.14.75.4

CID T-MOB101
MID 0P6B10000
fw_6.12.111.4

CID T-MOB102
MID 0P6B10000
fw_6.12.112.4

CID T-MOB003
MID 0P6B10000
fw_6.12.114.4

CID T-MOB009
MID 0P6B10000
fw_6.12.118.4

CID VODAP001, VODAP102, VODAPE17, VODAP405, VODAP304, VODAPD18
MID 0P6B10000
fw_6.12.161.4

CID VODAP203
MID 0P6B10000
fw_6.12.163.4

CID VODAP110 & VODAP120
MID 0P6B10000
fw_6.12.166.4

CID O2___001 & O2___102
MID 0P6B10000
fw_6.13.206.5

CID HTC__001, HTC__J15, HTC__E11, HTC__203, HTC__102, HTC__405, HTC__Y13, HTC__A07, HTC__304, HTC__032, HTC__016, HTC__M27, HTC__K18, HTC__002, HTC__A48
MID 0P6B10000
fw_6.12.401.4

CID HTC__001 & HTC__J15
MID 0P6B67000
fw_6.21.401.1 - thanks @umesh.lk

CID CWS__001
MID 0P6B12000
fw_6.20.502.5

CID T-MOB010
MID 0P6B13000
fw_6.20.531.5

CID HTC__332
MID 0P6B16000
fw_6.14.599.1

CID HTC__332
MID 0P6B16000
fw_6.17.600.3

CID ROGER001
MID 0P6B16000
fw_6.13.631.7

CID TELUS001
MID 0P6B16000
fw_6.13.661.9

CID BM___001 & SASKT001
MID 0P6B16000
fw_6.13.666.7

CID HTC__044 & HTC__059
MID 0P6B11000
fw_6.14.707.1

CID HTC__622
MID 0P6B63000
fw_6.16.708.1

CID HTC__621
MID 0P6B11000
fw_6.12.709.4
fw_6.20.709.2

CID HTC__039 & VODAP021
MID 0P6B11000
fw_6.12.710.4
fw_6.24.710.1 * install this firmware only after you have fw_6.12.710.4 already installed

CID HTC__038
MID 0P6B65000
fw_6.15.720.2

CID H3G__001, H3G__106, H3G__402, H3G__G04
MID 0P6B10000
fw_6.13.771.4

CID TELST001
MID 0P6B11000
fw_6.12.841.4
fw_6.24.841.1 * install this firmware only after you have fw_6.12.841.4 already installed

CID OPTUS001
MID 0P6B65000
fw_6.12.980.5
fw_6.24.980.1 * install this firmware only after you have fw_6.12.980.5 already installed

CID HTC__247
MID 0P6B10000
fw_6.13.1020.4

CID GLOBA001
MID 0P6B13000
fw_6.13.1500.7

CID BS_US001 & BS_US002
MID 0P6B12000 & 0P6B13000
fw_6.12.1540.4

How to install firmware :

1. You need the drivers : http://forum.xda-developers.com/showpost.php?p=64926362&postcount=4

2. If the bootloader is UNLOCKED (for S-On device only), relock it with commands:

fastboot oem lock
fastboot reboot-bootloader


If the bootloader is LOCKED, skip the above.

3. Download the official signed fw_x.xx.xxx.x.zip

4. Put the device in bootloader/fastboot mode and connect to PC, run these commands

fastboot oem rebootRUU
fastboot flash zip fw_x.xx.xxx.x.zip

you'll see ERROR/FAILED, repeat
fastboot flash zip fw_x.xx.xxx.x.zip
fastboot reboot-bootloader


then you can proceed the next step that you need to do like installing a RUU

or fastboot reboot (to directly reboot device if you already have a working OS)

Note : unlocking bootloader will wipe your internal storage, copy your files like photos, music & etc to PC first
I have tried this up to fastboot flash zip fw_6.12.61.4.zip and it failed. Tried again and still failed (see below):
C:\adb>fastboot flash zip fw_6.12.61.4.zip
target reported max download size of 1826418688 bytes
sending 'zip' (1503452 KB)...
OKAY [ 44.531s]
writing 'zip'...
(bootloader) signature checking...
FAILED (remote: 12 signature verify fail)
finished. total time: 99.775s

C:\adb>fastboot flash zip fw_6.12.61.4.zip
target reported max download size of 1826418688 bytes
sending 'zip' (1503452 KB)...
OKAY [ 44.453s]
writing 'zip'...
(bootloader) signature checking...
FAILED (remote: 12 signature verify fail)
finished. total time: 99.688s
The HTC One M8 is locked. TWPS was installed but now not available.
Please advise.
Many thanks.
 

redpoint73

Recognized Contributor
Oct 24, 2007
15,259
6,946
113
I have tried this up to fastboot flash zip fw_6.12.61.4.zip and it failed. Tried again and still failed (see below):

C:\adb>fastboot flash zip fw_6.12.61.4.zip
target reported max download size of 1826418688 bytes
sending 'zip' (1503452 KB)...
OKAY [ 44.453s]
writing 'zip'...
(bootloader) signature checking...
FAILED (remote: 12 signature verify fail)
finished. total time: 99.688s
The HTC One M8 is locked. TWPS was installed but now not available.
First of all, please don't quote a whole huge guide, most of which is not relevant to your question. I know including the post you are replying to, is default. But just delete the part that isn't relevant. You can still edit the post, so please do so, to avoid cluttering up the forum. It prevents those trying to help you, from having to scroll down through all that non-relevant text, just to read what you posted.

You sure the bootloader is locked (says RELOCKED or LOCKED at the top of the bootloader screen)?

Need more info, to know if you are flashing the right firmware. Do fastboot getvar all, and post the results (delete IMEI and serial number before posting).

You should also tell us exactly what you are trying to do. Reflash existing firmware? Upgrade from a previous version? Trying to fix any particular issue? If a particular issue, describe in detail the symptoms, everything you've done to the point (step by step, file names, etc.).
 
Last edited:
  • Like
Reactions: mrrocketdog