How To Guide How to root any N20

Search This thread

PsYk0n4uT

Senior Member
**Edit: Be sure to read comments at the end of this post******

I've already posted this a few times but I figured I would try to save some people time who want/need to root from any security patch. This is a copy and paste from an answer I gave in another thread but it's a basic how to.
Install DSU sideloader app from playstore to boot a prerooted GSI then use Partitions Backup and Restore app from playstore to save copies on your device. Install magisk app and patch the extracted boot.img and then transfer backups along with the patched boot image to your PC for safekeeping and flash the patched boot.img in fastboot. You can rename any .bin files to .img to flash them if they get extracted as a .bin file. Check your settings in the partitions Backup and Restore app before starting the backup process. You can choose to save them in an easy to find directory and for me it was better to choose to save them RAW/uncompressed then just compress them all into a single archive rather than having a hundred separate archives for each individual partition because it makes it easier if you have to reflash things if you need to recover. You may want to disable battery optimization for the app because it takes a while to extract all the images doing a full backup but its well worth the wait time if it saves you from a brick later on.

I wish I had time to elaborate but hopefully someone else can take the time to elaborate and add to this for anyone needing step by step. I'm surprised nobody has done this already.

Credits to AndyYan for giving advice on the root method. I stole this from him and just made a post with a title that makes it easier to find since so many are still asking how to go about rooting their devices.


*****REQUEST TO COMMUNITY********
There are many who are already on August Security patch and i dont have time to update and post the newest images. So if you are on august patch and pull backups I ask that someone please be so kind as to upload a copy of your backup to Google Drive or a filehosting server of choice and post a new thread so that others can unbrick their devices.
*Please ***DO NOT include**** the following partitions*:
DEVINFO
DINFO
FRP
KEYMASTER_A
KEYMASTER_B
KEYSTORE
LOGDUMP
***MDM1M9KEFS1
***MDM1M9KEFS2
***MDM1M9KEFS3
***MDM1M9KEFS4
MODEMDUMP
OPLUS_SEC_A
OPLUS_SEC_B
RAWDUMP
SECDATA
STORSEC
USERDATA
VM-KEYSTORE

*** These partitions may/contain YOUR personal device info, DO NOT make these public***

You can make a new Google account for the sole purpose of uploading these for the community so as not to fill your own GDrive. Be sure to change permissions for the images to share with anyone who has the link. This would be very much appreciated by many.

*****Update 09/18/2022*****
Thanks to ctschrodinger88 & dmtec for posting more detailed instructions!!! you can find ctschrodinger88's instructions below, scroll down to the 5th post.
dmtec also posted instructions in another thread linked here: https://forum.xda-developers.com/t/august-boot-img.4491831/post-87426877

we are still in need of august modems if anyone cares to upload them to their drive and link them or any other filehosting service.
 
Last edited:
I used the info provided and referenced here as a guide and some external pieces and have things working.
I'll caveat the following, I don't remember the current firmware version I started with, but I'll try to remember to update.
I have the Nord N20 5g, but not the T-mo branded one, though in looking at this, the concepts should be the same.

Base assumptions:
- If you haven't done these beforehand, stop and take care of it. Research if you need, but please DO NOT just keep going or copy, paste, and run, without understanding to some extent what you're doing. If you just run commands it can be much harder to fix later.
a. Your phones bootloader is unlocked. (If you haven't already done it, when you do, your data will be gone, so if you care, back it up NOW)

b. You have access to an Android terminal of some sort (adb or on-device terminal) and you know how to use it. Unless you absolutely can't use a computer for some reason, I would use adb, it makes data backup easier (IMO).

c. You have somewhere to store your backed up partitions (THIS IS IMPORTANT)


Step 0: Download a pre-rooted Generic System Image (GSI) to use. Put it in a good working directory. This page links to several. https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-(GSI)-list
I used the LineageOS image by @AndyYan
If you are wondering about the various file endings this is the basic version
Code:
<ARCH>_xyZ

<ARCH> can either be arm, a64 (arm32_binder64) or arm64
x can either be a or b
y can either be v, o, g or f
Z can be N or S

b = a/b
a = a-only

g = gapps
o = gapps-go
v = vanilla (no gapps included)
f = floss (free & open source apps instead gapps)

N = no superuser
S = superuser included
From: https://forum.xda-developers.com/t/teclast-t30-t1px-suitable-gsi-roms.4211427/

Step 1: Enable the Dynamic System Update (DSU) feature flag, you can follow the exact steps for this in this section https://developer.android.com/topic/dsu#feature-flag
If you are unsure, just run the `adb shell` command.

Step 2:
If the image you downloaded needs to be in ".gz" format. Some of the tools will handle alternate types, but that's because it rebundles it at ".gz", you can save some effort doing it yourself.
Code:
gzip -c [IMG_NAME]..img> [IMG_NAME].gz

Step 3: Push the image to the device
`adb push [IMG_NAME].gz /storage/emulated/0/`

This is where I switched from ADB to on-the-device.
Step 4: Download the DSU Sideloader: https://github.com/VegaBobo/DSU-Sideloader
You can do this with adb but I wasn't able to get it to run, so I went with the DSU Sideloader app above which made it much simpler.

Step 5: Run DSU Sideloader. You can follow the instruction there in the README. You will need to run a command that the app provides, either via adb or an emulator. Then you will reboot via the notification.

Step 6: [Once you reboot] Enable Developer tools in phone settings.

Step 7: BACKUP, BACKUP, BACKUP (Please do this now. It will help make life much, much better if you ever have an issue and need to reset.)
This was my process:
Bash:
adb shell
su
mkdir /sdcard/partitions
cd /dev/block/by-name/
for x in *; do  dd if=/dev/block/by-name/$x of=/sdcard/partitions/$x ; done
# Note the collective size will be greater than the default space on the GSI boot, so you will want to separate things


# Back on local machine
mkdir [working_dir]
cd [working_dir]
adb pull /sdcard/partitions
# Your files from the adb command should populate the folder
mv [working_dir]/partitions/* [working_dir]/


# On device
rm /sdcard/partitions/*
# repeat the commands above as often as needed.

I don't know for sure all the files you will want to backup, but I pulled everything just to be safe. Keep them safe, because it is your safety net if you fall.

Step 8: Get boot_a or boot_b back on the device along with Magisk.apk (Please only download from here: https://github.com/topjohnwu/Magisk/releases)

Step 9: Install Magisk.apk (you can do this via
Code:
adb install ./magisk.apk
)

Step 10: Launch Magisk and install it to the book image stored on your sdcard.

Step 11: Pull the patched image to your local machine.
Code:
adb pull /sdcard/Download/magisk_patched-[stuff].img

Step 12: Boot phone to fastboot
Code:
adb reboot bootloader

Step 13: This is where there is an ideal and a real.
Ideal command
Code:
fastboot boot magisk_patched.img
where fastboot transfers the files and things just work, and if you reboot the system the regular boot.img is used. I haven't been able to get that to with this device.
I instead just ran
Code:
fastboot flash boot magisk_patched.img
which replaced the existing boot image, which is good, if it works, but if it doesn't, this is why you have backups!!!! Reboot the phone.

Step 14: When you boot, finish installing Magisk and you'll be ready to go.

If I remember other steps I'll add, or if you have questions I will try to help answer.
 

ScarletWizard

Senior Member
Aug 31, 2022
176
26
OnePlus Nord N20 5G
i ccant unlock bootloader
unlock token - OnePlus (United States) - Google Chrome 9_24_2022 11_11_20 AM.png
 

PsYk0n4uT

Senior Member
No. My serial is 7 digits
seems to be a common defect.... if ur device is paid off oneplus can generate you a token but it takes weeks of back-and-forth with support to get it escalated...tmobile may or may not allow you to do that on a device that isnt paid off but i wouldnt even ask tmobile about it if your not paid off already, will only make it harder for those who are trying to unlock theirs if it IS the case that tmobile doesnt want you to unlock it until youve paid the device off in full....oneplus will probably uphold tmobiles decision if your device isnt paid off. for now, we are able to unlock tmobile devices through the portal regardless of the financial status of the device. though you will still be SIM locked unless tmobile unlocks that for you. and their definitely NOT gonna do THAT til it gets paid off.
U.S. carriers dont like customers having unlocked devices and is against most user-agreement policies and can get your service terminated leaving you owing for a device you cant use and for the price of the contract you were on for service
 
Last edited:

ScarletWizard

Senior Member
Aug 31, 2022
176
26
OnePlus Nord N20 5G
seems to be a common defect.... if ur device is paid off oneplus can generate you a token but it takes weeks of back-and-forth with support to get it escalated...tmobile may or may not allow you to do that on a device that isnt paid off but i wouldnt even ask tmobile about it if your not paid off already, will only make it harder for those who are trying to unlock theirs if it IS the case that tmobile doesnt want you to unlock it until youve paid the device off in full....oneplus will probably uphold tmobiles decision if your device isnt paid off. for now, we are able to unlock tmobile devices through the portal regardless of the financial status of the device. though you will still be SIM locked unless tmobile unlocks that for you. and their definitely NOT gonna do THAT til it gets paid off.
U.S. carriers dont like customers having unlocked devices and is against most user-agreement policies and can get your service terminated leaving you owing for a device you cant use and for the price of the contract you were on for service
i screwed up big time. my device won't turn on at all. i was flashing what i think was a global firmware (Unlocked (CPH2459_11_A.06) and now my device wont turn on. i was using rom2box. please point me to the right forum that can help me.
 

PsYk0n4uT

Senior Member
Andy Yan's Lineage18 or 19..
pixel experience, crdroid... havent gotten kaleidoscope to work yet. Have heard that someone got aosp a13 going.... There are so many and so long as u use a matching security patch ur good. might work with a newer patch but of the ones ive tried i got thw matching patches to work. If you find one thats on a newer patch in the gsi page you should be able to follow the link and find an older release to match the patch ur on. If ur on may patch try to find a may patch just to make it pess likepy that there will be priblems. If on july or august, likewise find july or august sec patch release. newer patched systems MIGHT work with ur older patched bootloader and other partitions(modems etc...) but def would not advise just straight flashing mismatching security patches... Best to sideload first and see if u can get it working first. Its not very simple to dual boot these devices but i think someone did some work and posted a work around for doing that on a/b devices somewhere on xda......
 

oromis995

Member
Oct 28, 2022
6
1
Am willing to share my stock image with anyone willing to help. I am on the September security update on a OnePlus Nord N20 5G unlocked (Non-Carrier). I am running version 11 and android security update 2022-09-05.

I am having real issues getting LineageOS through DSU. It fails immediately on start every time. Bootloader is unlocked, it even shows through fastboot (Secure boot = on though), flag is set per instructions, and I am trying to install lineage-19.1-20221011-UNOFFICIAL-arm64_bvS.gz . I tried two different versions of the DSU app but nada.
 
  • Like
Reactions: D.Tarrant

PsYk0n4uT

Senior Member
Am willing to share my stock image with anyone willing to help. I am on the September security update on a OnePlus Nord N20 5G unlocked (Non-Carrier). I am running version 11 and android security update 2022-09-05.

I am having real issues getting LineageOS through DSU. It fails immediately on start every time. Bootloader is unlocked, it even shows through fastboot (Secure boot = on though), flag is set per instructions, and I am trying to install lineage-19.1-20221011-UNOFFICIAL-arm64_bvS.gz . I tried two different versions of the DSU app but nada.
make sure u r using a lineage version with the same security patch as your current OS if your on September u need a GSI on september. i personally gave up on lineage after trying a couple but was successful with a few others while dsu sideloader still worked for me, im not sure what i did to break it on my devices but i havent been able to get it to work on either device in a while.
 

ScarletWizard

Senior Member
Aug 31, 2022
176
26
OnePlus Nord N20 5G
Am willing to share my stock image with anyone willing to help. I am on the September security update on a OnePlus Nord N20 5G unlocked (Non-Carrier). I am running version 11 and android security update 2022-09-05.

I am having real issues getting LineageOS through DSU. It fails immediately on start every time. Bootloader is unlocked, it even shows through fastboot (Secure boot = on though), flag is set per instructions, and I am trying to install lineage-19.1-20221011-UNOFFICIAL-arm64_bvS.gz . I tried two different versions of the DSU app but nada.
i was able to dsu load lineage mutliple times but always failed patching the boot,img with magick

im on the oct patch unlocked bootloader with a custom custom token given to me by a tech, my phone is TMO and does not meet the rules for unlocking but nontheless it is unlocked.

i dsu sparkos GSI and i am bootLooped and holding power forever does nothing,
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Am willing to share my stock image with anyone willing to help. I am on the September security update on a OnePlus Nord N20 5G unlocked (Non-Carrier). I am running version 11 and android security update 2022-09-05.

    I am having real issues getting LineageOS through DSU. It fails immediately on start every time. Bootloader is unlocked, it even shows through fastboot (Secure boot = on though), flag is set per instructions, and I am trying to install lineage-19.1-20221011-UNOFFICIAL-arm64_bvS.gz . I tried two different versions of the DSU app but nada.
  • 3
    **Edit: Be sure to read comments at the end of this post******

    I've already posted this a few times but I figured I would try to save some people time who want/need to root from any security patch. This is a copy and paste from an answer I gave in another thread but it's a basic how to.
    Install DSU sideloader app from playstore to boot a prerooted GSI then use Partitions Backup and Restore app from playstore to save copies on your device. Install magisk app and patch the extracted boot.img and then transfer backups along with the patched boot image to your PC for safekeeping and flash the patched boot.img in fastboot. You can rename any .bin files to .img to flash them if they get extracted as a .bin file. Check your settings in the partitions Backup and Restore app before starting the backup process. You can choose to save them in an easy to find directory and for me it was better to choose to save them RAW/uncompressed then just compress them all into a single archive rather than having a hundred separate archives for each individual partition because it makes it easier if you have to reflash things if you need to recover. You may want to disable battery optimization for the app because it takes a while to extract all the images doing a full backup but its well worth the wait time if it saves you from a brick later on.

    I wish I had time to elaborate but hopefully someone else can take the time to elaborate and add to this for anyone needing step by step. I'm surprised nobody has done this already.

    Credits to AndyYan for giving advice on the root method. I stole this from him and just made a post with a title that makes it easier to find since so many are still asking how to go about rooting their devices.


    *****REQUEST TO COMMUNITY********
    There are many who are already on August Security patch and i dont have time to update and post the newest images. So if you are on august patch and pull backups I ask that someone please be so kind as to upload a copy of your backup to Google Drive or a filehosting server of choice and post a new thread so that others can unbrick their devices.
    *Please ***DO NOT include**** the following partitions*:
    DEVINFO
    DINFO
    FRP
    KEYMASTER_A
    KEYMASTER_B
    KEYSTORE
    LOGDUMP
    ***MDM1M9KEFS1
    ***MDM1M9KEFS2
    ***MDM1M9KEFS3
    ***MDM1M9KEFS4
    MODEMDUMP
    OPLUS_SEC_A
    OPLUS_SEC_B
    RAWDUMP
    SECDATA
    STORSEC
    USERDATA
    VM-KEYSTORE

    *** These partitions may/contain YOUR personal device info, DO NOT make these public***

    You can make a new Google account for the sole purpose of uploading these for the community so as not to fill your own GDrive. Be sure to change permissions for the images to share with anyone who has the link. This would be very much appreciated by many.

    *****Update 09/18/2022*****
    Thanks to ctschrodinger88 & dmtec for posting more detailed instructions!!! you can find ctschrodinger88's instructions below, scroll down to the 5th post.
    dmtec also posted instructions in another thread linked here: https://forum.xda-developers.com/t/august-boot-img.4491831/post-87426877

    we are still in need of august modems if anyone cares to upload them to their drive and link them or any other filehosting service.
    2
    I used the info provided and referenced here as a guide and some external pieces and have things working.
    I'll caveat the following, I don't remember the current firmware version I started with, but I'll try to remember to update.
    I have the Nord N20 5g, but not the T-mo branded one, though in looking at this, the concepts should be the same.

    Base assumptions:
    - If you haven't done these beforehand, stop and take care of it. Research if you need, but please DO NOT just keep going or copy, paste, and run, without understanding to some extent what you're doing. If you just run commands it can be much harder to fix later.
    a. Your phones bootloader is unlocked. (If you haven't already done it, when you do, your data will be gone, so if you care, back it up NOW)

    b. You have access to an Android terminal of some sort (adb or on-device terminal) and you know how to use it. Unless you absolutely can't use a computer for some reason, I would use adb, it makes data backup easier (IMO).

    c. You have somewhere to store your backed up partitions (THIS IS IMPORTANT)


    Step 0: Download a pre-rooted Generic System Image (GSI) to use. Put it in a good working directory. This page links to several. https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-(GSI)-list
    I used the LineageOS image by @AndyYan
    If you are wondering about the various file endings this is the basic version
    Code:
    <ARCH>_xyZ
    
    <ARCH> can either be arm, a64 (arm32_binder64) or arm64
    x can either be a or b
    y can either be v, o, g or f
    Z can be N or S
    
    b = a/b
    a = a-only
    
    g = gapps
    o = gapps-go
    v = vanilla (no gapps included)
    f = floss (free & open source apps instead gapps)
    
    N = no superuser
    S = superuser included
    From: https://forum.xda-developers.com/t/teclast-t30-t1px-suitable-gsi-roms.4211427/

    Step 1: Enable the Dynamic System Update (DSU) feature flag, you can follow the exact steps for this in this section https://developer.android.com/topic/dsu#feature-flag
    If you are unsure, just run the `adb shell` command.

    Step 2:
    If the image you downloaded needs to be in ".gz" format. Some of the tools will handle alternate types, but that's because it rebundles it at ".gz", you can save some effort doing it yourself.
    Code:
    gzip -c [IMG_NAME]..img> [IMG_NAME].gz

    Step 3: Push the image to the device
    `adb push [IMG_NAME].gz /storage/emulated/0/`

    This is where I switched from ADB to on-the-device.
    Step 4: Download the DSU Sideloader: https://github.com/VegaBobo/DSU-Sideloader
    You can do this with adb but I wasn't able to get it to run, so I went with the DSU Sideloader app above which made it much simpler.

    Step 5: Run DSU Sideloader. You can follow the instruction there in the README. You will need to run a command that the app provides, either via adb or an emulator. Then you will reboot via the notification.

    Step 6: [Once you reboot] Enable Developer tools in phone settings.

    Step 7: BACKUP, BACKUP, BACKUP (Please do this now. It will help make life much, much better if you ever have an issue and need to reset.)
    This was my process:
    Bash:
    adb shell
    su
    mkdir /sdcard/partitions
    cd /dev/block/by-name/
    for x in *; do  dd if=/dev/block/by-name/$x of=/sdcard/partitions/$x ; done
    # Note the collective size will be greater than the default space on the GSI boot, so you will want to separate things
    
    
    # Back on local machine
    mkdir [working_dir]
    cd [working_dir]
    adb pull /sdcard/partitions
    # Your files from the adb command should populate the folder
    mv [working_dir]/partitions/* [working_dir]/
    
    
    # On device
    rm /sdcard/partitions/*
    # repeat the commands above as often as needed.

    I don't know for sure all the files you will want to backup, but I pulled everything just to be safe. Keep them safe, because it is your safety net if you fall.

    Step 8: Get boot_a or boot_b back on the device along with Magisk.apk (Please only download from here: https://github.com/topjohnwu/Magisk/releases)

    Step 9: Install Magisk.apk (you can do this via
    Code:
    adb install ./magisk.apk
    )

    Step 10: Launch Magisk and install it to the book image stored on your sdcard.

    Step 11: Pull the patched image to your local machine.
    Code:
    adb pull /sdcard/Download/magisk_patched-[stuff].img

    Step 12: Boot phone to fastboot
    Code:
    adb reboot bootloader

    Step 13: This is where there is an ideal and a real.
    Ideal command
    Code:
    fastboot boot magisk_patched.img
    where fastboot transfers the files and things just work, and if you reboot the system the regular boot.img is used. I haven't been able to get that to with this device.
    I instead just ran
    Code:
    fastboot flash boot magisk_patched.img
    which replaced the existing boot image, which is good, if it works, but if it doesn't, this is why you have backups!!!! Reboot the phone.

    Step 14: When you boot, finish installing Magisk and you'll be ready to go.

    If I remember other steps I'll add, or if you have questions I will try to help answer.
    1
    Damn, it's been a long time. Glad to be back.
    1
    can you suggest me a pre rooted gsi rom please?
    thanks
    Andy Yan's Lineage18 or 19..
    1
    Am willing to share my stock image with anyone willing to help. I am on the September security update on a OnePlus Nord N20 5G unlocked (Non-Carrier). I am running version 11 and android security update 2022-09-05.

    I am having real issues getting LineageOS through DSU. It fails immediately on start every time. Bootloader is unlocked, it even shows through fastboot (Secure boot = on though), flag is set per instructions, and I am trying to install lineage-19.1-20221011-UNOFFICIAL-arm64_bvS.gz . I tried two different versions of the DSU app but nada.