A Beginner’s Guide to Unlock Bootloader, Install TWRP Recovery, and Root OnePlus 8 (Pro) using Magisk

A Beginner's Guide to Unlock Bootloader, Install TWRP, and Root OnePlus 8/8 Pro

This is a comprehensive all-in-one guide through which you’ll learn how to unlock the bootloader, install TWRP recovery, and simultaneously root OnePlus 8/OnePlus 8 Pro using Magisk. This guide and the included instructions are compatible with any OnePlus 8 or OnePlus 8 Pro running Android 10 (OxygenOS 10).

Advertisement

OnePlus phones are extremely development-friendly, primarily because the bootloader unlocking is easily possible through fastboot. Soon after the launch, stable builds of TWRP recovery for the OnePlus 8 and OnePlus 8 Pro were released, courtesy of XDA Recognized Developer mauronofrio.

Update: The development of TWRP for the OnePlus 8 and 8 Pro is now being handled by XDA Recognized Developer infected_. Here’s the link to the original XDA development thread.

His builds support Android 11 (OxygenOS 11). Support for Android 12 is still in works.

Although the recovery is currently labeled as ‘unofficial’, it’s quite stable for usage. According to the developer, the available builds of TWRP support decryption of the data partition/internal storage, and can be used for backing up/restoring NANDroid backups, and also to install flashable ZIPs like custom ROMs, kernels, etc.

With TWRP now available, you can use it to flash Magisk and easily root the OnePlus 8/8 Pro. Rooting via Magisk will not only allow you to use root applications but also install Magisk modules to modify your phone’s software systemless-ly. This, in turn, enables you to keep the critical partitions untouched which can be extremely beneficial for passing SafetyNet checks and also for installing OxygenOS OTA updates after rooting.

It does not matter if you’re just a beginner or a veteran in the field of software modding; the instructions in this guide will take you through the complete process in a step-by-step manner. So, by the time you’re finished reading this guide, you’ll be able to:

  • Unlock the bootloader
  • Install TWRP recovery
  • and, root your OnePlus 8/OnePlus 8 Pro using Magisk.

Did you know? You can also root the OnePlus 8 series without TWRP. This is beneficial if you do not find a particular need for your use-case and also makes the OTA-on-rooted-phone process much easier.

Table of Contents

Before You Begin

Before you start following the instructions, there are a few requirements that should be met. These are:

  • A major part of this guide requires using a PC. So, you will need a Windows, Linux, or Mac PC.
  • Take a backup of all your important data stored on your phone. Everything including the apps, contacts, messages, photos, videos, documents, and complete internal storage will be erased while performing this process. If you need a hand, you can refer to our very own and simple guide to take full backups.
  • Second, charge your OnePlus 8 to a sufficient battery level (recommended: 60% or above). This shall prevent your phone from suddenly shutting down in the middle while you’re performing the steps.
  • At various points during the instructions, we’d ask you to boot your OnePlus 8/8 Pro into Fastboot and Recovery modes. It’s very important that you know how to do that and get comfortable doing it. Refer to this page for instructions.
  • You will often need to connect your OnePlus 8 to your PC while performing certain parts of the instructions. So, in order for the PC to properly recognize your phone, you will need to have the latest version of the OnePlus USB drivers installed.

Downloads

Below, you will find the links to download all the files you’ll need. You can download these to your PC beforehand, or when you’re asked to while performing the instructions.

It’s strongly recommended that you always download and use the latest version of TWRP and Magisk at the given point. The latest TWRP recovery image file for the OnePlus 8/8 Pro is available on AndroidFileHost. The latest version of Magisk could be download directly from the official GitHub release page.

Note: For documentation purposes, we have provided the download links for the latest versions of both TWRP and Magisk at the time of last updating this guide.

Instructions

Like any other modern-day Android device, rooting the OnePlus 8 (Pro) could be done in two different ways. First is through TWRP recovery, by using it to flash the Magisk root package. The second way to root is by flashing a Magisk patched boot image to your OnePlus phone via fastboot.

In this guide, we are focussing our attention on the former, that is, rooting the phone through TWRP recovery. In doing so, not only you’d learn how to root but also how to install TWRP on the OnePlus 8/8 Pro, which you can further utilize for flashing ROMs, kernels, taking backups, etc.

The process itself is quite straightforward. So without any ado, follow the steps below to unlock the bootloader, install TWRP, and root OnePlus 8/8 Pro using Magisk.

Step 1: Set up Android SDK Platform-tools on PC

The first step of the process is to install and set up the Android SDK Platform-tools on your PC. These platform-tools include the fastboot command-line tool that you’ll need for unlocking the bootloader, as well as for installing TWRP.

The quickest and easiest way to install the Android SDK Platform-tools is by doing it manually, which is exceptionally easy (believe me it is). To do this:

Advertisement

  1. First, download the latest version of the Android SDK platform-tools on your PC:
  2. Once you have downloaded the platform-tools ZIP file, extract its contents. Once extracted, move the ‘platform-tools’ to an easily accessible location on your PC. If you’re using Windows, we suggest moving the folder to the C:\ drive. On the other hand, if you’re using Linux/macOS, move the folder inside the ‘Documents’ folder.
  3. Now, you need to launch the command-line window inside the ‘platform-tools’ folder, where the fastboot tool/binary is present.

That’s it, you now have the Android SDK platform-tools set up and ready-to-use for the steps that follow. Make sure that you keep this command-line window open until you’re asked to close it. Although if you do accidentally close it, you can always launch it again.

Some notes about fastboot

  • When entering fastboot or ADB commands while performing the instructions, make sure that you use the right syntax according to your PC. In Windows PowerShell, prepend the given command with a dot and backslash [.\]. In Linux/Mac Terminal, prepend the commands with a dot and a forward slash [./].
  • Users often confide in one-click ADB/Fastboot installers such as Minimal ADB and Fastboot. However, we would not recommend you to use such installers because most (if not all) of them contain outdated versions of the ADB and Fastboot tools.
  • If you encounter unusual errors while using fastboot commands, then try using the USB 2.0 ports of your PC to connect your phone.

Step 2: Unlock OnePlus 8 Bootloader

Unlocking your OnePlus 8/OnePlus 8 Pro’s bootloader is the top-level requirement for installing TWRP, rooting, or making any other sort of modifications to the software.

Thankfully, the bootloader on OnePlus phones can easily be unlocked using a simple fastboot command. You wouldn’t need to acquire any unlock key or get a server-side approval from the manufacturer, which makes the process a whole lot easier and very less time-consuming.

To unlock the bootloader on the OnePlus 8/8 Pro:

  1. First, enable the Developer Options menu.
  2. Then go to ‘Settings’ > ‘System’ > ‘Developer options’ and turn ON the ‘OEM Unlocking’ switch. Without enabling OEM Unlocking, your phone will not accept the bootloader unlocking command.
    Enable OEM Unlocking on OnePlus 8/8 Pro
  3. Now, power off your OnePlus 8 completely and boot it into Fastboot Mode.
    Connect OnePlus 8/8 Pro to PC in Fastboot Mode
  4. Connect the phone to your PC over USB, while it’s in Fastboot Mode.
  5. Enter the following command in the PowerShell/Terminal to ensure that the PC can recognize and communicate with your phone over the fastboot interface:
    fastboot devices
  6. The command should return your phone’s unique ID. If it doesn’t, then ensure that you have the proper OnePlus USB drivers installed and try using a USB 2.0 port on your PC.
  7. Now, enter the following fastboot command to unlock the bootloader on your OnePlus 8/8 Pro:
    fastboot flashing unlock

    Enter fastboot command to unlock bootloader on OnePlus 8/8 Pro

  8. As soon as the command is entered, you will see a message on your phone’s screen, prompting you to confirm the unlock. Simply use the Volume keys to highlight “UNLOCK THE BOOTLOADER” and press the Power button to confirm.
    Confirm Bootloader Unlock on OnePlus 8/8 Pro

Your phone will automatically reboot into the system (OS). You will also see the unlocked bootloader warning message during the initial boot process. This is a mandatory warning and completely normal.

Do note that the only way to get rid of this warning message is by relocking the bootloader, which is NOT RECOMMENDED if you plan on installing TWRP, rooting, etc.

OnePlus 8/8 Pro Unlocked Bootloader Warning

That’s it! Your OnePlus 8’s bootloader is now unlocked. From here on, you can head over to the next step to install TWRP recovery. Or, if you wish to root your OnePlus 8/8 Pro without TWRP, then directly skip to this tutorial.

Step 3: Install TWRP Recovery

With an unlocked bootloader, you can now install TWRP recovery on your OnePlus 8/8 Pro. According to the developer, OnePlus has re-introduced the /recovery partition. This means you will not need to temporarily boot TWRP image and then flash the TWRP installer ZIP for permanent installation anymore.

Instead, you can now simply flash the TWRP recovery image to the /recovery partition of your phone, as shown in the instructions below.

To install TWRP on the OnePlus 8/8 Pro:

  1. First, download the latest TWRP recovery image to your PC.
  2. Move the downloaded image file inside the ‘platform-tools’ folder and launch the PowerShell/Terminal window on the PC (refer to step #1).
    Move OnePlus 8/8 Pro TWRP image inside 'Platform-tools' folder
  3. Power off your phone completely and boot it into Fastboot Mode by holding the Volume Up, Volume Down, and Power buttons together.
  4. Connect the phone to the PC using the USB cable.
  5. Enter the following command to ensure that your PC can communicate with the phone over the fastboot interface:
    fastboot devices
  6. Now, flash the recovery image to install TWRP on your OnePlus 8/8 Pro using the following command:
    fastboot flash recovery twrp-image-filename.img

    Replace “twrp-image-filename.img” with the full filename of the TWRP recovery image you’re flashing. For example, if you’re going to install TWRP 3.4.0-2, then the command should be:

    fastboot flash recovery twrp-op8-3.6.0_11-infected-b5.img

    Flash TWRP Recovery Image on OnePlus 8/8 Pro

  7. Boot your phone right into recovery mode now. To do this, tap the Volume keys until you see the “Recovery Mode” selection on the top of the fastboot screen. Then press the Power button to confirm and boot your OnePlus 8 into TWRP recovery mode.
  8. Upon entering, TWRP will prompt you to enter the password to “Decrypt Data“. Simply input your phone’s lock screen password/PIN.
    Decrypt Data in OnePlus 8/8 Pro TWRP Recovery

That’s it! Now with your phone in TWRP recovery mode, head over to the next and final step for rooting.

Step 4: Root OnePlus 8/8 Pro by Flashing Magisk

With TWRP installed, you can now flash the Magisk installer file to root your OnePlus 8/OnePlus 8 Pro. The instructions for this are as follows.

  1. First, download the latest Magisk installer file on your PC.
  2. Next, connect your OnePlus 8/8 Pro to the PC via USB. Your PC will recognize and automatically mount your phone’s internal storage over MTP. In case it doesn’t, go to the ‘Mount’ menu of TWRP and press the ‘Enable MTP’ button.
  3. Transfer the downloaded Magisk APK file to your phone’s internal storage.
  4. Disconnect the phone from the PC once the file has been transferred.
  5. Now go to the ‘Install’ menu from the TWRP main screen.
  6. Navigate through the phone’s internal storage (/sdcard) and select the Magisk installer file (e.g. Magisk-v23.apk) to add it to TWRP’s flashing queue.
    Flash Magisk ZIP to Root OnePlus 8/8 Pro
  7. Finally, swipe the button on the bottom of the screen to flash Magisk and root your OnePlus 8/OnePlus 8 Pro.
  8. Once the flashing process finishes, press the ‘Reboot’ button and select ‘System’.
    Reboot OnePlus 8/8 Pro into System after rooting

Your phone will now boot into the system (OS) and should be rooted via Magisk. To verify this, launch the “Magisk Manager” application and check Magisk’s installation status. It should look as shown in the figure below.

OnePlus 8/8 Pro successfully rooted with Magisk

That’s it! Through this guide, you have learned how to unlock the bootloader, install TWRP, and root your OnePlus 8/8 Pro using Magisk. You can now use TWRP recovery to flash custom ROMs or kernels available on XDA, use root applications like Titanium Backup, and install Magisk Modules to apply modifications to your phone’s software systemless-ly. With root permissions, you can also install the ViPER4Android audio mod on the OnePlus 8 series.

Note: If you wish to unroot your phone at any point during the future, you can easily do so by using the ‘Uninstall’ option in Magisk Manager or flashing the Magsk Uninstaller ZIP file (Download here) using TWRP. Further, you can also follow this tutorial if you wish to revert your OnePls 8/8 Pro back to stock OxygenOS software.

Have any questions or find yourself stuck anywhere while performing the instructions? Do let us know.

// TWRP source

Comments

  1. Hello
    I already spoke yesterday about another of your guides.
    If I understand everything I am reading correctly, the implementation of TWRP cannot be done currently for Oxygen OS 11 (version 11.0.8.8 or lower).
    And if I understood correctly also, this TWRP implementation can be done only with Oxygen OS 10 and then install Oxygen OS 11.
    But in this case I don’t understand how TWRP works under Oxygen OS 10 and after under Oxygen OS 11?
    Finally, in any case, setting up TWRP via ADB Fastboot systematically results in the loss of personal data: applications and their data, photos, recording in the “Download” directory, etc. That’s right ?
    Thank you again for all your work and thank you in advance for your explanations about this present message.

  2. Question for you Dhananjay: Since rooting your OnePlus 8 Pro, have there been times when the SIM card was not detected on rebooting? That is a minor issue I have faced. About every third or fourth time on rebooting the SIM card is not detected and I have to reboot another 1 or 2 times before it is detected again.

    I am sure it is related to rooting as the issue does not occur when the phone is unrooted. And switching SIM cards makes no difference. I have no modules installed from Magisk and it’s strange that it occurs only occasionally. I saw a couple of other posts about the issue with no reason given. I was wondering if you ever experienced the SIM card detection issue or any ideas as to what could be causing the problem.

    1. Jason, a small correction. It’s the OnePlus 8 that I have. But the same principles, and in this case, the method applies. I have personally never faced any problems like such, neither with Android 10 (OOS 10) and nor with Android 11 (OOS 11).

      Generally, issues related to SIM, Network, WiFi, etc are caused if you patched and used the wrong boot image. That is, a boot image extracted from a different OxygenOS version and/or variant than the one that’s currently installed on your phone.

      For instance, if you OOS 11.0.4.4 installed on your OnePlus 8 Pro (Global variant). Then you should always use the stock boot image extracted from the OOS 11.0.4.4 (Global) OTA.

  3. I have followed all the steps when I reboot after flashing Maj I get to a screen

    QUALCOMM CrashDump Mode

    attempted to kill init! exitcode=0x0000000b

    complete_and_exit

    1. Hi Max, I believe your OnePlus 8/Pro is running Android 11, right?

      TWRP hasn’t been updated to support Android 11 on the OP8 series yet. According to the developer, a new build will be coming out soon, which will also be up on TWRP’s official website. Once it is out, I will update this post.

      Now, to get you out of this situation. You can exit Crashdump Mode by holding the Volume Up and Power keys together for about 10-15 seconds.

      Did you flash the recovery image or used the ‘fastboot boot’ command to temporarily boot it? In case you did the former, you will need to flash the stock recovery back to the phone to fix this issue. If that’s the case, let me know if it’s the OP8 or OP8 Pro and what OxygenOS version it is running. I will extract the stock recovery and share it here so that you can use it.

  4. I followed these steps to step 5 but am unable to find my device. I am using a Windows Laptop running Windows 10 and the USB 3.0. Could this be the reason?
    Also does unlocking the Bootloader and flashing the device void a Tmobile carrier warranty?

    1. Hi Logan. After connecting the phone to the computer (while in Fastboot Mode), go to ‘Control Panel’ > ‘Device Manager’ on your laptop and check if the device is listed there. It should be identified as “Android Bootloader Interface’.

      If you see a yellow warning icon, it means there’s an issue with the USB drivers.

      As for the warranty, you wouldn’t void it if the phone is purchased directly from OnePlus (citation). For the T-Mobile variant, you might want to check the official resources linked on this page.

  5. It’s me again…
    I did not manage to unlock the Bootloader with the command “fastboot flashing unlock”
    I performed the unlocking with the command “fastboot oem unlock”.
    The Bootloader is now effectively unlocked.
    Is there a reason for this difference in command?
    thank you so much

    1. Hi Jean. “fastboot oem unlock” is the old command that was used for bootloader unlocking. It’s odd, because I unlocked and locked the bootloader quite a few times using the ‘fastboot flashing unlock’ and ‘fastboot flashing lock’ command respectively. And it worked without any problems.

      Just to confirm, you’re using the latest platform-tools from this page, am I right?

  6. for Dhananjay Bhardwaj
    Hello
    No I haven’t installed TWRP on my Pro 8 and I haven’t rooted it either.
    For all these days, I continue to inform myself …
    I’m also waiting for the stable version of Oxygen 11 to decide to root with Magisk and install TWRP …
    I will then be obliged to reset all the parameters of the applications which are installed today on the Pro 8 and this “perspective” seems tedious to me !!!

    1. That’s extremely good. I hope more users would first try and understand what exactly they are/will be doing and then follow the instructions. In the process, they will learn and gain knowledge, and at the same time, reduce the scope of running into any problems.

      For OxygenOS 11, you could simply use the in-built Local Upgrade option and install the ROM package. Just in case you want to update sooner. Everything about that is covered here.

      If you’d want my opinion, I would say to root without TWRP, at least that’s what I do for all my devices now. TWRP is good if you plan on flashing custom ROMs, kernels, or taking NANDroid backups. But if you’re not into those things, simply rooting via Magisk should suffice.

    1. The tutorial you linked will guide you through taking OxygenOS OTA updates on your rooted OP8/8 Pro (without TWRP). So no, the result will not be the same. If you have TWRP, you’d need to follow an extra step as demonstrated in this guide.

      Do you already have TWRP installed on your phone? Which OxygenOS version is it running? And which OxygenOS version do you want to install? Please provide more details.

  7. Did you just flashed TWRP to your OnePlus 8/8/pro?
    I have been reading posts that the developer don’t advice it to be flashed, he mentioned just boot to TWRP.
    Does your device don’t end up having bootloops?

    1. Yes, Milo, I did flash TWRP onto the OP8. However, I mostly favor the Magisk-only setup on all my devices, so never tried further.

      I will add a note to this article to reflect this recommendation so that users, especially those who are new to the scene don’t land up their phone in a bootloop (as indicated by the recent reports on the XDA thread).

Leave a Reply

Your email address will not be published. Required fields are marked *