[OnePlus 12R / OnePlus Ace 3] amirhidd3n:
Hey! I was looking for rooting instruction for OnePlus 12R and I came across some very useful instructions and youtube videos. However, I found them a bit confusing and incomplete for a newbie like me. So, I decided to write a complete guide for rooting OnePlus 12R. All of the information provided here are borrowed from other sources which I will put their link at the end of this post.

First, to understand what's going on in the rooting process, we should know how does it really work. A thorough explanation can be found in this link:

How does Magisk work?

Magisk is known as a “systemless” root method. It’s essentially a way to modify the system without actually modifying it. Modifications are stored safely in the boot partition instead of modifying ...

android.stackexchange.com

Now let's jump to the main part, how to root:

First, you need to unlock the bootloader

Download android platform-tools from google

Platform-tools includes adb and fastboot which we will use in the rooting process

Enable developer options on your phone

Enable OEM unlocking from the developer options

Enable USB debugging from the developer options

Use adb to unlock the bootloader:

$adb devices: check if the device is recognized
$adb reboot bootloader: device goes to fastbood mode
$fastboot devices: device serial number should be seen
$fastboot flashing unlock: Unlocks the bootloader

(NOTE: unlocking the bootloader will erase all the data and restart the device, so backup if you have something on it!)

After unlocking the bootloader, we are ready to root the device

First, we need to download the latest firmware which our device is using --> About device --> Version number --> e.g. CPH2611_14.0.0.307(EX01)

NOTE: How to download the .zip file of the latest firmware? For OnePlus devices and OxygenOS, there is an open-source app named Oxygen Updater with which you can download the latest firmwares for OxygenOS --> You should enable the “Advanced Mode” in the app to be able to download the .zip file instead of directly installing the firmware on the device. Download the same firmware as the firmware installed on your device.

Extract the firmware .zip file to get the “payload.bin” file

From the payload.bin file we should extract the init_boot.img with one of the softwares: payload-dumper-go or FastbootEnhance

Pass this payload.bin file to payload-dumper-go to extract the init_boot.img file

Now we push this init_boot.img file to the phone with adb:

$adb push <path to init_boot.img file>/init_boot.img /sdcard/Download

NOTE: for Android 12 or lower version, use boot.img file; but, for Android 13 or higher version, use init_boot.img file.

Download Magisk form github on your device

Go into Magisk: install --> select a patch file --> <go to init_boot.img path> --> choose init_boot.img --> let’s go --> a patched image file will be generated

Copy this file into your computer:

$adb pull /sdcard/Download/<magisk patched file name>

Then flash the new patched init_boot image to the bootloader to replace the original boot image

$adb reboot bootloader
$fastboot flash init_boot <path the the magisk patched init_boot image>
$fastboot reboot (or simply press the power button when in fastboot mode)

NOTE: If we were dealing with the boot.img instead of init_boot.img, we'd have the option to use “fastboot boot <mpb.img>” instead of flashing for the first time to see if the patched file works fine. But, with init_boot.img file, we only have one option, to flash the patched boot to the init_boot section.

After the device boots up, you’re done! Check if the root access is gained via some Root Checker app.

Helpful Links:

https://www.getdroidtips.com/unlock-bootloader-root-oneplus-12r/#Steps-to-Root-OnePlus-12-and-12R

What is Google’s Project Treble and Vendor Interface, and how that leads to Generic System Image (GSI):

https://www.xda-developers.com/goog...ze-android-so-oems-can-update-devices-faster/

https://www.getdroidtips.com/unlock-bootloader-root-oneplus-12r/#Steps-to-Root-OnePlus-12-and-12R

https://xdaforums.com/t/root-oneplus-12r-using-a-dsu-gsi-and-adb.4657742/

A good video explaining the root process:

Another useful thorough explanation video for rooting: