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

Search This thread

POCKATA

Member
Mar 11, 2012
29
6
Sofia
There is no "userdata_64G.img" file in the 64GB archive. There was a file "userdata.img" in it (and Yes I did download the correct one). So I flashed that one and it worked. Can we please update the article for clarity and to avoid confusion. Thank you!
 

Harmonaz

New member
Jun 8, 2018
1
2
Thank you

Made an account to thank you!!

Bought my OPO all those years ago, and the first thing I did was follow the instructions in a thread I found on the OP forums to install the Mahdi ROM. I know nothing about these things, but the instructions were pretty easy to follow and after an hour or so I had a OPO that I loved to bits and used very happily up until a few months ago. Maybe it was due to the fact that the ROM never got updated, but basically the phone would randomly restart, get into boot loops, refuse to open certain apps etc etc.

Being the noob that I am, I had no idea or the courage to try and install a more up to date custom ROM. Then I decided that I don't need root or anything - I'd just be happy to go back to stock and be able to use apps again.

Even that appeared to be a daunting task based on the search results I would get when trying to figure out how to restore my phone back from that weird state.

Anyway, I'll spare any further details and just say that your script and instructions have worked a charm and I can now use my phone like a OPO again :laugh:

Looking forward to going home and playing with my OPO again.

Thank you so much :good:
 

EddyOS

Senior Member
Jan 2, 2010
15,281
4,031
London
There is no "userdata_64G.img" file in the 64GB archive. There was a file "userdata.img" in it (and Yes I did download the correct one). So I flashed that one and it worked. Can we please update the article for clarity and to avoid confusion. Thank you!

Do you mean the filename is userdata.img in both but the script in the 64GB one is looking for userdata_64G.img?
 

KuldeepShivankar

Senior Member
Jul 14, 2017
301
35
Balaghat
Hello, i was on Android Pie rom and yesterday my phone's battery got low and then phone shutdown. After charging it to 100% my phone is not booting up. Actually my power button is damaged so i cannot press it properly. But i think my phone is bricked. I've Fastboot installed on my laptop but as i told you i cannot boot into recovery or Fastboot because of power button issue. So can i executive flash all.bat command without going into Fastboot mode?
 

jayeshwpatil

New member
Sep 26, 2016
1
0
thanks . its working properly

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: be471f6bfc707f86a0af1eb175ec9aad

ZNH2KAS3P0 64GB: DOWNLOAD
md5: c371bc0cb4ef67999d21f5275c5a587b

*** 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.img (the filename is the same in both ZIPs so make sure you're using the right one for your device)
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! :D

THANKS once again, its really helpful........ :)
 

linggeaskrish

New member
Jan 29, 2015
2
0
SIM detected but no service

Wifi and Bluetooth seem to work. Tried multiple SIM cards from other providers, did not work.

I've tried flashing the the EFS I backed up in 2017 when I got the phone but to no avail. Current baseband is D1.3.0.c6-00241-M8974AAAAANAZM-1. I wish to eventually flash lineageos 17.1. Any help is much appreciated
 

tarataika77

New member
Aug 18, 2020
1
0
Problem while fastboot flash boot boot.img

Please help. I'm stuck at this step. My phone stays only on recovery mode. I've tried also with " boot_a boot.img" / "boot__a boot.img" but no success.

view
 
Last edited:

SpyroDaddy

New member
Feb 4, 2020
2
1
Stock Recovery

Download OnePlusOne tool.

Extract the stock recovery zip into where your tool.exe is.

Step 1: Make sure debugging is on.
Step 2: Power off and unplug USB.
Step 3: fastboot..volume up and power button together.
Step 4:plug in usb and run flash.bat file in you tool folder.
Step 5: Be patient and let it do its thing. It might take 30min or so.
Step 6: Then follow the steps to lock the bootloader.

For me....i didnt have to lock or disable. After it was done i just powered off my phone and pressed volume down and power button and it accessed the stock version of recovery mod.
 
Last edited:

deathblade

Senior Member
Dec 19, 2011
1,552
406
Nexus 7 (2013)
OnePlus One
So i just tried this and I got the following error when flashing the boot.img

Code:
fastboot: error: Couldn't parse partition size '0x'.

Any ideas?

EDIT: I found the solution instead of running
Code:
 fastboot flash boot boot.img

I had to run
Code:
 fastboot flash:raw boot boot.img
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 349
    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: be471f6bfc707f86a0af1eb175ec9aad

    ZNH2KAS3P0 64GB: DOWNLOAD
    md5: c371bc0cb4ef67999d21f5275c5a587b

    *** 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.img (the filename is the same in both ZIPs so make sure you're using the right one for your device)
    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! :D
    11
    OP updated with new packages :)
    8
    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 :D

    EDIT: Actually, it's a bit redundant as why would you need this if you're NOT unlocked! I'll edit the OP
    7
    Looks like this thread will not be continued after the collapse of Cyanogen but if anyone notices a final stock build let me know and I'll do one last repack :)
    5
    Once the 38R factory images are released I'll update the OP :)