If you have modified your kernel, or installed a custom kernel, then you can follow these steps to revert back to the stock OnePlus 5 or OnePlus 5T boot.img kernel.
A number of modifications and customizations for the OnePlus 5 require that you modify your the boot.img kernel of the device. The thing is, once that is modified then you can no longer accept OTA updates directly from OnePlus. I have detailed how to install a OTA update on the OnePlus 5 while you’re rooted, but that’s not what everyone wants to do. There are some cases when someone simply needs to revert back to the stock boot image kernel.
For example, if you have installed a custom kernel on the OnePlus 5, then you may not like the results from it. So from there, your choices are to either install another custom kernel through TWRP, or use this method to flash the stock kernel again. Other times you may want to get rid of TWRP altogether and doing this requires you to revert back to the stock OnePlus 5 kernel because it needs to be modified in order to keep TWRP installed.
I do want to note though, when you boot back into Android after flashing a stock OnePlus 5 or OnePlus 5T kernel, you will lose your TWRP install. So if you want to keep TWRP with a modified version of the stock kernel (which will prevent you from accepting an OTA update from OnePlus) then follow this guide after you have restored the stock kernel.
In order to complete the tutorial below, you're going to need some things set up ahead of time. Please follow the how to install ADB and Fastboot tools guide if you haven't done so already. Then you will need to follow this guide: How to Enable Developer Mode, as well as this one which shows you How to Enable USB Debugging Mode.
You will then need to open a command prompt within the same folder as your ADB and Fastboot tools and execute the "adb devices" command (without quotes) to start the ADB service. From here, you can connect the device to the PC with a USB cable. If everything has been done properly then you'll be asked if you want to grant USB Debugging Mode access from the PC the phone is connected to.
Once granted, you can then test this by running the command "adb devices" again (without quotes) in a Command Prompt, Terminal, or Windows PowerShell to make sure the computer recognizes the device.
OnePlus 5 Stock Recovery
- Download the version of OxygenOS you’re currently on (OnePlus 5 – OnePlus 5T)
- Extract the contents of the ZIP file from Step 1
- Copy/move the boot.img file to the same directory as your ADB/Fastboot tools
- Launch a Command Prompt, Terminal or PowerShell in that directory
- Boot the OnePlus 5 into Fastboot Mode
- Connect the OnePlus 5 to the PC with a USB cable
- Type the following into the Command Prompt, Terminal or PowerShell. . .
- fastboot flash boot boot.img
- . . .then press Enter on the keyboard
- Wait for the boot IMG file to be sent and written
- Then press the Power button on the OnePlus 5 to reboot back into Android
Many Android modifications these days require you to modify the kernel boot.img file in some sort of way. Whether this is for Magisk, TWRP or even just a custom kernel, there are plenty of ways to transition away from the stock kernel that OnePlus uses. The bad part is, that once the kernel gets modified, you can no longer accept an OTA update from OnePlus. So we’re going to be going through the process of getting your phone back on the stock kernel.
To do that, we first need to visit the OnePlus downloads page for the OnePlus 5 or OnePlus 5T. Go through this list and find the exact version of OxygenOS you’re currently using. You can actually pick any version of OxygenOS as long as it’s based on the same version of Android (7.0, 7.1, 8.0, etc.). Once the firmware has been downloaded, you’ll then want to extract the contents into a convenient folder on your computer. Look through these files and pick out the boot.img file that was inside it.
We then need to move or copy that boot.img file to the same folder that you have your ADB and Fastboot tools installed to. You will then need to launch either a Command Prompt, PowerShell or Terminal from this location so we can execute the following command after we boot the device into Fastboot mode – fastboot flash boot boot.img. What we’re doing here is telling the computer to send the boot.img file to the OnePlus 5 and then write (flash) its contents on the boot partition.
As I demonstrate in the video above, the process should only take a few seconds to complete. We just need to look for two OKAY messages here to know that the process completed properly. Once that is done, you can pick the phone back up and then press the Power button to select the Start option from within Fastboot Mode. This will restart the OnePlus 5 or OnePlus 5T and then boot us back up into the regular OxygenOS software where it will be using the stock kernel again.
If this tutorial helped you in any way, please consider donating via PayPal, Patreon, Cryptocurrency, or GoFundMe. If you can't afford to donate then sharing this on social networks such as Facebook, Twitter, XDA, forums, etc. will also help a lot. I would also appreciate suggestions for Android tips and tutorials that you would like to see in the future.