How To Guide Root OnePlus 9

Search This thread

shadabkiani

Senior Member
Mar 2, 2018
605
249
Pakistan
HTC 10
OnePlus 9
i'm referring to the poser. however, if you're on a lineage recovery but running stock OOS F21, i suggest you might post here how to install a lineage recovery and/with a stock OOS.
i use TWRP on a stock OOS A13
In OnePlus 9 (and most other modern phones), there is no dedicated recovery partition. It now resides inside boot sharing the same kernel. Hence there isn't any way to have Lineage recovery on a stock OOS since OOS boot.img contains it's own stock recovery. When you have TWRP, it patches boot.img. The same method isn't available for Lineage recovery, well, why would it be anyway..... If you have Lineage ROM, then it's there... Otherwise no one wants it specifically....
 

gullzway

Senior Member
Nov 17, 2007
430
84
Had to contact OnePlus support. It's been a month since I applied for an unlock code. They asked for all the same info I already supplied, and finally sent the .bin after another week.

Unlocked bootloader, patched boot img, and installed Magisk successfully!

On Android 12, was keeping my phone off because it was saying it was going to update to Android 13 in a day.

Does having an unlocked bootloader with Magisk installed still block OTA updates?
 

shadabkiani

Senior Member
Mar 2, 2018
605
249
Pakistan
HTC 10
OnePlus 9
Had to contact OnePlus support. It's been a month since I applied for an unlock code. They asked for all the same info I already supplied, and finally sent the .bin after another week.

Unlocked bootloader, patched boot img, and installed Magisk successfully!

On Android 12, was keeping my phone off because it was saying it was going to update to Android 13 in a day.

Does having an unlocked bootloader with Magisk installed still block OTA updates?
Yes, as long as there is root, OTA will fail.

You can also disable Automatic System Updates from Developer Options.
 
  • Like
Reactions: gullzway

brianyz

Senior Member
Dec 16, 2015
55
17
I just got a new OP9 LE2115. It came with Android 11. I did all the updates until it was updated to Android 13.1 with April 5th 2023 security patch. I installed Oxygen Updater just to verify it was running the latest version, which Oxygen Updater said it was. I went ahead and downloaded the latest Oxygen OS via Oxygen Updater app so I would have it. I then used the phone for a couple of days just to make sure everything was working as expected before I started to tweak it.
I went ahead and unlocked the bootloader and setup the phone again and updated once again to the latest Oxygen OS (according to Oxygen OS and the Oxygen OS Updater file 850a635bc58de149dc4183ca0c33c6e3c54c007f.zip)

I used payload dumper to get the boot.img from the above zip file, installed Magisk apk, patched the boot.img. Booted to fastboot and did
sudo fastboot getvar current-slot which was B
sudo fastboot flash boot magisk_patched-26100_KXTlK.img, then start
Phone booted to 1st OnePlus logo screen with the orange state warning, but wouldn't boot. I held the volume buttons and power to shutdown the phone.
then tried to flash the stock boot image back
sudo fastboot flash boot boot.img Still wouldn't boot. Did some reading and did
sudo fastboot --set-active=other Restarted, and the got a qualcomm crash dump error screen, then did
sudo fastboot --set-active=a Still won't boot. Now it just boots to fastboot mode all the time.
Thinking I must have flashed the wrong boot.img version I downloaded OnePlus 9 13.1.0.500(EX01) Firmware flasher.zip, and flashed the stock boot.img, but the phone still just boots to fastboot mode, can't enter recovery.
I'm thinking at this point I need to use MSM tool to restore the phone.
I was going to try this https://xdaforums.com/t/restore-oneplus-9-to-stock-via-fastboot-commands.4265153/ but others have said it made the situation worse.
What is the best way to proceed to restore the phone (before I make it worse)?
I'm also assuming the LE2115 is considered the Global model. Is that correct?
I mainly use Linux, but have access to a Windows machine.
 

shadabkiani

Senior Member
Mar 2, 2018
605
249
Pakistan
HTC 10
OnePlus 9
@brianyz First of all, don't panic because you have LE2115 which is Global / NA variant, so you can always unbrick it through MSM Tool (method here).

Now, what I understand is that you certainly have flashed the wrong boot.img. Judging from your post, I assume you are a power user and already have the basic know-how of Android OS.

There are 2 types of OTA updates for OnePlus 9; full and incremental. For the Global variant, they don't release full zip quite often. The last full OTA was F.17 firmware. The most recent update which is 13.1.500(EX01) is the incremental. You can choose whether to download full or incremental from Oxygen Updater app's Settings. Now, the problem is that you can only extract boot.img from full zip; not incremental. You might be wondering then how the hell we get boot.img from incremental updates? Well, you extract it directly from your phone with the help of MSM Tool's Read Back option (method here).

As a general rule for OnePlus 9, always remember to temporarily boot a given boot.img (especially when it's a Magisk patched boot.img) rather than flashing it directly. If you wanna root, you first patch the boot.img then temporarily boot by the command fastboot boot <your_patched_boot.img> and then if the system boots up successfully, you go to Magisk app and Install and Direct Install. That way, Magisk will root directly and take the backup of original unmodified boot.img in case if you wanna restore it later (especially when there is a System Update because it doesn't proceed with rooted/patched boot.img). On the other hand, by flashing directly by command fasboot flash boot <your_patched_boot.img>, Magisk will NOT backup original boot.img, as well as, in case of a probelm as in your current case, things will take ugly turn.

As I understand from your post, you are currently on the latest firmware 13.1.500(EX01), but you patched and then flashed the wrong boot.img. I have attached the stock boot.img. Extract the zip file, and try to temporarily boot it. If it boots up, it's the right one, and then you can flash it. If you wanna root, patch this, then temporarily boot it, open Magisk, choose Install and choose Direct Install.

Side Tip: Since you are new, I think this info will help you too. There is no separate partition for recovery anymore. It resides in boot partition now. If you wanna use TWRP (although it is not needed anymore to flash custom ROMs for OnePlus 9), you also temporarily boot it. If you flash it, you will brick, and you will have to restore whatever boot.img you were on.
 

Attachments

  • LE2115_13.1.0.500(EX01) boot.img.zip
    39.7 MB · Views: 44
Last edited:

MattsSoScene

Member
Mar 5, 2011
12
7
The summary of the process is this. Your build number says that you are currently on F.21 firmware. In order to obtain root, you need "boot.img" from F.21 firmware so that you can patch this boot.img from Magisk app, then temporarily boot this newly "patched_boot.img" and then root permanently from Magisk app's Direct Install option.

Follow these steps. You need PC for the process. I assume you already have proper drivers for OnePlus installed on your PC.

First you need to obtain boot.img for F.21 firmware (or whatever firmware you are currently on). You can either ask someone to share the boot.img for F.21; or (even better) you can extract it yourself from your phone using MSM Tool. To extract it yourself, download MSM Tool from this link (choose the Global version since your firmware is Global). Meanwhile it's downloading, go to your phone, reboot to fastboot mode, check your current active slot by this command fastboot getvar current-slot and note/remember the output from the command (whether _a or _b). Turn off your phone and DO NOT connect to PC yet. Now once MSM is downloaded, run MSM Tool exe. Press F8 and select either boot_a or boot_b depending on your current slot as checked from fastboot before. In the password section, enter oneplus then go ahead and click Readback. It will say waiting for device. Now come back to your turned off phone, hold both vol- and vol+ buttons and connect phone to PC. The PC will recignize the device but phone screen will still be black. MSM tool will read the phone and extract the selected boot.img to C: drive, and phone will reboot.

Now copy that extracted boot.img from C: to your phone. Install Magisk app. Patch that boot.img. The app will create magisk_patched_boot.img in your phone's Download folder. Copy that newly patched boot.img to your PC. Reboot your phone to fastboot mode, and run this command to temporarily boot the patched boot.img:
fastboot boot <your_patched_boot.img>
Once you phone boots up, go to Magisk app, choose Install and select Direct Install. This will permanently root your current firmware.

Note: When there is a new OTA update, the system will show it's available but it will fail to install because of root. So when there is a new OTA, go to Magisk app, uninstall and restore images. Then proceed with OTA, and after successfull update, extract boot.img again and get root following the above steps.
Are there any beginners guides for this? I want to try rooting but I have never done this before. I have an old OnePlus 9 that I don't use for anything, so there are no issues if I mess up. I have tried youtube, but none of those videos are very helpful, and the guides here seem to assume knowledge I don' have.
 

shadabkiani

Senior Member
Mar 2, 2018
605
249
Pakistan
HTC 10
OnePlus 9
Are there any beginners guides for this? I want to try rooting but I have never done this before. I have an old OnePlus 9 that I don't use for anything, so there are no issues if I mess up. I have tried youtube, but none of those videos are very helpful, and the guides here seem to assume knowledge I don' have.
Well you do need to have some basic knowledge about using a computer, installing drivers, running application, fastboot/adb commands from Command Prompt, etc. How much of it are you familiar with?

If you don't know much about this already, then rooting will do you no good whatsoever.
 

MattsSoScene

Member
Mar 5, 2011
12
7
Well you do need to have some basic knowledge about using a computer, installing drivers, running application, fastboot/adb commands from Command Prompt, etc. How much of it are you familiar with?

If you don't know much about this already, then rooting will do you no good whatsoever.
fastboot/adb commands is the only part of that im unfamiliar with. I tried following guides, but im hitting roadblocks with getting magisk fully installed.
 

MattsSoScene

Member
Mar 5, 2011
12
7
Okay, So I gave this a go and now my phone just keep cycling to the fastboot menu. Does anyone have any advice or guidance?
 

brianyz

Senior Member
Dec 16, 2015
55
17
@brianyz First of all, don't panic because you have LE2115 which is Global / NA variant, so you can always unbrick it through MSM Tool (method here).....
Thanks. I had a couple small issues that led to a bigger problem. I had flashed the wrong boot.img from an older firmware. Once I realized that, I tried flashing 13.1.0.500(EX01) from CRDroid Sourceforge page on my Linux system, but it was failing to properly flash it (no error message though). So after reading your suggestions I flashed from a Windows system and success. It's usually the other way around for me (Windows drivers, etc...)
I was also missing the "fastboot boot" and "fastboot flash boot" part. I was unaware you could boot an image without flashing it first. Good to know now.
 

shadabkiani

Senior Member
Mar 2, 2018
605
249
Pakistan
HTC 10
OnePlus 9
Thanks. I had a couple small issues that led to a bigger problem. I had flashed the wrong boot.img from an older firmware. Once I realized that, I tried flashing 13.1.0.500(EX01) from CRDroid Sourceforge page on my Linux system, but it was failing to properly flash it (no error message though). So after reading your suggestions I flashed from a Windows system and success. It's usually the other way around for me (Windows drivers, etc...)
I was also missing the "fastboot boot" and "fastboot flash boot" part. I was unaware you could boot an image without flashing it first. Good to know now.
Now every boot.img/recovery.img is bootable by fastboot boot command. Some require you to flash them (as was the case with my HTC 10). But for OnePlus 9, we have this luxury thanks to developers.
 

shadabkiani

Senior Member
Mar 2, 2018
605
249
Pakistan
HTC 10
OnePlus 9
Never a phone. I rooted a couple of tablets years ago, but that was using kingroot, which I understand isn't desirable now.
Then I suggest you are better off without root. If you root, your phone will fail Google's SafetyNet Attestation, and therefore, you won't be able to install certain apps, like Netflix and most of banking and financial apps. Of course, there are ways to get around that too, but that would be another story...
 

MattsSoScene

Member
Mar 5, 2011
12
7
Then I suggest you are better off without root. If you root, your phone will fail Google's SafetyNet Attestation, and therefore, you won't be able to install certain apps, like Netflix and most of banking and financial apps. Of course, there are ways to get around that too, but that would be another story...
I appreciate the advice. I was actually able to get it figured out last night. Got the phone completely rooted, removed the bloatware, and installed a new launcher.
 

gullzway

Senior Member
Nov 17, 2007
430
84
Yes, as long as there is root, OTA will fail.

You can also disable Automatic System Updates from Developer Options.
Thanks.
How do I disable the notification from Google Play Services that an OTA Android 13 update will be automatically installed by May 15, 2023?

Edit: Went to settings/apps and selected Google Play Services, unchecked notifications. I'll see if this works.

Edit 2: now I'm getting notifications from system update. I don't see a way to turn that off?
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    This is for Europe (11.2.2.2.LE25DA). If you are on Global, EU version works, but up to you. It appears for last year, unless you are from India, OnePlus doesn't care. It might be a while before a Full OTA update for Global is released, you'll notice updates come without it for Global or on their Global support site, the firmware is outdated.
    - On T-Mobile have full 5G. I don't know about AT&T and Verizon. Should be same.

    If you are on Global and you just received your phone. Do all the updates from the incremental through device. If you want root, you can flash with the EU patched boot.img and everything will work as normal
    **** but once you do this, you will need to wait for Global full OTA to update next time, unless you managed to have a backup copy of the unpatched boot.img

    Do the usual to unlock your OnePlus 9: oem unlock, usb debugging from developer. Boot into bootloader and use adb command /fastboot flashing unlock

    This will wipe your phone and reboot. Setup your phone

    Install Magisk from his official github: https://github.com/topjohnwu/Magisk/releases/tag/v22.0
    - Topjohn provides full instructions on how to do this yourself as well.

    Reboot into bootloader

    Flash boot the magisk modified boot.img. /fastboost flash boot boot.img

    Go into Magisk app and install via direct install and all done.

    Return to stock
    - Restore boot.img from Magisk
    - Uninstall Magisk
    - Flash the stock boot.img
    - Relock the bootloader, will wipe and return to factory reset.

    Stock 11.2.33 Boot.img
    Magisk Patched 11.2.33 boot.img

    Patched Boot.img for Europe (11.2.2.2.LE25DA)
    Stock Boot.img for Europe (11.2.2.2.LE25DA)

    Future Full OTA Updates
    - Update as usual
    - Go into Magisk and choose direct install and then install to inactive slot after OTA
    - This will retain root

    How to do it yourself:

    Download full OTA, usually Oxygen Updater App, XDA has links or from https://www.oneplus.com/support/softwareupgrade

    Download Payload Dumper

    Extract and place payload.bin in input folder
    output.jpg


    Run the payload_dumper.exe

    In the output folder will be boot.img, move that onto your phone, folder of your choice

    Go to Magisk app, click install
    Choose Select and Patch a File
    Choose the file and it will patch it, Magisk will say where the file is located.
    That is your patched boot.img file. Use that to flash / root your phone.

    Remember only have do this once, you don't have to do this again with subsequent updates.
    4
    11.2.4.4LE25AA is out!

    Here's what I did to get the partial OTA
    --always back up your critical data--
    0. Download Magisk-patched boot.img and SDK tools
    1. Uninstall Magisk (restore backup)
    2. Reboot
    3. Settings>System>Check for update> Download and install>Reboot
    4. Verify installation (Settings >About phone)
    5. Reboot to bootloader
    6. Hookup phone to desktop, navigate to the directory with patched boot.img
    7. "Fastboot devices" to ensure connection
    8. "Fastboot boot boot11244magisk.img"
    9. Once the OP9 started rebooting, I pulled out the USB and let it finish booting up
    10. Launch Magisk, tap Install, and then select Direct Installation. Reboot!

    Here's the Magisk-patched 11244AA boot.img:
    4
    I uploaded 11.2.6.6DA images here
    3
    This method worked for me, though I'm now running the same issue as Slikkster2k, since I don't have an unpatched boot.img, I can't uninstall magisk to update via OTA.

    I would suggest, for those wanting to be able to update in the future (until we get a custom recovery), that instead of /fastboot flash boot boot.img, use /fastboot boot boot.img and then let Magisk finish the install. When Magisk patches the boot image, it will take a backup of the stock one to be used for uninstallation.
    3
    I'm on 11.2.7.7.LE25BA Europe version and I just made an img for use with this guide if you want to save yourselves the trouble of making one: