Home > Unbrick

Restore OnePlus 7/7T/7T Pro to Stock via Fastboot Commands

In this guide, we will show you how to restore the OnePlus 7/7T/7T Pro to Stock OxygenOS ROM via Fastboot Commands. So here is how the entire guide goes. To begin with, we would be downloading the stock OxygenOS ROM for your device. Then we will take the payload.bin file and extract all its contents (boot.img, system.img, etc). Each of these files will then be flashed onto their respective portions via Fastboot Commands.

As soon as you have executed all the commands, your device will boot up to stock OxygenOS without any modifications. That is, it will be in its clean stock state without any TWRP, root, or other custom mods. Likewise, you could also use the instructions given here to fix the bootloop or soft brick on your OnePlus device[For hard Bricked devices, refer to our separate guide: How to Unbrick OnePlus 7 and bring it back from a Dead State | 7 Pro | 7T |  7T Pro].

OnePlus devices have always been the front runners when it comes to setting their feet in custom development. From flashing custom binaries to trying out tons of mods, there are a plethora of things to try out. These include flashing custom ROMS such as Pixel Experience, Havoc, or something along the AOSP lines. Likewise, you could also replace the device’s stock recovery with a custom one. This in turn will allow you to create and restore Nandroid backup, flash ZIP and IMG files, wipe device partitions, etc.

Then you could also gain access to the system partition by rooting your device via TWRP or without TWRP, by flashing the patched boot.img file. After rooting, you could try out Substratum Themes, Xposed Frameworks, Magisk Modules, etc. However, these tweaks sometimes prove to be risky, if not done correctly or if you end up flashing an incorrect file. In that case, your device will go to a bootloop or might get soft-bricked. If that ever happens to your device, then this guide is always here to help you out. Today, we will show you how to restore the OnePlus 7/7T/7T Pro to Stock OxygenOS ROM via Fastboot Commands. Follow along for the detailed steps.



Unbrick | Restore: OnePlus 7/7T/7T Pro to Stock via Fastboot Commands

Before we list out the instructions, there are a few requirements that you need to qualify. Make sure to go through them and only then proceed with the unbrick steps.

Prerequisites

  • Create a complete device backup, if possible. This is because we will have to wipe off all the data from your device via the fastboot-w command later on. So a backup beforehand is of utmost importance. Since most of you might be stuck in fastboot, it might be a tough job to do. But if your device is up and running, then please create a backup beforehand.
  • Next up, install the Android SDK Platform Tools on your PC. This will provide you with the necessary ADB and Fastboot binary files.

These were the required files. You may now proceed ahead with the steps to restore your OnePlus 7/7T/7T Pro to stock OxygenOS by flashing the Stock ROM via Fastboot Commands. Droidwin and its members wouldn’t be held responsible in case of a thermonuclear war, your alarm doesn’t wake you up, or if anything happens to your device by performing the below steps.

STEP 1: Boot OnePlus 7/7T/7T Pro to Fastboot Methods [3 Methods]

First and foremost, you will have to boot your OnePlus 7 series device to Fastboot Mode. This could be done via 3 different methods, depending on the scenario you are facing as of now:

fastboot mode oneplus
Fastboot Mode OnePlus [Reference Image]
  • If your device is soft-bricked, well then it might already be booted to Fastboot.
  • If it is in a continuous boot-loop, then wait for the battery to dry out so that it powers off. Then plug in the charger and at the same time press and hold the Volume Up and Power button together. The timing is extremely important in this, if done at the right time, then you should have no issues in booting to Fastboot or Bootloader Mode.
  • On the other hand, if your device is perfectly working then use the Advanced Reboot menu under Developer Options and access the Fastboot Mode option. Or you could also enable USB Debugging from Developer options and then use the adb reboot bootloader command. Anyways, once your device is booted to Fastboot Mode, head over to the next set of instructions. to restore your OnePlus 7/7T/7T Pro to stock OxygenOS by flashing the Stock ROM via Fastboot Commands.

STEP 2: Unlock Critical Partitions on OnePlus

For flashing IMG files to their respective partitions, you will first have to unlock those partitions. This could be done by executing the below command: [Read this for a more detailed explanation: How to Fix FAILED (remote: Partition flashing is not allowed)].

fastboot flashing unlock_critical

STEP 3: Download OnePlus 7/7T/7T Pro Stock OxygenOS ROM

oneplus 7 stock rom extracted

Now head over to the OnePlus Support Forum and download the latest OxygenOS for your OnePlus 7 series device. The firmware would be in ZIP format. If you see the firmware in JAR format, then simply use the 7 ZIP, WinZIP, WinRAR extraction tool to extract its content.



STEP 4: Extract OnePlus 7/7T/7T Pro Payload.Bin File

After extraction, you would notice that there aren’t any partition files. Rather you would see a payload.bin file. It is this file that is holding all the partition IMG files. So you will need to extract this patload.bin file to get hold of all the other files. In this regard, this guide should help you out: How to Extract Stock Boot. img from OnePlus OxygenOS Stock ROM.

payload bin extract via python oneplus 7 7T pro

Follow the steps given in this linked guide and you should all the files inside the Python output folder (again refer to the linked guide). For example, the above image shows all the files that I got after extracting the OnePlus 7 payload.bin file. Let’s now proceed to the next step to restore your OnePlus 7/7T/7T Pro device to stock OxygenOS by flashing the Stock ROM via Fastboot Commands.

oneplus 7 7t pro extracted payload fastboot files

STEP 5: Flash OnePlus 7/7T/7T Pro Stock ROM- The Initial Setup

Once you have got all the OxygenOS ROM extracted files, transfer them to the platform-tools folder. Inside the same folder, type in CMD in its address bar and hit Enter (see below image). This will launch the Command Prompt window. Now connect your device to the PC via USB cable. Make sure that is booted to Fastboot. Finally, you may now flash all the OnePlus Fastboot ROM files via Fastboot Commands.

command-prompt-adb

Given below in STEP 6 we have listed all the commands for the same. Copy-paste the first command in the CMD window, hit Enter, then do so for the next one, and so on. Furthermore, some commands like when the system.img file is being flashed, will take up quite a lot of time. This is completely normal. Along the same lines, you might also get an “Invalid sparse file format at header magic” message. Well then it is not an error, just wait for a few seconds and it will automatically be gone.



STEP 6: Restore OnePlus 7/7T/7T Pro Stock ROM via Fastboot Commands

So here are the required Fastboot commands to restore your OnePlus 7/7T/7T Pro device to stock OxygenOS by flashing the Stock ROM. The first command (fastboot -w) will completely wipe off all the data from your device, so make sure to have a backup beforehand. Then the last command at the end (fastboot reboot bootloader) will reboot your device back to Fastboot Mode.

After this, you may easily reboot to the OS from Fastboot either by bringing up the Reboot option via Volume Keys and then pressing the Power button to confirm the decision. You could also execute the fastboot reboot command (only do so after all the files have been flashed and your device has been rebooted to Fastboot).

fastboot -w
fastboot flash aop_a aop.img
fastboot flash aop_b aop.img
fastboot flash bluetooth_a bluetooth.img
fastboot flash bluetooth_b bluetooth.img
fastboot flash boot_a boot.img
fastboot flash boot_b boot.img
fastboot flash dsp_a dsp.img
fastboot flash dsp_b dsp.img
fastboot flash dtbo_a dtbo.img
fastboot flash dtbo_b dtbo.img
fastboot flash modem_a modem.img
fastboot flash modem_b modem.img
fastboot flash oem_stanvbk oem_stanvbk.img
fastboot flash qupfw_a qupfw.img
fastboot flash qupfw_b qupfw.img
fastboot flash storsec_a storsec.img
fastboot flash storsec_b storsec.img
fastboot flash system_a system.img
fastboot flash system_b system.img
fastboot flash vbmeta_a vbmeta.img
fastboot flash vbmeta_b vbmeta.img
fastboot flash vendor_a vendor.img
fastboot flash vendor_b vendor.img
fastboot flash LOGO_a LOGO.img
fastboot flash LOGO_b LOGO.img
fastboot reboot bootloader

As mentioned before, your device will be booted to Fastboot mode due to the fastboot reboot bootloader command. You may now boot it to the OS right from the Fastboot Mode itself or use the fastboot reboot command.

Alternate Commands: If the above commands didn’t work out for you, then you may also try out the below commands. Thanks to user Deep Lathia for bringing it to our notice and of course, to the XDA Recognized Contributor mauronofrio for these commands. Again, try again at your own risk, and the first command, fastboot- w will wipe off all the data on your device. So make sure to have a backup beforehand.

The difference between mine (above command) and the below command is that I have provided the commands to flash the partition files to both the slots (since these are the A/B partition) devices. But it seems flashing the files to just the single partition seems to do the j0b for some, at least for the OnePlus 7T users. For me, though, the above commands that instruct to flash files to both the slots worked out.

I haven’t tried out the below command on my deivce and hence cannot comment much on that. With that said, I would continue to update this guide as and when I find more useful information about the same. In the meantime, you could try out the below commands to Restore OnePlus 7/7T/7T Pro Stock ROM via Fastboot Commands.

fastboot -w
fastboot flash aop aop.img
fastboot flash bluetooth bluetooth.img
fastboot flash boot boot.img
fastboot flash dsp dsp.img
fastboot flash dtbo dtbo.img
fastboot flash LOGO LOGO.img
fastboot flash modem modem.img
fastboot flash oem_stanvbk oem_stanvbk.img
fastboot flash qupfw qupfw.img
fastboot flash storsec storsec.img
fastboot flash multiimgoem multiimgoem.img
fastboot flash uefisecapp uefisecapp.img
fastboot flash recovery recovery.img
fastboot --disable-verity flash vbmeta vbmeta.img
fastboot --disable-verity flash vbmeta_system vbmeta_system.img
fastboot flash opproduct opproduct.img
fastboot reboot fastboot
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot flash product product.img
fastboot reboot

Do keep in mind that the first boot might take up some time. It is completely normal. Furthermore, you might have to set up your device from scratch as a complete device wipe has taken place. On that note, let us know in the comments if you have any other queries related to the aforementioned steps. On that note, we conclude this guide to how to restore your OnePlus 7/7T/7T Pro device to stock OxygenOS by flashing the Stock ROM via Fastboot Commands.

Unbrick OnePlus 7/7T/7T Pro via Fastboot Enhance

This is a tool created by XDA Senior Member xzr467706992 and beholds a slew of intriguing features, including the ability to directly flash the payload.bin file, without the need to even manually extract it first. Do note that even though this tool was created for OnePlus 8T but it should work across other OnePlus devices too. [Well, I have personally tested it on OnePlus 7T and OnePlus 10 Pro, it works well and good even on those devices].

STEP 1: Download Fastboot Enhance Tool

Download the Fastboot Enhance Tool from GitHub [direct link]. Once downloaded, extract it to any convenient location on your PC. The biggest advantage of this tool is that you could directory flash the payload.bin file, there is no need to extract it and get the resultant IMG files!

Unbrick OnePlus 7

STEP 2: Download OnePlus OnePlus 7/7T/7T Pro ROM

  1. Next up, get hold of the firmware for your device from below:
    OnePlus 7/7T/7T Pro Stock Firmware
  2. Once downloaded, extract it and transfer the resultant payload.bin file to the Fastboot Enhance Tool folder.
    Unbrick OnePlus 7

STEP 3: Install Android SDK

Next up, install the Android SDK Platform Tools on your PC. This is the official ADB and Fastboot binary provided by Google and is the only recommended one. So download it and then extract it to any convenient location on your PC. Doing so will give you the platform tools folder, which will be used throughout this guide.

install adb platform tools windows

STEP 4: Install Fastboot Drivers

The tool doesn’t come with the Fastboot Drivers, so you will manually have to install it on your PC. For that, please refer to our guide on How to Install Fastboot Drivers in Windows 11. Likewise, make sure to install the OnePlus USB Drivers as well [they are usually automatically installed as soon as you connect your device to the Windows PC for the first time].

Unbrick OnePlus 7

STEP 5: Boot to Fastboot Mode

  1. Since your device is currently in a brick state, you wouldn’t be able to use the adb reboot bootloader command to boot your device to Fastboot Mode. Rather, you will have to take the help of the Hardware key combinations to get this job done.
    Unbrick OnePlus 7
  2. Once booted, type in the below command and you should get back the device ID. This signifies that the Fastboot connection stands successful.
    fastboot devices

    oneplus 7 pro android 13

STEP 6: Flash Downgrade Firmware on OnePlus 7/7T/7T Pro via Fastboot

  1. To begin with, launch the Fastboot Enhance Tool via its EXE file.
    Unbrick OnePlus 7
  2. Your device should be listed under the Fastboot Virtualization tab,  select it.
    Unbrick OnePlus 7
  3. After that, click on the Reboot to FastbootD button.Unbrick OnePlus 7
  4. Your device will boot to FastbootD Mode.Unbrick OnePlus 7
  5. Now go to the Payload Dumper tab and click on Browse.
    Unbrick OnePlus 7
  6. Navigate to the payload.bin file, select it and click Open.Unbrick OnePlus 7
  7. The file will now be loaded in the tool, displaying the resultant information.
    Unbrick OnePlus 7
  8. Now go to the Fastboot Virtualization tab and click on Flash payload.bin. If the flashing starts, well and good.
    Unbrick OnePlus 7
  9. However, if you get the ‘Virtual A/B temporary partitions exist’ popup, then click on No.
    Unbrick OnePlus 7
  10. After that, go to the Partitions tab and type in cow in the Filter by name box.
    Unbrick OnePlus 7
  11. Select all the partitions from the results that have cow in their name and hit the Delete button.
  12. Once done, click on Flash payload.bin. This time the flashing will start without any issues.
    Unbrick OnePlus 7
  13. Once complete, you will be notified of the same. You may now boot to the OS by clicking on Reboot to System.
    Unbrick OnePlus 7

Share: