FORUMS
Remove All Ads from XDA

[GUIDE] Return your OPO to 100% Stock (Current Build - CM13.1.2 - ZNH2KAS3P0)

15,277 posts
Thanks Meter: 4,017
 
By EddyOS, Senior Member on 24th July 2014, 12:35 PM
Post Reply Email Thread
So, you've unlocked your bootloader and are enjoying some rooted goodness on your phone. You then realise you've got an issue with the phone and forgot to make a backup of your stock ROM! Not to fear, this guide is for you! This will reset the phone back to it's out-the-box state, locked bootloader and all, running the latest ZNH2KAS3P0 build so you can return it for RMA/sell it. This also works to go back to CM13.1.2 from Oxygen OS.

It's recommended that you have adb/fastboot in your System Path. This makes it easier to run commands as you don't always have to 'in' your adb/fastboot folder to run the commands. This guide should help you with this but if you don't want to do this, please copy/extract any files into your adb/fastboot folder before continuing...

1. Download the factory image

Cyanogen released the factory image for the OPO but didn't include any batch files to automate the process. I've repackaged the images into two seperate ZIPs:

ZNH2KAS3P0 16GB: DOWNLOAD
md5: C7B1FF631BF5E15FFE3F809C909AED9D

ZNH2KAS3P0 64GB: DOWNLOAD
md5: B9A63CC7E25440F65BCF2769CFAAB132

Previous images can be found HERE

*** These ZIPs are not flashable so cannot be flashed via TWRP ***

2. Extract the factory image

Using your favourite file extraction program to extract the package to your Desktop (I use 7-ZIP). *** Remember, if you don't have adb/fastboot in your Path, extract the image into your adb/fastboot folder ***

3. Flash the factory image

Once you've unlocked the bootloader, and rebooted the phone, turn the phone off and back on into fastboot mode and reconnect it to the PC. You can now run the flash-all.bat (Windows) or flash-all.sh (Linux) file. These automate the flashing process. Once complete, the phone will reboot.

*** Some users have had issues using the script in Linux so in these cases extract the ZIP file and flash each IMG individually ***

fastboot flash modem NON-HLOS.bin
fastboot flash sbl1 sbl1.mbn
fastboot flash dbi sdi.mbn
fastboot flash aboot emmc_appsboot.mbn
fastboot flash rpm rpm.mbn
fastboot flash tz tz.mbn
fastboot flash LOGO logo.bin
fastboot flash oppostanvbk static_nvbk.bin
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash userdata userdata_64G.img (or userdata.img if you have a 16GB model)
fastboot reboot

4. Reset the tamper flag/lock the bootloader

There is a flag/bit on the phone that is triggered when you unlock the bootloader and even relocking it won't change this flag back to standard. Luckily, @Mnt-XDA has a script that you can flash which resets these flags so OP/anyone else is none the wiser! To do this, read and follow THIS thread

5. Reboot the phone

Says it all really - you're done!
The Following 325 Users Say Thank You to EddyOS For This Useful Post: [ View ] Gift EddyOS Ad-Free
 
 
24th July 2014, 01:05 PM |#2  
Senior Member
Thanks Meter: 32
 
More
Quote:
Originally Posted by EddyOS

3. Unlock the bootloader on your OPO

And why do you need to unlock the bootloader to flash the factory image ????
The Following 4 Users Say Thank You to RalphLauren For This Useful Post: [ View ] Gift RalphLauren Ad-Free
24th July 2014, 01:29 PM |#3  
EddyOS's Avatar
OP Senior Member
Flag London
Thanks Meter: 4,017
 
More
Quote:
Originally Posted by RalphLauren

And why do you need to unlock the bootloader to flash the factory image ????

Because you need access to flash the partitions. If the bootloader is locked you cannot do this. If you're device is still locked from day 1, this guide isn't for you as you're already 100% stock and a factory reset will do this job just fine

EDIT: Actually, it's a bit redundant as why would you need this if you're NOT unlocked! I'll edit the OP
The Following 7 Users Say Thank You to EddyOS For This Useful Post: [ View ] Gift EddyOS Ad-Free
24th July 2014, 01:52 PM |#4  
Senior Member
Thanks Meter: 32
 
More
Quote:
Originally Posted by EddyOS

Because you need access to flash the partitions. If the bootloader is locked you cannot do this. If you're device is still locked from day 1, this guide isn't for you as you're already 100% stock and a factory reset will do this job just fine

EDIT: Actually, it's a bit redundant as why would you need this if you're NOT unlocked! I'll edit the OP

Somehow I was thinking that if the signatures match, flashing the FACTORY image would be allowed without unlocking bootloader, hence the question has arisen.

In a way, you are right that if someone is 100% stock, why to bother flash a stock...
But the reasons could be different, like from pure laboratory experiment to the unable to install OTA (for whatever reason) and need to update OS...
24th July 2014, 01:56 PM |#5  
Senior Member
Flag Around and About
Thanks Meter: 160
 
More
May be worth including this work here by Mnt-XDA

If you are returning to stock for selling / returning etc people may want to reset the tamper flag too.
The Following 2 Users Say Thank You to indesisiv For This Useful Post: [ View ] Gift indesisiv Ad-Free
24th July 2014, 01:57 PM |#6  
EddyOS's Avatar
OP Senior Member
Flag London
Thanks Meter: 4,017
 
More
Quote:
Originally Posted by RalphLauren

Somehow I was thinking that if the signatures match, flashing the FACTORY image would be allowed without unlocking bootloader, hence the question has arisen.

In a way, you are right that if someone is 100% stock, why to bother flash a stock...
But the reasons could be different, like from pure laboratory experiment to the unable to install OTA (for whatever reason) and need to update OS...

I know what you mean, but it's the same with Nexus devices - you cannot flash the image unless the bootloader is unlocked
24th July 2014, 01:57 PM |#7  
EddyOS's Avatar
OP Senior Member
Flag London
Thanks Meter: 4,017
 
More
Quote:
Originally Posted by indesisiv

May be worth including this work here by Mnt-XDA

If you are returning to stock for selling / returning etc people may want to reset the tamper flag too.

Yeah was looking to add that in at some point, this is still a work in progress as it were...I'll add it in when I get a chance

EDIT: Added
24th July 2014, 11:03 PM |#8  
Senior Member
Flag New York
Thanks Meter: 95
 
More
To make this thread more useful for those who aren't familiar with command line, make sure to tell them to:
1) Download the zip file and extract it onto desktop (what a mess)
2) command line cd desktop
3) Enter each one of those command lines
4) Be happy in the end.
24th July 2014, 11:10 PM |#9  
EddyOS's Avatar
OP Senior Member
Flag London
Thanks Meter: 4,017
 
More
Quote:
Originally Posted by lemonspeakers

To make this thread more useful for those who aren't familiar with command line, make sure to tell them to:
1) Download the zip file and extract it onto desktop (what a mess)
2) command line cd desktop
3) Enter each one of those command lines
4) Be happy in the end.

To be fair, of someone doesn't know how to do that they really shouldn't be here in the first place!

Sent from my HTC One_M8 using XDA Premium 4 mobile app
The Following 3 Users Say Thank You to EddyOS For This Useful Post: [ View ] Gift EddyOS Ad-Free
25th July 2014, 08:45 AM |#10  
Junior Member
Thanks Meter: 1
 
More
This should be a sticky!
The Following User Says Thank You to banjotrold For This Useful Post: [ View ] Gift banjotrold Ad-Free
25th July 2014, 08:54 AM |#11  
OuncE718's Avatar
Senior Member
Flag DC by way of BK
Thanks Meter: 349
 
More
Quote:
Originally Posted by banjotrold

This should be a sticky!

I agree! This definitely should be a sticky.

Sent from my One using XDA Premium 4 mobile app
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes