The most awaited smartphone of the year, Oneplus 5 finally launched on 20th of June, 2017. It features Qualcomm Snapdragon 835, 6 gigabytes of RAM, 1080p display, 16-20 MP dual camera setup and bluetooth 5.0. On the launch day itself, Oneplus released the device trees and kernel sources for the Oneplus 5. It’s not a surprise considering the amount of development which took place for the Oneplus 3T. Oneplus completely supports custom development for their devices and hence does NOT voids its warranty. This paves a broader way for the users to try better software, kernel on their devices. In this article I will show you how you can utilize the complete potential of your Oneplus 5.

This guide consists of 3 sections –

  1.  How to unlock Oneplus 5 bootloader
  2.  How to flash TWRP recovery on Oneplus 5
  3.  How to root oneplus 5

Prerequisites –

Before we go into the actual process, lets make some necessary settings on your Oneplus 5.

  1. Go to Settings.
  2. Scroll down and go to About Phone.
  3. Scroll down and tap on build number 7-10 times until you see a popup stating ‘You are now a developer’.
  4. Press back and now a new section called ‘Developer Options’ will appear in settings. Tap on it and turn on the toggle at the top.
  5. Now scroll down and turn on OEM unlocking and USB Debugging.
  6. Now make a backup of all your data as the next step will wipe all the data present in the Internal Memory.
  7. Make sure you have atleast 70-80% battery to prevent unexpected failures.

Downloads –

  1. Download and install ‘Minimal ADB and Fastboot’ from here.
  2. Download the latest TWRP recovery from here.
  3. Download the latest Magisk zip from here.

How To Unlock Oneplus 5 Bootloader –

  1. Connect your Oneplus 5 to the PC. You might get a popup on your phone when you connect it for the first time after enabling USB debugging. Check mark ‘Always allow from this computer’ and tap on OK.
  2. Power off your phone.
  3. Now, press and hold ‘Power + Volume Down’ buttons at the same time until you see the recovery mode.
  4. Now, tap on English -> Advanced -> Reboot to fastboot -> Reboot to fastboot. This will boot your Oneplus 5 to fastboot mode.
  5. Connect your phone to the PC and let the drivers install.
  6. Now, go to the ‘Minimal ADB and Fastboot’ folder in C drive -> Program Files.
  7. Now, while holding the shift key on your keyboard, right click in an empty space and click on ‘Open command window here’.
  8. Run the following code to check if the Oneplus 5 is properly connected or not.
    fastboot devices
    If it is properly connected, the command line will return with your device’s serial number.
  9. Run the following code to unlock the bootloader
    fastboot oem unlock
  10. You’ll see a new screen on your phone, just choose ‘Yes’ and confirm it.

Now, your phone will boot into system with an unlocked bootloader. Repeat prerequisites steps again to make sure that USB debugging is turned ON.

How To Install TWRP Recovery On Oneplus 5 –

  1. Copy and paste the TWRP recovery to the ‘Minimal ADB and Fastboot’ folder.
  2. Now, boot your Oneplus 5 into fastboot mode again.
  3. Connect it to the PC and let the fastboot drivers install.
  4. Open command line from the Minimal ADB folder the same way as above.
  5. Run the following code to check if the Oneplus 5 is properly connected or not.
    fastboot devices
    If it is properly connected, the command line will return with your device’s serial number.
  6. Run the following code to flash the TWRP recovery on your Oneplus 5.
    fastboot flash recovery twrp.img
  7. After fastboot has successfully flashed TWRP on your device, don’t boot into OS as the stock recovery will overwrite TWRP.
  8. Run the following command to boot into TWRP recovery rightaway from the command line so that it doesn’t get overwritten by the stock recovery.
    fastboot boot twrp.img
  9. Make a Nandroid backup from TWRP so that if anything goes wrong, you are safe and sound. To make a Nandroid backup, tap on Backup and Swipe to Backup the stock rom.
  10. Now, click on ‘Reboot System’ to boot into OS.

Congratulations, you’ve successfully flashed TWRP recovery on your Oneplus 5. Now you can root your Oneplus 5, flash custom roms, kernels, patches, etc and customize it to your needs. To boot into recovery, power off your device. Then, press and hold ‘Power and Volume Down’ buttons at the same time until you see the TWRP logo.

How To Root Oneplus 5 –

Rooting a device isn’t a tough task once you are familiar working with custom recoveries. So feel free to explore TWRP recovery once you have made a Nandroid backup. It will make you feel comfortable with hacking android devices.

  1. Boot into TWRP recovery by the above method.
  2. Now, tap on ‘Install’ and navigate to the file.
  3. Tap on the zip file and Swipe to confirm Flash. Wait for the the flashing process to get completed.
  4. Now, tap on ‘Wipe cache/dalvik’ and Swipe to Wipe.
  5. Now, tap on Reboot system.
  6. The first boot will take 5-10 minutes and might loop a few times. So, don’t panic.

Congratulations, you’ve successfully rooted your Oneplus 5 and ready to enter the world of hacking android systems!