Home > Root

How to Root OnePlus OxygenOS 13 Android 13 via Magisk

In this guide, we will show you the steps to root your OnePlus device running the latest OxygenOS 13 based on Android 13 via Magisk. The OEM is being bashed left right, and center for its controversial decision to ditch its beloved OxygenOS in favor of the bloated ColorOS. Likewise, things aren’t too good in custom development either, again thanks to its decision to no longer make the MSM Tool public.

However, in spite of all the roadblocks, there are still some lights at the end of the tunnel. You still have the opportunity to gain administrative privileges by rooting your OnePlus device via Magisk which is currently running OxygenOS 13 based on the latest Android 13. However, with the thirteenth iteration of the OS, there has been a major change in the way we used to root our device. So first let’s make you aware of that and then we’ll proceed with the rooting instructions.

What’s Different in Rooting Android 13

With the launch of Android 13, there has been some major reshuffle in the rooting domain. Earlier you just need to extract the stock boot.img, patch it via Magisk, and then flash it via Fastboot. However, now, “in some cases”, you might need to use stock init_boot.img instead of the boot.img. So what are those “cases”? Well, if your device was launched with Android 13 [or a higher version of OS] out of the box [such as OnePlus 11, Pixel 7 Pro, Xiaomi 13 Pro, etc], then you’ll need to use the init_boot.img.

On the other hand, if your device was launched with Android 12 or lower version but has since received the update to Android 13 [such as OnePlus 10 Pro, Pixel 6 Pro, Xiaomi 12 Pro], then you’ll still be using the boot.img file to root your device. In the case of OnePlus, the OnePlus 7, 8, 9, and 10 should still use the boot.img whereas OnePlus 11 should use the init_boot for rooting their device. With that in mind, let’s get started.

Benefits and Risks of Rooting OnePlus

Once you root your device, you will be in a position to flash a plethora of mods. These include the likes of Fox Magisk Modules, Substratum Themes, Xposed Framework via LSPosed, and Viper4Android among others. Along the same lines, you could also flash a custom kernel and implement your desired CPU profile. However, such tweaks do come in with a few risks as well.

root oneplus android 13

To begin with, rooting requires you to unlock the bootloader- which will wipe off all the data and could nullify the warranty as well. Likewise, SafetyNet will be triggered [FIXED] which will result in your inability to use banking apps [FIXED]. So if all that’s well and good, then let’s get started with the steps to root your OnePlus device running OxygenOS 13 Android 13 via Magisk.

Root OnePlus OxygenOS 13 Android 13 via Magisk Boot.img

root oneplus android 13

These steps are applicable for those devices which were launched with Android 12 or [older version] and have since been updated to Android 13 [such as OnePlus 8, 9, and 10]. Moreover, please take a backup of all the data on your device, just to be on the safer side. Droidwin and its members wouldn’t be held responsible in case of a thermonuclear war, your alarm doesn’t wake you up, or if anything happens to your device and data by performing the below steps.

STEP 1: Install Android SDK

install adb platform tools windowsFirst and foremost, you will have to install the Android SDK Platform Tools on your PC. This is the official ADB and Fastboot binary provided by Google and is the only recommended one. So download it and then extract it to any convenient location on your PC. Doing so will give you the platform-tools folder, which will be used throughout this guide.

STEP 2: Enable USB Debugging and OEM Unlocking

Next up, you will have to enable USB Debugging and OEM Unlocking on your device. The former will make your device recognizable by the PC in ADB mode. This will then allow you to boot your device to Fastboot Mode. On the other hand, OEM Unlocking is required to carry out the bootloader unlocking process.

root oneplus android 13

So head over to Settings > About Phone > Tap on Build Number 7 times > Go back to Settings > System > Advanced > Developer Options > Enable USB Debugging and OEM Unlocking.

STEP 3: Unlock Bootloader on OnePlus

After this, you will have to unlock the bootloader on your device. Do keep in mind that this process will wipe off all the data and might nullify the device’s warranty as well. So if that’s all well and good, then refer to our comprehensive guide on How to Unlock Bootloader on OnePlus.

root oneplus android 13

STEP 4: Download OnePlus Firmware

Next up, download the stock firmware for your device from the OnePlus official website or via the Oxygen Updater App. Make sure to download the same version which is currently installed on your device. You could verify the same from Settings > About Device > Version > Build Number.

root oneplus oxygenos 13

STEP 5: Extract OnePlus Boot.img from Payload.bin

Once you have downloaded the firmware, extract it to any convenient location on your PC. Doing so shall give you a couple of files, including the payload.bin.

root oneplus android 13

For the unaware, OnePlus packs all its partition IMG files inside this payload.bin file, so you will have to extract it first. For that, you may refer to our guide on How to Extract payload.bin and get the stock boot image file.

root oneplus android 13

STEP 6: Patch OnePlus Boot.img via Magisk

  1. Download and install the Magisk App on your device.
  2. Then launch it and tap on the Install button next to Magisk.
  3. After that, choose ‘Select and Patch a File’, and navigate to the stock boot.img file, and select it.
    root oneplus android 13
  4. Then tap on the Let’s Go button situated at the top right.
    root oneplus android 13
  5. The boot.img file will now be patched and placed under the Downloads folder on your device. You should transfer this file to the platform-tools folder on your PC. We will now be using this file to root your OnePlus.
    root oneplus android 13

STEP 6: Boot OnePlus to Fastboot Mode

  1. Now connect your device to the PC via USB cable. Make sure USB Debugging is enabled.
  2. Then head over to the platform-tools folder, type in CMD in the address bar, and hit Enter. This will launch the Command Prompt.
    command-prompt-inside-adb
  3. Type in the following command in the CMD window to boot your device to Fastboot Mode
    adb reboot bootloader

    root oneplus android 13

  4. To verify the Fastboot connection, type in the below command and you should get back the device ID.
    fastboot devices

    root Pixel 6A

  5. If you are not getting any Serial ID, then please install Fastboot Drivers.

STEP 7: Boot OnePlus using Magisk patched Boot.img

Now, there exist two different methods to proceed ahead. You could either directly flash the patched boot.img file [see FAQ] or temporary boot it. The second approach is highly recommended because you could easily test if everything is working well or not. If it is, then you could proceed ahead with the permanent installation.

root oneplus android 13

On the other hand, if things don’t go as planned and your device ends up in a bootloop/softbrick, then just a normal reboot will fix the issue. So on that note, let’s get started with the second approach. For that, execute the below command in the CMD window and your device will be booted to a temporarily rooted OS.

fastboot boot magisk_patched.img

STEP 8: Permanent Root OnePlus via Direct Install

After executing the above command, your device will be booted to the OS with a temporary root. Here’s how to make it permanent:

  1. To begin with, launch the Magisk Manager App.
  2. Then tap on Install > Direct Install and tap Let’s Go situated at the top-right.
    root oneplus android 13
  3. Once done, hit the Reboot button situated at the bottom right.
  4. That’s it, your device will now boot to the rooted OS.

FAQ: Root OnePlus via Direct Flashing

As discussed above. we used the approach of temporary booting to the rooted OS and then used Magisk’s Direct Install method to permanently root your device. However, if you wish to root your device by directly flashing the patched boot.img, then use the below command:

fastboot flash boot magisk_patched_boot.img

root oneplus android 13

That’s it. These were the steps to root your OnePlus running OxygenOS 13 Android 13 via Magisk patched boot.img. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.

Root OnePlus OxygenOS 13 Android 13 via Magisk Init_Boot.img

These steps are applicable on those devices which were launched with Android 13 [or higher version] out of the box [such as OnePlus 11]. Moreover, please take a backup of all the data on your device, just to be on the safer side. Droidwin and its members wouldn’t be held responsible in case of a thermonuclear war, your alarm doesn’t wake you up, or if anything happens to your device and data by performing the below steps.

STEP 1: Checkmark the Prerequisites

First off, carry out the prerequisites listed from STEP 1 to STEP 4 above [till Download OnePlus Firmware].

STEP 2: Extract OnePlus Init_Boot.img from Payload.bin

Once you have downloaded the firmware, extract it to any convenient location on your PC. Doing so shall give you a couple of files, including the payload.bin.

root oneplus android 13

For the unaware, OnePlus packs all its partition IMG files inside this payload.bin file, so you will have to extract it first. For that, you may refer to our guide on How to Extract payload.bin.

root oneplus android 13

STEP 3: Patch OnePlus Init_Boot.img via Magisk

  1. Download and install the Magisk App on your device.
  2. Then launch it and tap on the Install button next to Magisk.
  3. After that, choose ‘Select and Patch a File’, and navigate to the stock init_boot.img file, and select it.
    root oneplus android 13
  4. Then tap on the Let’s Go button situated at the top right.
    root oneplus android 13
  5. The init_boot.img file will now be patched and placed under the Downloads folder on your device. You should transfer this file to the platform-tools folder on your PC and rename it to magisk_patched_boot.img.
    root oneplus android 13

STEP 4: Boot OnePlus to Fastboot Mode

  1. Now connect your device to the PC via a USB cable. Make sure USB Debugging is enabled.
  2. Then head over to the platform-tools folder, type in CMD in the address bar, and hit Enter. This will launch the Command Prompt.
    command-prompt-inside-adb
  3. Type in the following command in the CMD window to boot your device to Fastboot Mode
    adb reboot bootloader

    root oneplus android 13

  4. To verify the Fastboot connection, type in the below command and you should get back the device ID.
    fastboot devices

    Root Pixel 7 Pro

STEP 5: Root OnePlus using Magisk Patched Init_Boot.img

  1. Type in the below command in the CMD window to flash the patched init_boot.img to your device
    fastboot flash init_boot magisk_patched_boot.img
  2. Finally, execute the below command to boot your device to the rooted OS:
    fastboot reboot

NOTE: The above command should automatically flash the init_boot to both the slots. However, if you face any issues while executing that command, then you could also manually specify the slots while flashing. In other words, you could flash the init_boot to both partitions by executing the below two commands:

fastboot flash init_boot_a magisk_patched_boot.img 
fastboot flash init_boot_b magisk_patched_boot.img

That’s it. These were the steps to root your OnePlus running OxygenOS 13 Android 13 via Magisk patched init_boot. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.

Share:
  • luis pacheco

    to revert root and go back to stock rom what steps do you have to follow? on one plus 11

    • Sadique Hassan

      Take a backup and proceed ahead at your own risk:

      Remove all the modules [Magisk Modules, LSPosed, and everything else].
      Then launch Magisk and tap on Uninstall Magisk > Complete Uninstall.
      Your device will now restart and the root will be removed.

      OR

      Remove all the modules [Magisk Modules and LSPosed, and everything else].
      Extract the current firmware version stock init_boot via Fastboot Enhance
      Flash it to both the slots via:
      fastboot flash init_boot_a init_boot.img
      fastboot flash init_boot_b init_boot.img
      Then reboot to OS via below command and it will boot to non-root OS
      fastboot reboot