[GUIDE]Android 11 how to root T-MOBILE OP8 5G

Search This thread

TheLogicalGamer

Senior Member
Nov 14, 2015
306
132
Knoxville
THIS GUIDE IS FOR THE T-MOBILE ONEPLUS 8 5G ONLY!!!!
This method has only been tested on the above mentioned device. It may be possible to use *parts* of this guide on other oneplus/android devices, but you do so at your own risk!

Furthermore no warranty or liability of any kind is offered or implied for any damages to any person(s), devices, or other property by following, or otherwise using any information contained in this guide be it inaccurate information or otherwise.
By using this guide you're agreeing to these terms.


MAKE SURE TO READ THROUGH THE ENTIRE GUIDE BEFORE ATTEMPTING TO FOLLOW IT!

That said I've done my best to ensure this guide is an accurate representaion of the steps I followed to do the things laid out in this guide.

Required items:
Bootloader unlock token from OnePlus.
adb fastboot drivers installed to path. (Not provided)

Now that all that is out of the way. Let's get started!
Rooting with provided boot.img

1. Make sure that you are running some version of Android 11 via Settings>About phone.

2. Take note of your Build Number you'll need that later.

3. Click on build number five times to enable developer options.

4. Navigate to developer options under Settings>System>Developer options.

Turn on oem unlocking, as well as usb debugging & turn off automatic updates.

5. Open a cmd prompt on your pc, or terminal on linux. Enter the following lines.

Code:
adb devices

*Check the always allow from this device checkbox then hit allow.
You should see your device listed. If it says unrecognized re-enter the line above.

Code:
adb reboot bootloader

*Your device should reboot into fastboot. Once it has proceed.

6. Now we must unlock the bootloader. cd to the directory where you have saved your unlock token.
For example if you saved it to the Desktop of a windows machine the directory would most likely be
users/*yourusernamehere*/Desktop.

7. Enter the following lines. One at a time.

Code:
fastboot flash cust-unlock unlock_code.bin

Code:
fastboot oem unlock

*Follow the prompts on your device to unlock your bootloader *****THIS WILL WIPE YOUR DEVICE SO MAKE SURE TO BACKUP YOUR DATA*****

8. Get past setup on your device re-enable developer options, and usb debugging, turn off automatic updates.

9. Follow the process to get back into fastboot via adb.

10. Remember your build number. Download the boot image that matches your build number here:
https://www.androidfilehost.com/?w=files&flid=322713
(I've only tested this on the device I pulled from, but unless something drastic has changed since the last time I dealt with stuff like this these should work fine as long as the device is a Tmobile OP8, and the build number is the same.)

(I will try to keep this updated as new updates are released, but work keeps me rather busy so it may not always be quickly.)

11. Now open a cmd prompt (if you haven't already) navigate to where you saved the boot img. Enter the following.

Code:
fastboot devices
*You see your device listed in that case proceed.

Code:
fastboot flash boot_a boot.img
*If the process completes without errors then continue

then

Code:
fastboot flash boot_b boot.img
*If the process completes without errors then continue

finally

Code:
fastboot reboot

12. Your device should boot up. Install the magisk manager app if it is not installed. Open MM & follow the prompts to finish setup. Enable magisk hide, and reboot. SafetyNet should pass.

Congrats! You have a Tmobile Oneplus 8 with root!


Using/Acquiring your own boot.img

This section of the guide will assume you are familiar with using adb/adb shell commands, as well as being familiar with android, and other terms.
To put it plainly it will be a lot less hand holdy lol. This process requires root. So technically you won't be required to pull you're own image.
However it should be noted that doing so will streamline the process for later in the event that you need to restore to stock, and re-root later on.

*****YOU MUST BEGIN ON ANDROID 10 TO USE THIS METHOD*****

If you are not downgrade via the msmtool, re-unlock your bootloader & make sure automatic updates are disabled in developer options.

Let's begin.

1. Connect your phone to your pc with usb debugging enabled & reboot into fastboot.

2. Copy a Magisk zip file to your internal storage.


3. Boot the latest twrp (DO NOT TRY TO BOOT OR INSTALL TWRP ON AN ANDROID 11 DEVICE TWRP DOES NOT CURRENTLY SUPPORT IT!!!!)

Code:
fastboot boot recovery "twrp.img"

*****replace twrp.img with the filename of your twrp minus the quotes.*****

4. Flash the magisk zip and reboot.

5. Download & install the latest update, but do not reboot.

6. Open magisk click install>Install to inactive slot(after ota).
*Before rebooting make a note of which slot magisk says it's installing to.
We will need this later to know which boot image slot to pull from.

7. Reboot through magisk.
*You should now be on the latest update with root.

8.Open a cmd prompt and enter the following

Code:
adb shell

then

Code:
su
*grant the su request on your device.

9. Now we must find the location of both boot paritiions. Enter the following

Code:
ls /dev/block/bootdevice/by-name/ -all

10. This will display a list of all partitions on the device there are 2 we must make a note of, and 1 that is optional but highly recommended.
These are boot_a, boot_b, and optionally persist.
Open a notepad, and copy and those lines into a txt document and save.
(You can optionally delete the part of the lines before boot_a, boot_b etc. To make it easier to read.)

11. Now whichever slot magisk flashed to is what we need to pull from open your previously saved txt document, and find the path to which slot it is
Ex: /dev/block/******

12. In the command propt enter the following.

Code:
dd if=/dev/block/***** of=/sdcard/boot.img

*****Replace the "*'s" with the rest of the path for the slot you need!*****

NOTE: If you wish to backup your persist partition then repeat step 12. Replacing the "if" path with that of the persist partition you made note of earlier, and the boot.img part of the "of" path with persist.img.

13. Copy those files from your internal storage to your pc using explorer or adb pull -p from the command prompt in the directory you would like them stored.

And that's it Congrats! You've learned how to pull your own boot.img from your device, and have root on android 11!

If you ever need to restore from stock you can just update back to android 11, and flash your boot images via fastboot.

Note: I would recommend storing your boot images in folders named as the Build Number to ensure you don't mix them up. YOU WILL NEED TO REPULL YOUR BOOT IMAGES AFTER EVERY UPDATE!


Updating in the future

To update to new Android versions & keep root follow these steps.

1. Make sure automatic updates in developer options are off.

2. Download and install the update, BUT DO NOT REBOOT.

3. Open magisk select install>Install to inactive slot(after ota).

4. Reboot through magisk.

5. You should reboot into the update with root preserved.

6. Pull the new patched boot image if you wish.

A few things to leave you with.
It's been a while since I've dabbled with this side of development (I've mostly been focusing on app development, and occasionally magisk rom development.)
So.
Some things, and processes in this guide may change as future updates occur.
I'll try to update it as neccesary, but my work usually keeps me pretty busy.
Don't be afraid to ask any questions or suggest any corrections to this guide.
I'll do my best help anyone with any problems or issues, but be sure to provide as much information as humanly possbile to help me or others assist with the problem.
 
Last edited:

rophiroth

Senior Member
Dec 11, 2010
435
20
1 is there a way to unlock and root without wipe? :C
2 What could be the advantage of changing from t-mobile version to global? is there a hardware diference or something to be afraid of?

Thank you
 

TheLogicalGamer

Senior Member
Nov 14, 2015
306
132
Knoxville
1 is there a way to unlock and root without wipe? :C
2 What could be the advantage of changing from t-mobile version to global? is there a hardware diference or something to be afraid of?

Thank you

1. No unlocking the bootloader will always perform a factory reset.

2. This guide isn't for that. It serves as a repository for T-Mobile variant patched boot, or explains how to get your own images to flash via fastboot to be able to root past Android 10. Since Twrp doesn't support Android 11 yet.

As for the perks of switching to global a few I can think of would be.
No T-mo bloat.

Updates from Oneplus containing all features.

I believe it enables the local upgrade option for downloading, and installing updates downloaded via The OP website. (Only global/non tmo updates are available on the site).

I'm sure there are probably a few other minor differences.

As far as I'm aware the process isn't as straight forward as it used to be with the 6t, 7 etc. So there is more of a potential for something to go wrong. Could be off putting for some I suppose. For more details I suggest looking at one of the conversion guides. :)
 

TheLogicalGamer

Senior Member
Nov 14, 2015
306
132
Knoxville
Why a factory reset should be needed in that part... :/

thank you

I'm not entirely sure as to why. It just part of the process (on every device with an unlockable bootloader).

Aside from potentially saving on troubleshooting down the line. Perhaps it's a liability issue. Since technically unlocking the bootloader does make your device less secure. The manufacturer can't be to blame for stolen/lost data since anything you would've put on the device would have been put there yourself. The warning message doesn't appear until after the bootloader is unlocked. So by wiping the device before hand/during the process it insures that you have seen the warning, and are choosing to put said data on the device of your own free will after having been warned.

So my best guess would be to protect themselves from potential lawsuits. Assuming that there is no technical reason for needing it. (Which I'm not entirely sure that there isn't).
 
  • Like
Reactions: rophiroth

rophiroth

Senior Member
Dec 11, 2010
435
20
Im in troubles. I do flash the cust-unlock, no errors but nothing really happens T,T im using android 11


Code:
PS C:\WINDOWS\system32> fastboot flash cust-unlock 'C:\Android\Oneplus 8\unlock_code.bin'
target reported max download size of 805306368 bytes
sending 'cust-unlock' (0 KB)...
OKAY [  0.008s]
writing 'cust-unlock'...
(bootloader) Device is unlocked.
OKAY [  0.014s]
finished. total time: 0.027s

When I try to flash anything else, it says:

PS C:\WINDOWS\system32> fastboot flash boot_a 'C:\Android\Oneplus 8\rooted boot tmobile.img'
target reported max download size of 805306368 bytes
sending 'boot_a' (98304 KB)...
OKAY [ 2.117s]
writing 'boot_a'...
FAILED (remote: Flashing is not allowed in Lock State)
finished. total time: 2.139s

I had to run an adittional command:

PS C:\WINDOWS\system32> fastboot flashing unlock
...
OKAY [ 0.035s]
finished. total time: 0.038s
 
Last edited:

TheLogicalGamer

Senior Member
Nov 14, 2015
306
132
Knoxville
Im in troubles. I do flash the cust-unlock, no errors but nothing really happens T,T im using android 11


Code:
PS C:\WINDOWS\system32> fastboot flash cust-unlock 'C:\Android\Oneplus 8\unlock_code.bin'
target reported max download size of 805306368 bytes
sending 'cust-unlock' (0 KB)...
OKAY [  0.008s]
writing 'cust-unlock'...
(bootloader) Device is unlocked.
OKAY [  0.014s]
finished. total time: 0.027s

When I try to flash anything else, it says:


Try running
Code:
fastboot getvar unlocked

And let me know what it says.

Also did you let the phone boot up all the way before attempting to flash the boot image?

Edit: Did you run the fastboot oem unlock command after flashing the unlock code?
 

TheLogicalGamer

Senior Member
Nov 14, 2015
306
132
Knoxville
Im in troubles. I do flash the cust-unlock, no errors but nothing really happens T,T im using android 11


Code:
PS C:\WINDOWS\system32> fastboot flash cust-unlock 'C:\Android\Oneplus 8\unlock_code.bin'
target reported max download size of 805306368 bytes
sending 'cust-unlock' (0 KB)...
OKAY [  0.008s]
writing 'cust-unlock'...
(bootloader) Device is unlocked.
OKAY [  0.014s]
finished. total time: 0.027s

When I try to flash anything else, it says:



I had to run an adittional command:


Yeah just looked at the guide, and it seems I forgot to include that step. Everything is fine. Your device is unlocked just not the bootloader. Before you can flash the boot image you'll need to run this:

Code:
fastboot oem unlock

Then confirm using the volume keys on your phone. Then you'll be able to flash the boot image. I've added that step to the guide. Sorry for the mistake.
 

rophiroth

Senior Member
Dec 11, 2010
435
20
Yeah just looked at the guide, and it seems I forgot to include that step. Everything is fine. Your device is unlocked just not the bootloader. Before you can flash the boot image you'll need to run this:

Code:
fastboot oem unlock

Then confirm using the volume keys on your phone. Then you'll be able to flash the boot image. I've added that step to the guide. Sorry for the mistake.
Yes, I unlock my phone, run magisk... and safety check mark everything wrong z,z Happen to anyonemore?
 

Attachments

  • Screenshot_20210224-143321[1].jpg
    Screenshot_20210224-143321[1].jpg
    156 KB · Views: 191

TheLogicalGamer

Senior Member
Nov 14, 2015
306
132
Knoxville
I'm sorry, I didn't see there wasn't enabled by default. That's works well.


Pd: some one experience heat after root? Maybe it's just te restoration of files and all..
Thank you

Sorry was doing some repairs on a phone. I haven't noticed any different. It could a get a bit hot during first boot from what I remember. Just keep an eye on it, see if it cools down. But rooting itself shouldn't cause that no.
 

TheLogicalGamer

Senior Member
Nov 14, 2015
306
132
Knoxville
If anyone needs to SIM UNLOCK & OEM UNLOCK the bootoader: goto Settings> WiFi&Network> SIM&Network> Network Unlock. If anyone can help on how to get the token unlock code, it would help some. For PUK and other unlocks https://www.t-mobile.com/support/devices/android/oneplus-8 and then scroll down to Security. There you have option to unlock several things.


You can only unlock the bootloader if you have the sim unlocked. Which usually happens when you paid off your device, but if you've been on the network for 40 days, and made a couple of payments you can usually get them to do it for you. Might have to annoy them a bit. As for the unlock token you have to submit an unlock request to oneplus, and they'll email it to you. However this must be done AFTER getting the sim unlocked. The sim & Bl unlocks are tied together. Can't do one without the other unless a work around is found.
 
  • Like
Reactions: ozzfrost

rophiroth

Senior Member
Dec 11, 2010
435
20
Updating in the future

To update to new Android versions & keep root follow these steps.

1. Make sure automatic updates in developer options are off.

2. Download and install the update, BUT DO NOT REBOOT.

3. Open magisk select install>Install to inactive slot(after ota).

4. Reboot through magisk.

5. You should reboot into the update with root preserved.

6. Pull the new patched boot image if you wish.

[/QUOTE]
How or where to download the update?

Thank you!
 

shadavis08

Senior Member
Oct 29, 2012
1,247
322
If anyone needs to SIM UNLOCK & OEM UNLOCK the bootoader: goto Settings> WiFi&Network> SIM&Network> Network Unlock. If anyone can help on how to get the token unlock code, it would help some. For PUK and other unlocks https://www.t-mobile.com/support/devices/android/oneplus-8 and then scroll down to Security. There you have option to unlock several things.
Detailed unlock instructions
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    THIS GUIDE IS FOR THE T-MOBILE ONEPLUS 8 5G ONLY!!!!
    This method has only been tested on the above mentioned device. It may be possible to use *parts* of this guide on other oneplus/android devices, but you do so at your own risk!

    Furthermore no warranty or liability of any kind is offered or implied for any damages to any person(s), devices, or other property by following, or otherwise using any information contained in this guide be it inaccurate information or otherwise.
    By using this guide you're agreeing to these terms.


    MAKE SURE TO READ THROUGH THE ENTIRE GUIDE BEFORE ATTEMPTING TO FOLLOW IT!

    That said I've done my best to ensure this guide is an accurate representaion of the steps I followed to do the things laid out in this guide.

    Required items:
    Bootloader unlock token from OnePlus.
    adb fastboot drivers installed to path. (Not provided)

    Now that all that is out of the way. Let's get started!
    Rooting with provided boot.img

    1. Make sure that you are running some version of Android 11 via Settings>About phone.

    2. Take note of your Build Number you'll need that later.

    3. Click on build number five times to enable developer options.

    4. Navigate to developer options under Settings>System>Developer options.

    Turn on oem unlocking, as well as usb debugging & turn off automatic updates.

    5. Open a cmd prompt on your pc, or terminal on linux. Enter the following lines.

    Code:
    adb devices

    *Check the always allow from this device checkbox then hit allow.
    You should see your device listed. If it says unrecognized re-enter the line above.

    Code:
    adb reboot bootloader

    *Your device should reboot into fastboot. Once it has proceed.

    6. Now we must unlock the bootloader. cd to the directory where you have saved your unlock token.
    For example if you saved it to the Desktop of a windows machine the directory would most likely be
    users/*yourusernamehere*/Desktop.

    7. Enter the following lines. One at a time.

    Code:
    fastboot flash cust-unlock unlock_code.bin

    Code:
    fastboot oem unlock

    *Follow the prompts on your device to unlock your bootloader *****THIS WILL WIPE YOUR DEVICE SO MAKE SURE TO BACKUP YOUR DATA*****

    8. Get past setup on your device re-enable developer options, and usb debugging, turn off automatic updates.

    9. Follow the process to get back into fastboot via adb.

    10. Remember your build number. Download the boot image that matches your build number here:
    https://www.androidfilehost.com/?w=files&flid=322713
    (I've only tested this on the device I pulled from, but unless something drastic has changed since the last time I dealt with stuff like this these should work fine as long as the device is a Tmobile OP8, and the build number is the same.)

    (I will try to keep this updated as new updates are released, but work keeps me rather busy so it may not always be quickly.)

    11. Now open a cmd prompt (if you haven't already) navigate to where you saved the boot img. Enter the following.

    Code:
    fastboot devices
    *You see your device listed in that case proceed.

    Code:
    fastboot flash boot_a boot.img
    *If the process completes without errors then continue

    then

    Code:
    fastboot flash boot_b boot.img
    *If the process completes without errors then continue

    finally

    Code:
    fastboot reboot

    12. Your device should boot up. Install the magisk manager app if it is not installed. Open MM & follow the prompts to finish setup. Enable magisk hide, and reboot. SafetyNet should pass.

    Congrats! You have a Tmobile Oneplus 8 with root!


    Using/Acquiring your own boot.img

    This section of the guide will assume you are familiar with using adb/adb shell commands, as well as being familiar with android, and other terms.
    To put it plainly it will be a lot less hand holdy lol. This process requires root. So technically you won't be required to pull you're own image.
    However it should be noted that doing so will streamline the process for later in the event that you need to restore to stock, and re-root later on.

    *****YOU MUST BEGIN ON ANDROID 10 TO USE THIS METHOD*****

    If you are not downgrade via the msmtool, re-unlock your bootloader & make sure automatic updates are disabled in developer options.

    Let's begin.

    1. Connect your phone to your pc with usb debugging enabled & reboot into fastboot.

    2. Copy a Magisk zip file to your internal storage.


    3. Boot the latest twrp (DO NOT TRY TO BOOT OR INSTALL TWRP ON AN ANDROID 11 DEVICE TWRP DOES NOT CURRENTLY SUPPORT IT!!!!)

    Code:
    fastboot boot recovery "twrp.img"
    
    *****replace twrp.img with the filename of your twrp minus the quotes.*****

    4. Flash the magisk zip and reboot.

    5. Download & install the latest update, but do not reboot.

    6. Open magisk click install>Install to inactive slot(after ota).
    *Before rebooting make a note of which slot magisk says it's installing to.
    We will need this later to know which boot image slot to pull from.

    7. Reboot through magisk.
    *You should now be on the latest update with root.

    8.Open a cmd prompt and enter the following

    Code:
    adb shell

    then

    Code:
    su
    *grant the su request on your device.

    9. Now we must find the location of both boot paritiions. Enter the following

    Code:
    ls /dev/block/bootdevice/by-name/ -all

    10. This will display a list of all partitions on the device there are 2 we must make a note of, and 1 that is optional but highly recommended.
    These are boot_a, boot_b, and optionally persist.
    Open a notepad, and copy and those lines into a txt document and save.
    (You can optionally delete the part of the lines before boot_a, boot_b etc. To make it easier to read.)

    11. Now whichever slot magisk flashed to is what we need to pull from open your previously saved txt document, and find the path to which slot it is
    Ex: /dev/block/******

    12. In the command propt enter the following.

    Code:
    dd if=/dev/block/***** of=/sdcard/boot.img
    
    *****Replace the "*'s" with the rest of the path for the slot you need!*****

    NOTE: If you wish to backup your persist partition then repeat step 12. Replacing the "if" path with that of the persist partition you made note of earlier, and the boot.img part of the "of" path with persist.img.

    13. Copy those files from your internal storage to your pc using explorer or adb pull -p from the command prompt in the directory you would like them stored.

    And that's it Congrats! You've learned how to pull your own boot.img from your device, and have root on android 11!

    If you ever need to restore from stock you can just update back to android 11, and flash your boot images via fastboot.

    Note: I would recommend storing your boot images in folders named as the Build Number to ensure you don't mix them up. YOU WILL NEED TO REPULL YOUR BOOT IMAGES AFTER EVERY UPDATE!


    Updating in the future

    To update to new Android versions & keep root follow these steps.

    1. Make sure automatic updates in developer options are off.

    2. Download and install the update, BUT DO NOT REBOOT.

    3. Open magisk select install>Install to inactive slot(after ota).

    4. Reboot through magisk.

    5. You should reboot into the update with root preserved.

    6. Pull the new patched boot image if you wish.

    A few things to leave you with.
    It's been a while since I've dabbled with this side of development (I've mostly been focusing on app development, and occasionally magisk rom development.)
    So.
    Some things, and processes in this guide may change as future updates occur.
    I'll try to update it as neccesary, but my work usually keeps me pretty busy.
    Don't be afraid to ask any questions or suggest any corrections to this guide.
    I'll do my best help anyone with any problems or issues, but be sure to provide as much information as humanly possbile to help me or others assist with the problem.
    2
    1 is there a way to unlock and root without wipe? :C
    2 What could be the advantage of changing from t-mobile version to global? is there a hardware diference or something to be afraid of?

    Thank you

    1. No unlocking the bootloader will always perform a factory reset.

    2. This guide isn't for that. It serves as a repository for T-Mobile variant patched boot, or explains how to get your own images to flash via fastboot to be able to root past Android 10. Since Twrp doesn't support Android 11 yet.

    As for the perks of switching to global a few I can think of would be.
    No T-mo bloat.

    Updates from Oneplus containing all features.

    I believe it enables the local upgrade option for downloading, and installing updates downloaded via The OP website. (Only global/non tmo updates are available on the site).

    I'm sure there are probably a few other minor differences.

    As far as I'm aware the process isn't as straight forward as it used to be with the 6t, 7 etc. So there is more of a potential for something to go wrong. Could be off putting for some I suppose. For more details I suggest looking at one of the conversion guides. :)
    2
    How long did it take to get your token from OnePlus?
    1 week to the minute
    1
    i have already my bootloader unlocked. Can i still use MSM tool
    Yes, but you'll have to re-unlock it.