Obviously, OnePlus 5/5T users are now on cloud nine. OnePlus had released the latest Android 10, although beta, to these nearly three years old devices. It’s only a matter of days for the firmware to become stable and OnePlus software support is commendable indeed.
Despite having the latest major update, the limited customization options on OxygenOS should push a lot of users to the root side. We know it, so we’re giving you a step-by-step guide on how to root your beloved OnePlus 5.
Install TWRP on OnePlus 5 running Android Pie
Not many of the users would prefer to flash beta builds. So, we believe the majority of OnePlus users currently will be running the stable Android Pie.
Basically, root access is achieved by flashing a custom recovery, here TWRP recovery and then installing the latest Magisk via custom recovery. Ultimately, flashing DM-Verity and Force-Encryption disabler via TWRP in order to address the problem caused by tampering of the core OS.
- OnePlus 5 on Android Pie based OxygenOS.
- Minimal ADB and Fastboot,
- Unlocked Bootloader of OnePlus 5/5T,
- TWRP recovery designated for OnePlus 5,
- Magisk and “DM-Verity and Force-Encryption disabler”.
- Most importantly, patience.
- Official TWRP 3.3.1 for OnePus 5; Download.
- Minimal ADB and FastBoot: Download.
- Magisk 20.4: Download
- Magisk Manager: Download
- DM-Verity and Force Encryption Disabler: Download
So, let us begin the rooting step-by-step.
Warning : Proceed further if and only if you know the risk associated with flashing custom recovery or rooting. We’re not responsible for any damage or data loss that happens to your device on following this procedure. Do this at your own risk.
Steps to Install TWRP recovery on OnePlus 5
Get ready with your PC or laptop, in which Minimal ADB and Fastboot is installed. Then follow the below steps.
- Make sure, Magisk flashable Zip file is safely stored to your phone memory in any suitable directory.
- Copy the TWRP file to the folder where ADB and Fastboot are installed.
- Turn off your OnePlus 5.
- Boot your OnePlus 5 into Fastboot mode > Press and hold the Volume Up Button + Power Button.
- Connect your phone to your PC via USB Cable.
- Open a command window on the folder where ADB and Fastboot are installed.
- Go to the folder where ADB and Fastboot are installed.
- Hold down Shift Key > Right Click on the empty space > Choose ‘Open CMD Here’.
- Execute the below command in the command window to see if your device is properly connected:
Your device needs to be unlocked before it can flash custom images. To unlock your device, if not done via developer option; Input the following command on cmd prompt terminal.
fastboot oem unlock
- Make sure the TWRP file is in the ADB folder. Execute the below command to install TWRP on your OnePlus 5:
fastboot flash recovery twrp-3.3.1-0-cheeseburger.img
- The Fastboot command will replace stock recovery with TWRP.
- Don’t restart your device once installation completes. Because rooting is yet to be done. Jump to the next step.
Disable DM-Verity and Force Encryption.
For the time being, just note that DM-Verity and Force-Encryption are the security precautions implemented by OnePlus as well as other OEM’s to prevent temperament or modification of System.
DM-Verity disabling is different depending on the current state of your device. i.e. whether encrypted or non-encrypted.
Currently Encrypted Devices
Procedure 1: This is applicable only to users who have their data currently ENCRYPTED and needs the zip just for NOT TRIGGERING DM-VERITY.
- Assuming you’re now in TWRP recovery mode, after the second steps.
- Mount the system in TWRP.
- Make sure you can browse and see the contents of the system folder via TWRP file manager – This is very important.
- Flash “DM-Verity and Force Encryption Disabler” in TWRP.
- Finally, Reboot to System.
Procedure: This is applicable only to users who have their data currently NOT ENCRYPTED AND KEEP IT DECRYPTED
- Mount the system in TWRP. Make sure you can browse and see the contents of the system folder via TWRP file manager – This is very important.
- Flash “DM-Verity and Force Encryption Disabler” in TWRP.
- Reboot back to TWRP
- Reboot to System!
NB: The above Procedure should prevent force encryption in almost all cases but users have reported that the above steps failed to decrypt the device in some instances.
Root OnePlus 5 using Magisk
Finally, it’s time to root. Immediately after completing the above steps. Do the following.
- In Fastboot Mode, use the volume buttons and choose ‘Recovery Mode’ and then press the power button to enter TWRP Recovery.
- Once you are in TWRP > Tap on ‘Install’ > Choose Magisk file which you have downloaded > Swipe right to flash.
- Of course, you’ve now rooted your device.
- But again, don’t reboot the device.
- Since you’ve to disable the DM-Verity checksum and Force-Encryption to avoid boot loops.
- Proceed to the third step with immense patience.
Root OnePlus 5 Android 10 Beta
Official TWRP for Android 10 isn’t available yet. So in order to avoid failure and assure a successful root, we should use a patched Magisk image to root the OnePlus on Android Beta.
- Download the full OTA package of your currently running Android 10 Beta version.
- Use a file manager to extract boot.img from the zip file.
- Use Magisk Manager to patch the extracted boot.img.
- Copy the generated magisk_patched.img to a PC.
- Uninstall Magisk Manager completely, otherwise, the chance of getting into a boot loop is high.
- Enable “USB debugging” in Developer options.
- Connect the phone to pc using the USB cable.
- Restart the phone in Bootloader mode.
- Input the below command on pc and restart the phone using the patched image.
fastboot flash boot magisk_patched.img
- Reinstall Magisk Manager and install Magisk directly.
Above in this article, we’ve tried our best to enlist each and every step needed for successfully rooting your OnePlus 5. The above guide should yield the result if done properly. However, errors or failures shouldn’t be completely ignored.
Although root access has got its own merits and demerits, we’d recommend our readers to stick with the untampered firmware. Since the safety and satisfaction of the readers are our utmost priority.
Have any questions can ask us in the comments below.