How To Guide How to root any N20

Search This thread

ScarletWizard

Senior Member
Aug 31, 2022
702
106
Moto G 5G
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.hd


sh: adb: inaccessible or not found
127|:/data/data # cd..
sh: cd..: inaccessible or not found
127|:/data/data # su
:/data/data # exit
:/data/data # exit
OP515AL1:/sdcard/partitions $ adb pull /sdcard/partitions
/system/bin/sh: adb: inaccessible or not found
127|OP515AL1:/sdcard/partitions $


what anm i doing wrong
 

ScarletWizard

Senior Member
Aug 31, 2022
702
106
Moto G 5G
it seems that all the troubles in having is because of new storage rules called scope storage. i will figure it out later, im done for the day
 

PsYk0n4uT

Senior Member
i have yet to try the october firmware but it should be easy to downgrade and root if you think its the new updates. although make sure ur disabling verity. u might wanna disable the checks on vbmeta_boot too... i usually just disable it on all 3 vbmeta's to be safe.... i have a full july dump and someone else has posted the august dump on TG but that doesnt help in your case since you have the CPH2459 and we are on GN2200's nobody has been able to successfully crossflash them yet and im not sure if it will be possible or not but everyone that has tried it has bricked their devices so far. most have gotten them running again but have lost fingerprint
 
  • Like
Reactions: ScarletWizard

ScarletWizard

Senior Member
Aug 31, 2022
702
106
Moto G 5G
I'm not even gonna try.

i changed my mind, i will try to proceed to root oct 5 ota nord n20.

i will start from the beginning with the bootloader already unlocked. im going to load a pre rooted gsi and pull the boot.img
 
Last edited:

ScarletWizard

Senior Member
Aug 31, 2022
702
106
Moto G 5G
i have yet to try the october firmware but it should be easy to downgrade and root if you think its the new updates. although make sure ur disabling verity. u might wanna disable the checks on vbmeta_boot too... i usually just disable it on all 3 vbmeta's to be safe.... i have a full july dump and someone else has posted the august dump on TG but that doesnt help in your case since you have the CPH2459 and we are on GN2200's nobody has been able to successfully crossflash them yet and im not sure if it will be possible or not but everyone that has tried it has bricked their devices so far. most have gotten them running again but have lost fingerprint
im on gn2200
 

PsYk0n4uT

Senior Member
Ok my last upload didn't upload correctly for some reason. I will re upload tomorrow I think..... I need to figure out exactly which partitions are device-specific.... I know which partitions get updated in the incrementals so if all of them don't get flashed then everything won't match but I have a feeling that the incrementals update a device-specific partition or two and if so then u will lose fingerprint at minimum...... I think I should just pull full backup of all partitions and then go for it. Worst case so long as u do everything right. U just don't boot and have to reflash the stock boot image... Be sure to flash the stock image to both slots just in case and then switch back to ur active slot and flash the patched boot image. I mean if it was me I would b comfortable doing it but that's completely ur call, I don't wanna encourage anything because there ALWAYS a risk something could go wrong. Power outage or something and it's screwed up but any time u r flashing u will always be taking a risk. Though I think the risk is minimal so long as u do everything right and there's not much to the simple root process, patch the boot image and flash, if it doesn't work then reflash the stock one. If it DIES work out for u we would b grateful for the October firmware if u wanna share it, we didn't get October yet.
 
  • Like
Reactions: ScarletWizard

ScarletWizard

Senior Member
Aug 31, 2022
702
106
Moto G 5G
Ok my last upload didn't upload correctly for some reason. I will re upload tomorrow I think..... I need to figure out exactly which partitions are device-specific.... I know which partitions get updated in the incrementals so if all of them don't get flashed then everything won't match but I have a feeling that the incrementals update a device-specific partition or two and if so then u will lose fingerprint at minimum...... I think I should just pull full backup of all partitions and then go for it. Worst case so long as u do everything right. U just don't boot and have to reflash the stock boot image... Be sure to flash the stock image to both slots just in case and then switch back to ur active slot and flash the patched boot image. I mean if it was me I would b comfortable doing it but that's completely ur call, I don't wanna encourage anything because there ALWAYS a risk something could go wrong. Power outage or something and it's screwed up but any time u r flashing u will always be taking a risk. Though I think the risk is minimal so long as u do everything right and there's not much to the simple root process, patch the boot image and flash, if it doesn't work then reflash the stock one. If it DIES work out for u we would b grateful for the October firmware if u wanna share it, we didn't get October yet.
If it dies. Lol scary.

I'm in the process of doing the partition thing
 

jayram1408

Senior Member
Mar 25, 2012
87
21
Denver
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
One small problem, although Metron PCS uses T-Mobile towers, they are their own entity and T-Mobile does not have their Bootloader codes. Only OnePlus and Metro PCS have the Metro PCS unlock.bin file. That's what I came here was to try and find a dedicated metro bootloader unlock web page. Like the T-Mobile dedicated page. There is not one so it's going too take several calls over several weeks unless some one here knows a different way or a link to a metro PCS bootloader unlock page? Anyone chime in on this and save all of us that are running in circles back down the straight path to an unlocked bootloader..
 

ScarletWizard

Senior Member
Aug 31, 2022
702
106
Moto G 5G
One small problem, although Metron PCS uses T-Mobile towers, they are their own entity and T-Mobile does not have their Bootloader codes. Only OnePlus and Metro PCS have the Metro PCS unlock.bin file. That's what I came here was to try and find a dedicated metro bootloader unlock web page. Like the T-Mobile dedicated page. There is not one so it's going too take several calls over several weeks unless some one here knows a different way or a link to a metro PCS bootloader unlock page? Anyone chime in on this and save all of us that are running in circles back down the straight path to an unlocked bootloader..
PM your IMEI and screenshot me your about phone page.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    **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.
    3
    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.
    2
    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.
    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..