How To Guide Restore OnePlus 9 to Stock via Fastboot Commands

Search This thread

mrk2815

Senior Member
May 16, 2012
1,551
341
burbank
thanks for the guide on the fastboot commands to get bback to stock using fastboot commands and the payloader bin dump tools . i was able to get my one plus 8t back to stock using the steps that you highlighted. again thanks for the guided steps.
 

TrumpXi

Member
Aug 31, 2022
28
8
OnePlus 9
earlier I tried this guide's method but it put my phone into a hard brick and MSM Tools reports a sahara error so I sent it back to OP for repair. Will recommend against the method and MSM restore instead, tho if you know what ur doing u could try this guide..

Based on what I see this method is no good for bricked devices -- I saw this droid win site ripping the XDA forum https://www.droidwin.com/unbrick-oneplus-9-pro-fastboot-commands/ that falsefully state this method can save my brick. And after `fastboot reboot fastboot` it only turned my bootloader bootloop into a hard brick.
 

MattsSoScene

Member
Mar 5, 2011
12
7
If you want, you can do the flashing easily with powershell, rather than running each command one after the other. Here is what I did:

1. Have fastboot.exe in your path, or in the same folder as all your extracted images. Open powershell and navigate to the folder with your boot images. Connect your phone to USB.
2. This will wipe your device! Reboot to the bootloader and run:
Code:
fastboot -w
3. Run:
Code:
gci -filter *.img | where {$_.Name.split('.')[0] -match 'boot|cpucp|dtbo|modem|oplusstanvbk|oplus_sec|qweslicstore|shrm|splash|vbmeta|vbmeta_vendor|vbmeta_system|vendor_boot|vm-bootsys'} | foreach-object { fastboot.exe flash $($_.Name.split('.')[0]) $_.Name }
4. Run:
Code:
fastboot reboot fastboot
5. Run:
Code:
gci -filter *.img | where {$_.Name.split('.')[0] -match 'abl|aop|bluetooth|devcfg|dsp|featenabler|hyp|imagefv|keymaster|multiimgoem|qupfw|tz|uefisecapp|xbl|xbl_config|product|system|system_ext|vendor|odm'} | foreach-object { fastboot.exe flash $($_.Name.split('.')[0]) $_.Name }
6. Run:
Code:
fastboot reboot
7. Proceed to boot normally.

The commands in steps 3 and 5 get a list of all files in the current directory with the .img extension, filter them to the correct ones to flash, and then flash them one after another.

If someone wants, I can probably throw together a script to run the whole process start to finish.

Edit: script attached. I've (unfortunately) had the opportunity to test it and fix all the bugs. So it works. You will need to have fastboot.exe accessible in your system PATH to run it.
I cant seem to get this to work. What am I doing wrong?
 
Last edited:

shadabkiani

Senior Member
Mar 2, 2018
642
269
Pakistan
HTC 10
OnePlus 9
I cant seem to get this to work. What am I doing wrong?
You are way off from where you need to be. This is an old method, and you don't need this. If you wanna recover your phone, you can use MSM Tool method (read here) which is way simpler and fool proof. This will get your phone back to OOS11, and you can OTA update from there.
 
  • Like
Reactions: MattsSoScene

TsuyoiS2

New member
Jun 3, 2023
1
0
what to do when fastbootd is not recognized in terminal?
only fasbootd is not recognized, fastboot recognizes
 

MattsSoScene

Member
Mar 5, 2011
12
7
You are way off from where you need to be. This is an old method, and you don't need this. If you wanna recover your phone, you can use MSM Tool method (read here) which is way simpler and fool proof. This will get your phone back to OOS11, and you can OTA update from there.
Thanks! I needed to look up a guide to walk me through it, but that did the trick! You are a life saver!
 
Last edited:

crazyg4merz

Senior Member
Sep 15, 2011
300
64
Thanks for the guide! I'm planning to go back into stock but I don't have Windows machine and maybe I'll use this method. But the newer payload dump now have more partitions like `my_manifest` `my_heytap` etc. Do I just flash them too in the second step or I don't need them?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    If you want, you can do the flashing easily with powershell, rather than running each command one after the other. Here is what I did:

    1. Have fastboot.exe in your path, or in the same folder as all your extracted images. Open powershell and navigate to the folder with your boot images. Connect your phone to USB.
    2. This will wipe your device! Reboot to the bootloader and run:
    Code:
    fastboot -w
    3. Run:
    Code:
    gci -filter *.img | where {$_.Name.split('.')[0] -match 'boot|cpucp|dtbo|modem|oplusstanvbk|oplus_sec|qweslicstore|shrm|splash|vbmeta|vbmeta_vendor|vbmeta_system|vendor_boot|vm-bootsys'} | foreach-object { fastboot.exe flash $($_.Name.split('.')[0]) $_.Name }
    4. Run:
    Code:
    fastboot reboot fastboot
    5. Run:
    Code:
    gci -filter *.img | where {$_.Name.split('.')[0] -match 'abl|aop|bluetooth|devcfg|dsp|featenabler|hyp|imagefv|keymaster|multiimgoem|qupfw|tz|uefisecapp|xbl|xbl_config|product|system|system_ext|vendor|odm'} | foreach-object { fastboot.exe flash $($_.Name.split('.')[0]) $_.Name }
    6. Run:
    Code:
    fastboot reboot
    7. Proceed to boot normally.

    The commands in steps 3 and 5 get a list of all files in the current directory with the .img extension, filter them to the correct ones to flash, and then flash them one after another.

    If someone wants, I can probably throw together a script to run the whole process start to finish.

    Edit: script attached. I've (unfortunately) had the opportunity to test it and fix all the bugs. So it works. You will need to have fastboot.exe accessible in your system PATH to run it.
    5
    This guide assumes you have the SDK Platform Tools installed and working, along with USB drivers for your device (if needed), and have your full update zip which you've already extracted the payload.bin from, and then dumped the images using payload dumper. If you haven't done any of these things yet, there are plenty of other guides out there on how to do them.

    Steps:

    1. Reboot your device to the bootloader (power off, then hold volume up + power) and connect it to USB.
    2. The following command will wipe your device. I found this to be necessary to recover my OnePlus 9:
    Code:
    fastboot -w
    3. Now flash the following files:
    Code:
    fastboot flash boot boot.img
    fastboot flash cpucp cpucp.img
    fastboot flash dtbo dtbo.img
    fastboot flash modem modem.img
    fastboot flash oplusstanvbk oplusstanvbk.img
    fastboot flash oplus_sec oplus_sec.img
    fastboot flash qweslicstore qweslicstore.img
    fastboot flash shrm shrm.img
    fastboot flash splash splash.img
    fastboot flash vbmeta vbmeta.img
    fastboot flash vbmeta_vendor vbmeta_vendor.img
    fastboot flash vbmeta_system vbmeta_system.img
    fastboot flash vendor_boot vendor_boot.img
    fastboot flash vm-bootsys vm-bootsys.img
    4. Now reboot into userspace fastboot, aka fastbootd. If you don't do this, the remaining files cannot be flashed:
    Code:
    fastboot reboot fastboot
    5. Flash the remaining files:
    Code:
    fastboot flash abl abl.img
    fastboot flash aop aop.img
    fastboot flash bluetooth bluetooth.img
    fastboot flash devcfg devcfg.img
    fastboot flash dsp dsp.img
    fastboot flash featenabler featenabler.img
    fastboot flash hyp hyp.img
    fastboot flash imagefv imagefv.img
    fastboot flash keymaster keymaster.img
    fastboot flash multiimgoem multiimgoem.img
    fastboot flash qupfw qupfw.img
    fastboot flash tz tz.img
    fastboot flash uefisecapp uefisecapp.img
    fastboot flash xbl xbl.img
    fastboot flash xbl_config xbl_config.img
    fastboot flash product product.img
    fastboot flash system system.img
    fastboot flash system_ext system_ext.img
    fastboot flash vendor vendor.img
    fastboot flash odm odm.img
    6. Final reboot:
    Code:
    fastboot reboot
    7. If everything worked your phone should now boot into OxygenOS.

    Note:
    The files will be flashed to your currently active boot slot. If any of them fail to flash, switch to the other slot and start over from the beginning. I wasn't able to flash odm, product, system, system_ext and vendor to slot a, and had to use slot b instead. To check current slot:
    Code:
    fastboot getvar current-slot
    To switch slots:
    Code:
    fastboot --set-active=a
    or
    Code:
    fastboot --set-active=b

    Use this guide at your own risk. I take no responsibility if you brick your device, set it on fire, or otherwise mess it up as a result of any of the above steps. That being said, it worked for me using 11.2.2.2.LE25AA available from the official OnePlus support website.
    2
    If you want, you can do the flashing easily with powershell, rather than running each command one after the other. Here is what I did:

    1. Have fastboot.exe in your path, or in the same folder as all your extracted images. Open powershell and navigate to the folder with your boot images. Connect your phone to USB.
    2. Reboot to the bootloader and run:
    Code:
    fastboot -w
    This will wipe your device!
    3. Run:
    Code:
    gci -filter *.img | where {$_.Name.split('.')[0] -match 'boot|cpucp|dtbo|modem|oplusstanvbk|oplus_sec|qweslicstore|shrm|splash|vbmeta|vbmeta_vendor|vbmeta_system|vendor_boot|vm-bootsys'} | foreach-object { fastboot.exe flash $($_.Name.split('.')[0]) $_.Name }
    4. Run:
    Code:
    fastboot reboot fastboot
    5. Run:
    Code:
    gci -filter *.img | where {$_.Name.split('.')[0] -match 'abl|aop|bluetooth|devcfg|dsp|featenabler|hyp|imagefv|keymaster|multiimgoem|qupfw|tz|uefisecapp|xbl|xbl_config|product|system|system_ext|vendor|odm'} | foreach-object { fastboot.exe flash $($_.Name.split('.')[0]) $_.Name }
    6. Run:
    Code:
    fastboot reboot bootloader
    7. Proceed to boot normally.

    The commands in steps 3 and 5 get a list of all files in the current directory with the .img extension, filter them to the correct ones to flash, and then flash them one after another.

    If someone wants, I can probably throw together a script to run the whole process start to finish.
    That would be helpful indeed. Would this script run on mac as well?
    2
    ok i kind of bricked my phone using this and i need a little help PLEASE?

    Ok i tried the fist 2 steps 1. fastboot -w than the first list of commands using cmd with admin rights it worked...i think but it did load everything without issues...now i go to do the "fastboot reboot fastboot"

    and now my phone is stuck on a black screen with nothing and i just hear the chime windows makes when you disconnect and reconnect a device..... and in the Device manager this comes up for 10 seconds than goes away for 5 than comes back NON STOP

    i cant adb i cant do anything please help !
    1
    I cant seem to get this to work. What am I doing wrong?
    You are way off from where you need to be. This is an old method, and you don't need this. If you wanna recover your phone, you can use MSM Tool method (read here) which is way simpler and fool proof. This will get your phone back to OOS11, and you can OTA update from there.