Extract Stock Recovery from OnePlus OxygenOS Stock ROM

0
Share

Update 1: A new way to extract Stock Recovery.img from OnePlus OxygenOS Stock ROM has been added [See Method 2: Extract OnePlus Recovery from Payload.bin via Payload Dumper Go]. For now, we will only recommend this method as it does not require Python or any other similar setup. Also, the whole process hardly takes a few seconds!
Once you ignore the single restriction (a locked boot loader), you open the floodgates for plenty of opportunities. For example, you can install custom ROMs, replace the device’s stock recovery with custom TWRP. With these lines, you can also access the system partition by rooting through Magisk. It then allows you to flash tons of Magus modules and substratum themes.

One plus stock recovery file required

So that might be the real question you all have to ask – why would we need to do that? Well, the question is completely real and so it definitely deserves clarification. The main reason to grab the stock recovery file is when you want to get rid of TWRP. In other words, when you want to uninstall TWRP Recovery and return to the stock recovery that comes with your device, this is the only file you will need.

Method 1: Extract Stock Recovery from OnePlus Stock OxygenOS ROM via Payload Dumper

STEP 1: Download the Required Files

  • First and foremost, for extracting the Payload.bin file, you will need the Payload Dumper Tool. We would like to thank Gregory Montoir for creating this tool. You could download it from the following link: payload_dumper.zip
  • Next up, you should also have to install Python on your PC. Download Python v3.8.5 (latest version at the time of writing). Once you have downloaded both these files, proceed to the next step to check out their installation steps.

STEP 2: Install Python

  1. Launch the Python EXE setup file that you have downloaded. It will then ask for the installation directory. Click on Install Now if you wish to proceed with the default one, which would make it easier for you to follow this guide. Or you could also click Customize Installation if you want to change the directory.
  2. Whatever installation directory you end up choosing, make sure to keep a note of it as it will be needed later on. The installation process will be completed within a minute or two. When that is done, hit the Close button to exit the setup wizard. Now move to the next step and proceed to extract the stock recovery file from the OnePlus stock OxygenOS ROM.

STEP 3: Install Payload Dumper file

Now that you have installed Python, you could proceed with the extraction of the Payload.bin file from the OnePlus OxygenOS stock firmware and then get the stock recovery image file. For that, we will be making use of the Payload Dumper Tool. Here are all the required instructions on how to use this tool

  1. Extract all the contents of the Payload Dumper Tool inside the folder where you have extracted Python.
  2. If you have chosen the default directory while installing Python, then the contents should be extracted inside:
C:\Users\USER-NAME\AppData\Local\Programs\Python\Python <version number>

STEP 4: Extract Payload.Bin

  1. To begin with, extract the downloaded OnePlus Stock ROM. It would be in ZIP format, so you could use WinZIP or WinRAR to extract it. Once the extraction is complete, you should see a couple of files, including the payload.bin.
  2. Copy the payload.bin file from the extracted firmware and move it to the folder where you have installed Python.
  3. Hence, this directory will now have the Payload Dumper Tool, the payload.bin file, and the Python software.
  4. Inside the same folder, type in CMD in the address bar and hit Enter. This will launch the Command Prompt.
  5. Type in the below command to install the necessary dependencies:
python -m pip install -r requirements.txt
  1. Finally, execute the below command to extract all the contents of the payload.bin file. It will take some time, depending on the size of the package.
python payload_dumper.py payload.bin
  1. In our case, the payload.bin file gave us the boot, system, vendor, recovery, dtbo, and many other partition files in IMG format. Below is just an example of a few of these files in the CMD window.

TIP: Extracting of system.img takes some time. So if you are only looking for recovery.img, then hit the Ctrl+C shortcut to terminate the rest of the commands once you get the stock recovery file.

  1. Once the process is complete, all the extracted files are placed inside a folder named Output. If you have installed python in the default directory, then the location of the output folder will be:
C:\Users\USER-NAME\AppData\Local\Programs\Python\Python<version-number>/Output
  1. That’s it. Copy this recovery.img file, transfer it to the ADB directory and flash it onto your device.

METHOD 2: Extract OnePlus Recovery from Payload.bin via Payload Dumper Go

  1. To begin with, download the payload-dumper-go 1.0.0 from Github [Credits: XDA Member ssssut].
  2. Then extract it to any convenient location on your PC. The name of the file will be something like payload-dumper-go_1.0.0_windows_amd64. Rename it to payload-dumper-go.
  3. Next up, download the liblzma-5.dll file and transfer it to the same folder where the payload-dumper-go.exe file is present.
  4. After that, transfer the payload.bin file to this folder as well.
  5. So as of now, you should have the payload-dumper-go.exe, payload.bin, and liblzma-5.dll files all under one folder.
  6. Now head over to that folder’s address bar, type in CMD, and hit Enter. This shall launch the Command Prompt window.
  7. Type in the below command to extract the payload.bin file:
payload-dumper-go payload.bin
  1. The extraction process will now begin and would only take a few seconds.
  2. Once done, all the extracted files will be placed under a folder named extracted_date_time that is created inside that directory.

So with this, we conclude the guide on how to extract the stock recovery file from the OnePlus stock OxygenOS ROM. If you have any queries concerning the aforementioned steps, do let us know in the comments section below. We will get back to you with a solution at the earliest.

[su_button url=”https://t.me/getdroidroms” target=”blank” style=”flat” background=”#0064c9″ size=”7″]Join us on telegram[/su_button]