yashsingh1/xdaforums huggingface dataset:
[ONE General] NWKENT:
Forgive me for missing this, if it has been discussed..

The OP lists the adb flash commands to restore device to factory OS..

I found that flashing the command lines as listed to cause a fastboot.exe error in Windows 7Pro.. Rebooting the bootloader is not necessary after each ( .img ) flash..

The adb commands I used are listed below without any errors, this includes reverting from O5Q to 44S and so on..

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 (this partition seems to have appeared in the 44S build)

fastboot flash system system.img

fastboot flash userdata userdata_64G.img (or userdata.img if you have the 16GB version)

fastboot flash boot boot.img

fastboot flash recovery recovery.img

fastboot flash cache cache.img

fastboot reboot

sent by my: SandStone Black (#1) 1+1

"The FlagShip Killer"

"Praise Jah" YOU people.!

---------- Post added at 04:40 PM ---------- Previous post was at 04:28 PM ----------

Sir..I run STOCK OS only..I have not tested a custom ROM..seems as thow if one flashes all adb commands except (userdata) one would possibly have errors, since the custom ROM image is somewhat different..BUT..as stated..I have NOT tested a custom ROM revert to STOCK..

BUT..I have tested reverting to O5Q from 44S and visa-versa..and did receive errors..BUT if one is to flash the same version, then NOT flashing the (userdata.img) will be successful of saving the personal files, such as music and pictures on the "Internal Storage" of the device..flash all other lines except (userdata) line and a fresh/clean OS will be installed/flashed..

The ONLY WAY..I have found to revert from one version to another, (stock OS).. is to do a userdata erase..

Someone, Please correct me, If I'm wrong..

:)
[ONE General] AlbSan:
Help me please ...

i've follow the guide step by step .. but at :

fastboot flash system system.img

i've this error:

C:\Users\Alby\Desktop\BK\inst>fastboot flash system system.img

load_file: could not allocate 865167168 bytes

error: cannot load 'system.img'

the file is in the dyrectory:

Directory di C:\Users\Alby\Desktop\BK\inst

02/03/2015 19:20 <DIR> .

02/03/2015 19:20 <DIR> ..

04/11/2014 12:06 14 android-info.txt

01/01/2009 00:00 6.098.944 boot.img

28/01/2015 16:58 10.682.660 cache.img

12/02/2015 08:54 508.668.255 cm-11.0-XNPH05Q-bacon-signed-fastboot.zip

28/01/2015 11:59 385.400 emmc_appsboot.mbn

12/02/2015 14:42 1.433 flash-all.bat

12/02/2015 14:42 1.202 flash-all.sh

28/01/2015 11:59 9.821.696 logo.bin

28/01/2015 11:59 57.722.368 NON-HLOS.bin

01/01/2009 00:00 8.042.496 recovery.img

28/01/2015 11:59 190.168 rpm.mbn

28/01/2015 11:59 302.696 sbl1.mbn

28/01/2015 11:59 11.800 sdi.mbn

28/01/2015 11:59 10.485.760 static_nvbk.bin

01/01/2009 00:00 865.167.168 system.img

28/01/2015 11:59 290.232 tz.mbn

28/01/2015 16:58 144.460.844 userdata_64G.img

17 File 1.622.333.136 byte

2 Directory 115.150.307.328 byte disponibili

thank
[ONE General] Wayne_Kent:
Sir..try NOT using the (bat) file..run the commands as I have posted earlier with adb and cmd window..

sent by my: SandStone Black (#2) 1+1

"The FlagShip Killer"

"Praise Jah" YOU people.!
[ONE General] AlbSan:
I do not use the .bat file but I put every single command into a DOS shell.

works fine up to the point indicated above.

Why?

thank you
[ONE General] TNT4YOU:
If I want to return in Stock Cm Rom after Color Os...with fastboot to stock 05Q....all partion of Color OS (because I have heard that creates new extra partitions inside the phone) deleted or is any specific way to delete these extra partitions from the phone.

Thanks in advance.
[ONE General] AlbSan:
I have now installed the CM12 is the same?
[ONE General] MohamedAbdelKhalik:
Thanks. This will be useful in the future!
[ONE General] EddyOS:
Are you using the latest version of adb/fastboot? This is usually why people have issues
[ONE General] AlbSan:
you're right!

I had Android Debug Bridge version 1.0.29

Now I upgraded to the Android Debug Bridge version 1.0.32

thank you very much
[ONE General] Adikovec:
Device not unlocked ?

It says device not unlocked,cannot flash / erase. I have BL unlocked,I have already flashed other ROMs via TWRP.. Dunno where's problem. My device was in Fast Boot mode.. Any help ?
[ONE General] Ollie_17:
Secure storage?

Hi I installed the rom as you said in the OP but i went to ES file explorer and noticed secure storage which was located in my file manager under storage and is asking me to set up a password for it. As far as i know that wasnt there before. The only thing ive done is reinstall apps using helium but i dont think that would have added that.

So any help?
[ONE General] zxspectrun:
my opo is dead :crying: i copy all commands (error) and paste in a window terminal and my opo dont turn on, please help me :crying: :crying: :crying: please!!
[ONE General] tzvblsm:
It sounds like you have a hard brick you need a different method to get it working
[ONE General] NWKENT:
Do you have the device in "fastboot mode" when you run the adb commands.? MORE INFO would certainly help.!!

sent by my: SandStone Black 1+1

(aka) OnePlus One, OPO (Device 1 of 2)
[ONE General] rainwalkerx:
Works great!

Just wanted to say that this worked beautifully on a brand new 64 gb OnePlus One bought in February.

Did my install on 64-bit Ubuntu 14.04. Installed adb and fastboot utils via command line. Extracted the provided image into a local folder (also had to unzip the extra zip file inside the original and copy its contents to the root directory of the main unzip - put all the files in the same dir, basically, otherwise it says it can't find the files). Had to update udev rules so that the phone would be seen in both adb and fastboot devices (google stackexchange.com adb-can-discover-devices-but-not-fastboot). Skipped the automated script and did each command manually, as suggested. All worked perfectly!

I also reset the flags, per step 4. Issued fastboot oem-unlock and then fastboot device-info. Both flags were set to TRUE. Downloaded most recent twrp recovery img for the OnePlus, as well as OnlyBootloaderToggle and OnlyTamperToggle zip files (put the zips on the phone's root dir). Then I booted phone into fastboot, connected usb, and issued $ fastboot boot ~/Downloads/openrecovery-twrp-2.8.5.1-bacon.img, which booted the phone into twrp. From there, I installed the two toggle zips.

Awesome guide, thanks so much for the effort!
[ONE General] S1611:
May be experts can help?

http://xdaforums.com/oneplus-one/help/messed-opo-able-to-fastboot-recovery-t3055113
[ONE General] sandeeppathak007:
If i flash 44s how do i stop the ota from appearing in notification...
[ONE General] apatal:
Press and hold the notification that appears in your notification shade. A floating pop-up that says "App Info" will appear in the corner of the notification. Press that and in the next screen, uncheck the "Show Notification" option.
[ONE General] pratyush369:
What About OTA

If i restore using this method will i receive further updates for Cm
[ONE General] apatal:
Read the last 5 posts before yours...
[ONE General] taylorinnov:
IMEI Troubles

So I followed this procedure to the letter, but did NOT perform the "Reset the tamper flag/lock the bootloader" step, as I didn't want to re-lock the bootloader.

Now I have no IMEI. It is simply blank on the Status page.

Any thoughts on how to get it back??????
[ONE General] sandeeppathak007:
If you have a twrp backup then flash the recovery n restore it

Seems your efs partition got corrupted
[ONE General] taylorinnov:
I would have restored the backup in the first place if I had had the foresight to make one. I have never encountered an EFS problem before though.

And it's one of those things I wouldn't really expect, given that it is supposed to be hard to change IMEI numbers.

Is there any way to regenerate the EFS partition or am I just SOL?
[ONE General] mdjayaprakash:
My phone doesn't boot at all

Guys,

I tried the procedure on the first post by flashing each of the files individually. After typing the following two commands, my phone fails to start now:

fastboot flash aboot emmc_appsboot.mbn

fastboot reboot-bootloader

Both were a success according to the terminal but my phone doesn't boot AT ALL. It doesn't respond in ANY way. No fastboot, no recovery, absolutely nothing. I'm getting scared. Somebody please help.

Steps I tried to bring it back online:

1. Charge it for a while.

2. Hold down the power button for a period of approx. 20 seconds for 5 times.

3. Hold down the power button and volume down button simultaneously.

None of this worked. Please help!!!!

I don't want to turn this into a paper weight.
[ONE General] lokesh.3440:
Does flashing these zips wipe data from SD card or anything I can do to block it?
[ONE General] EddyOS:
It will if you flash the userdata.img
[ONE General] lokesh.3440:
So there is no need to flash userdata.img.
[ONE General] EddyOS:
Only if you want to completely reset the device, no
[ONE General] lokesh.3440:
So it's perfectly safe to flash the remaining commands
[ONE General] waterdaan:
fastboot flash recovery recovery.img

Will flash stock recovery, you might want to keep your current recovery though
[ONE General] tobydjones:
errors

I downloaded XNPH05Q 64GB, unzipped, went into fastboot and ran flash-all.sh.

Most worked fine, but I got some errors:

writing 'oppostanvbk'...
OKAY [ 0.143s]
finished. total time: 0.472s
rebooting into bootloader...
OKAY [ 0.007s]
finished. total time: 0.008s
target reported max download size of 536870912 bytes
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
archive does not contain 'vendor.img'

The phone has booted up ok... so should I be worried about the 4 missing files?
[ONE General] twowheeler:
just a question:

Why is it necessary to reboot bootloader after flashing every file? Noticed wug's toolkit doing that too, but some guides don't say it needs to be done. Why is that needed? (and thanks for this excellent guide btw)
[ONE General] GigabitEthernet:
Hi,

The steps in the initial post don't seem to apply to the 50Q update? Indeed, most of the files aren't in the folder.
[ONE General] simonottosen:
Unpack the zip inside the zip, there's the rest of the files.

---------- Post added at 11:47 AM ---------- Previous post was at 11:30 AM ----------

I now have a problem.

I'm about to send my phone to OPO for a repair, but i have installed TWRP recovery, but my phone is FALSE in both tampered and unlocked. Will they accept the phone, and how should i return to stock recovery, when my device is not unlocked? If i unlock it, i can't flash the zip to lock it again.
[ONE General] Renare:
It was suggested to me to factory reset my phone since every aspects of my phone works But I

have a black screen.

Is there a tool that I can use so I can see what I'm doing via my computer?
[ONE General] zantekk:
Hey OP,

this guide worked absolutley Fine on my fedora machine :)
[ONE General] RohanAJoshi:
guys, I already downloaded 05Q build from cyanogen, I just want flash-all.bat for 05Q, anybody please upload..

aslo, I am on cm12, is possible to downgrade to cm11s 05Q ?
[ONE General] waterdaan:
fastboot flash oppostanvbk static_nvbk.bin

fastboot flash boot boot.img

fastboot flash system system.img

fastboot flash cache cache.img

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 reboot

echo It is done Now :)
pause
[ONE General] dolmas:
I have a question...how can i "Reset the tamper flag/lock the bootloader" since with the first 3 steps, i have the stock recovery and not the CWM / TWRP recovery...how will i flash the zip? :/
[ONE General] jpswer:
Can the OP please be updated to remove the "fastboot reboot-bootloader" steps. It's resulting in hardbricks when flashing between Lollipop and KitKat?
[ONE General] JBH168:
Please add to the first post to NOT reboot in between each step when coming from OxygenOS since that'll hard brick your phone.
[ONE General] epee91:
I tried to do this to my device, OPO 64gb,

XNPH05Q 64GB:

As i'm using mac, neither of the scripts did work, so I decided to do this manually.

I was coming back from just released OxygenOS, as my network didn't work correctly with it.

I managed to flash the following lines:

fastboot flash modem NON-HLOS.bin

fastboot reboot-bootloader

fastboot flash sbl1 sbl1.mbn

fastboot reboot-bootloader

fastboot flash dbi sdi.mbn

fastboot reboot-bootloader

fastboot flash aboot emmc_appsboot.mbn

fastboot reboot-bootloader

fastboot flash rpm rpm.mbn

fastboot reboot-bootloader

But after "fastboot flash rpm rpm.mbn", my phone just froze. No fastboot, no recovery. It doesn't boot at all. All i'm having is a blackscreen and I can't do anything.

For some reason, my opo is most likely permanently bricked, but is there anything I could do to save the device?
[ONE General] CBpbxEcmecmBeH:
There are unbrick methods, check them out. Also see the comment above yours, might be related...
[ONE General] lammpat:
Today same thing happened with me...have you found any solution?

this is my case https://forums.oneplus.net/threads/bricked-urgen-help-needed.291342/
[ONE General] asmth00:
Why doesn't it work when trying to revive from Oxygen?
[ONE General] rock7632:
Does anyone know of a way that does work to revert from Oxygen to CM11S or even to a CM12 nightly?
[ONE General] EddyOS:
Not a clue. I don't have an OPO any more so I just keep this guide up-to-date with he latest factory images but there are posts in this thread saying it bricks you phone

And, please, don't quote the WHOLE OP just to ask a question...
[ONE General] kevinga:
I am also CM OPO.
[ONE General] OuncE718:
I literally had that same exact issue for 2 days straight and couldn't find a fix until around 4am this morning. I realized I was on an older version of Android SDK. I decided to update it and bam, it worked.

Please report back and let me know if it work.
[ONE General] kevinga:
I downloaded sdk yesterday. Shows to be r23.0.2.
[ONE General] OuncE718:
That reply wasn't for your issue. On another note, I haven't run into your issues but based off of reading your error you might have had a few apps opened in the background while trying to run that script.

What I'd suggest is to reboot your computer and your phone and then open CMD & only CMD. Do not have any other files open when you run the script.
[ONE General] Xeon_IV:
fixed

downloaded OnePlus One toolbox, Put in flashboot and hit stock recovery and works perfect http://xdaforums.com/oneplus-one/development/toolbox-oneplus-one-toolbox-t2808987#post54395236
[ONE General] kevinga:
Great news! Glad you are back on track. Here is what eventually fixed my problem:

I dirty flashed the stock rom zip file that I had put on my phones memory to make sure it would work. It flashed fine.

Knowing now that the rom zip was going to work, I decided I would do a full wipe by wiping /system, /data/, /dalvik, and /cache in TWRP 2.7.1.0 then flashed the stock rom zip file.

The flash failed! (Would like to know why because it worked when I dirty flashed it.)

Fortunately I had a TWRP backup that I had done a couple of days after I had rooted. I restored the backup. I no longer am having the wifi bugs.

I am thinking there was something in my /system partition that was causing the wifi problem because before wiping the /system partition I had performed a factory reset and it did not solve the wifi problem.

So, although my phone is now back to working good, I still have a couple of things unknown that I would like to learn from. First, why did my flash fail after wiping the partitions but it worked when I dirty flashed? Second, was the wifi problem located in one of those partitions that I had wiped?
[ONE General] EddyOS:
The factory image isn't a flashable ZIP, theres's no updater script in the file, so it'll fail if you try
[ONE General] kevinga:
This was the file that I flashed. It dirty flashed fine. Why would it not flash after wiping the system, data, dalvik and cache partitiions? I don't understand. I just now unzipped this file and verified that it has an updater script.

http://dist01.slc.cyngn.com/factory/bacon/cm-11.0-XNPH25R-bacon-signed.zip
[ONE General] zee24:
THANKS!

Hey thank you so so so much for this guide, i just returned my opo to stock now! Thank you!!!
[ONE General] mjjferreira:
[GUIDE] Return your OPO to 100% Stock

If root doesn't void the warranty, why would someone want to get back to stock CM11S?

I have root and stock CM11S. :)

I hope the OTA updates continue to work.

Did you have a different ROM?
[ONE General] EddyOS:
OK, seems they do two images - one to flash through a custom recovery and one for fastboot. As I only had the fastboot one as it's the only one linked directly on the CM website this guide only covers that
[ONE General] rickyx32:
Is it possible to make one of those "flash- all" files that come with the Nexus 5 factory images, or something similar?
[ONE General] legendarygizmo:
Why not just use:

fastboot flash -w cm-11.0-XNPH25R-bacon-signed-fastboot.zip
[ONE General] EddyOS:
I was wondering if something like that's work, as there is a flash-all.sh script for the radio files and I guess the rest would work after. Anyone fancy trying that?
[ONE General] SleemLDJ:
Using this fastboot method to flash the factory image wipes the internal memory if I'm correct.

Right?
[ONE General] EddyOS:
If you flash the userdata image, yes. You could leave it out and see what happens though but remember - this guide is to go back to 100% stock for warranty/selling on so you'd want to do this anyway :)
[ONE General] bradipovsky:
You might want to put a little warning there for stupid people like me who want to only partially return to stock and first flash "userdata" and then think about what they just did :D

After all experience comes five minutes after the moment you needed it...

Thanks for the guide anyway :)

Oh, one more thing: I downloaded the factory image and it came with a "flash-radio" script that automated the steps from modem to LOGO.
[ONE General] EddyOS:
Yeah I did notice that, I might see if i can knock up a full script like the Nexus images that does it all for you
[ONE General] andybfmv96:
is there no radio provided in the factory image? theres a flash radio script, but no img file, and this is the only partition missing from this tutorial, whats going on???
[ONE General] RalphLauren:
radio files are provided.

Have a look to the flash-radio script
[ONE General] EddyOS:
I'd imagine you have to flash it via TWRP as opposed to the system images but perhaps either search or ask in Q&A
[ONE General] CBpbxEcmecmBeH:
I've also read that it's better to flash zip files via TWRP to go to CM12. Haven't tried it though...
[ONE General] Criton30:
I dont understand this, I have installed OxygenOS after this I can back to 05Q or to 44S without any problem. With your tutorial or with WuGfresh tool or with the automated script from OnePlus. Therefore I dont understand why brick the phone to revert back from OxygenOS......maybe the bootloader has been changed?
[ONE General] EddyOS:
Again, I've NO idea. If you read the last few pages of this thread people are saying not to follow the guide. Perhaps ask them why...
[ONE General] Criton30:
With this guide and tool I have no issue to revert from OxygenOS to stock Cm11S.
[ONE General] mijkz:
I've gone from OxygenOS back to CM11S without any issues. I first flashed the latest CM12 nightly using TWRP (to install a backwards-compatible bootloader), then manually fastboot-flashed CM11S.

I used the flash.bat as a guide, but didn't reboot between each step. Working fine on CM11S now.
[ONE General] darkone2k4:
Can I revert from Color OS to CM11S with this guide?
[ONE General] rock7632:
Thanks for that. So you're saying the first thing you did was wipe system and flash CM12 nightly from TWRP. Then you were able to flash CM11S manually through fastboot without rebooting at all after each step?
[ONE General] Criton30:
and what is with this guide?
[ONE General] mijkz:
Yes - factory reset in TWRP, flash CM12 nightly, then fastboot-flash CM11S without doing the "fastboot reboot-bootloader" between each step.
[ONE General] rock7632:
got it, thanks
[ONE General] kookie47:
SAFE way move back from oxygenos to CM11s

For those who havnt shifted back to cm11s.(and still on oxygenos) and want to move back to CM11s ofcourse not hardbricked your phone. THIS GUIDE Is FOR ONEPLUS ONE 64GB VARIANT . (ALSO VALID FOR INDIAN USERS)

This guide will happily and SAFELY get you back to cm11s(XNPH05Q. OTA Safe).

people have hardbricked their phone by simply flashing cm11s through fastboot, which ofcourse is not the appropriate procedure.

NOTE: MY PHONE WAS NOT ROOTED BUT I WAS RUNNING OXYGENOS WITH TWRP RECOVERY INSTALLED(BUT I PREFERRED FASTBOOT METHOD). ONLY DRAWBACK IS YOU NEED TO TAKE BACKUP FIRST . ELSE THIS METHOD IS SAFE.

You need to have the following files:

1. mediafire.com/download/78r7kes21exsnbh/Calkulin's_Stock_OPO_XNPH05Q_ROM_v1.0.zip

2. mediafire.com/download/94o0lb0pzdg1drw/XNPH05Q_Extras.zip

-Extract the first zip. Again extract the zip from the extracted folder.

-Extract the XNPH05Q in the same folder where the all above files were extracted .

-The folder should have fastboot cmd. and you should have fastboot drivers installed .

-put your device in fastboot mode by turning the phone off and pressing volume up+power key simultaneously .

-open cmd in the folder where all of the above files were extracted . press shift and right click in the flder and open command prompt .

- look whether your device is detected by fastboot. type fastboot devices

-You need to have unlocked bootloader.(if not, type fastboot oem unlock)

-TYPE THE FOLLOWING COMMANDS IN THE COMMANDS IN THE ORDER AS GIVEN :

IMP: DONT REBOOT IN BETWEEN COMMANDS

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 boot boot.img

fastboot flash userdata userdata_64G.img

fastboot flash system system.img

fastboot flash recovery recovery.img

fastboot flash cache cache.img

fastboot reboot

You are all done. Sit back and relax.

Lock the bootloader again. After you are done with setting up. type fastboot oem lock:)
[ONE General] Criton30:
with this guide and script (from OnePlus) is the same, no issue.
[ONE General] kookie47:
But only limitation

but only limitation is that it will bring you back to XNPH38R and not XNPH05Q..

else it is fine
[ONE General] Criton30:
and? it will update to 05Q
[ONE General] Frank-HRO:
Hello,

i can't find in these file: mediafire.com/download/78r7kes21exsnbh/Calkulin's_Stock_OPO_XNPH05Q_ROM_v1.0.zip

a zip-Folder.

I can see in the file Calkulin's_Stock_OPO_XNPH05Q_ROM_v1.0.zip:

META-INF

system

boot.img

I can't find userdata_64G.img, system.img, recovery.img and cache.img.

Can you please help me.

Or is the link wrong?
[ONE General] waterdaan:
You can flash that in recovery, not with fastboot

If coming from cm11s 44,there's no need to wipe

If coming from a different rom, you'll need to wipe

System, cache, dalvic cache, data (but not internal storage)
[ONE General] udimars30:
as i am on Oxygen Os, if i flash cm12 or any other rom and then try this method to revert back to full stock, will it work?
[ONE General] emam damon:
yes it will work.i safely did that and you don't need to flash whole cm12 rom just cm12 firmware will be enough.
[ONE General] NWKENT:
It is very possible to revert from OxygenOS to 4.4.4_05Q..one needs the correct FXZ then flash via adb..

I can offer a link to my known good FXZ and adb commands, if anyone needs..

sent by my: SandStone Black 1+1

(aka) OnePlus One, OPO (Device 1 of 2)
[ONE General] Criton30:
correct FXZ, what is it? Please share your knows. But the steps what I have written is also good, I have no issues.