Unlock Bootloader, Install TWRP Recovery and Root OnePlus 5

0

The OnePlus 5 has hardly been out for a week but when has that ever stopped the independent developers. They’ve already found a way to install TWRP and root OnePlus 5. In fact, rooting the 5 is quite easy. Unlike other OEMs which won’t let you unlock the bootloader until you get a key from them, unlocking a OnePlus device is also a fairly simple process. After all, it is an enthusiast’s brand. XDA Senior Member xdvs23 is the one to have come up with a build of the TWRP custom recovery for the OnePlus device.

You’ll need to meet some requirements before you can root your OnePlus 5 though.

Prerequisites

  • Install ADB and fastboot on your PC if you haven’t already.
  • Enable USB debugging and OEM unlocking on your OnePlus 5.
  • Make sure your device has enough battery juice left, preferably over 50%.
  • Back up all your data because unlocking the bootloader will wipe everything off your device. In any case, it is always a good idea to backup all of your data beforehand in case something goes wrong.

Downloads

Rename the TWRP image file to recovery.img for ease of installation and then move it inside the adb installation folder. This is C:\Program Files (x86)\Minimal ADB and Fastboot by default unless you changed it during installation. Install TWRP and Root OnePlus 5

Unlock Bootloader

  1. Power off your phone.
  2. Press and hold the Volume Up and Power button together on your OnePlus 5 until it boots into fastboot mode.
  3. Connect it to your PC via a USB cable and make sure the connection isn’t loose.
  4. Now go to the ADB installation folder on your PC. (C:\Program Files (x86)\Minimal ADB and Fastboot)
  5. Type in cmd in the address bar and hit enter to open a command prompt window in the folder. Install TWRP and Root OnePlus 5
  6. Now let’s see if your device is properly connected to your PC. To do this, type the command given below and hit enter.
    fastboot devices
  7. If your device is connected, you will see your phone’s serial number and if you don’t, you should check if you have installed all the required drivers.
  8. Type the command below to unlock your bootloader if your device is detected. Remember this will wipe everything on your phone.
    fastboot oem unlock
  9. On your phone, you will be warned about unlocking the bootloader, press the Volume Up button to highlight Yes and the Power button to select it.
  10. When your device reboots, power it off again and boot into recovery mode. To do this, press and hold the Power and Volume Down buttons together for a few seconds.
  11. In the stock OnePlus recovery, wipe all user data and then power off your device again.

Install TWRP recovery

  1. Open a command window in the ADB installation folder again if you have closed the previous one.
  2. Boot your phone into fastboot mode and connect it to your PC.
  3. Enter the following command to flash the TWRP image file.
    fastboot flash recovery recovery.img
  4. When the flashing is complete, and it will be in a coupe of seconds, don’t reboot your phone using any fastboot commands. Instead, manually disconnect your phone and then boot into Recovery using the Power and Volume Down buttons.
  5. Your phone should boot into TWRP recovery this time.
  6. Swipe to allow modifications if asked.

Root OnePlus 5

  1. Now that your OnePlus 5 has TWRP recovery installed you can root it.
  2. Users who wish to decrypt their device, download the latest no-verity-opt-encrypt zip and transfer it to your phone along with SuperSU or Magisk. Then go to Wipe > Format Data and type Yes when asked if you want to mount internal storage. Those who wish their OnePlus 5 to remain encrypted can ignore this step.
  3. Download and transfer SuperSU or Magisk from the download section and transfer the files to your phone over the MTP connection.
  4. Select Install from the TWRP main menu.
  5. Navigate to the SuperSU or Magisk file that you’ve previously transferred to your phone and select it.
  6. Swipe to flash the file.
  7. You will see a Reboot system button at the bottom one the flashing is complete, tap on it.
  8. Your device will reboot and when it does you should see the SuperSU or Magisk Manager app in your app drawer.

If you chose SuperSU, your device might reboot a couple times before fully booting up the first time.