Red Magic 5G Bootloader Unlock Guide: OR get ROOT & TWRP without unlocking the BL!!!

wenhuzhang8798

New member
May 2, 2020
1
0
0
Although I try to install twrp as you said,I couldn't install it.I faced the booting problem in twrp and I have no idea how to solve.My phone is 659j China version.I think you can help me and guide me.Thank you.
 

nadejo

Senior Member
Jun 28, 2010
2,419
1,273
193
***Bootloader Unlock Instructions for the Nubia Redmagic 5G + installing TWRP:***

WARNING: ANY BOOTLOADER UNLOCK METHOD INVOLVES THE RISK OF BRICKING YOUR DEVICE PERMANENTLY. WHILE THERE IS USUALLY A WAY TO RECOVER, DO NOT ATTEMPT THIS PROCEDURE IF YOU DO NOT KNOW WHAT YOU ARE DOING. BAD THINGS CAN HAPPEN. YOU HAVE BEEN WARNED!!! YOU MAY BE LEFT WITH A USELESS BRICK!!! READ ALL FURTHER WARNINGS EXPERIMENTAL METHOD IS NOT SAFE YET!!!!!!!!!!!!!!!!!!!

***GUYS PLEASE WAIT FOR AN UPDATE HERE -> WE HAVE FOUND A WAY TO NOT BREAK FP. IT IS VERY COMPLICATED. YOU NEED TO FLASH A Chinese ROM (latest is 2.46 STABLE I believe) AND YOU NEED TO DO A LOT OF TWRP WIPES / FOLLOW STEPS EXACTLY. YOU ARE IN EFFECT BRICKING YOUR PHONE AND THEN LATER UNBRICKING IT USING THESE METHODS. AND YOU GET TO KEEP ROOT AND A LOCKED BOOTLOADER (WTF???). AND BY RESTORING THE TWRP BACKUP A SPECIAL WAY (LIKE ENTER IT 3X TIMES AND SETUP THE PHONE TOO), PEOPLE ARE REPORTING THIS ACTUALLY WORKING ON GLOBAL AS WELL (THAT WAS BACKED UP IN TWRP, BRICK RESTORED WITH UPDATE.ZIP FROM NUBIA FOR CHINA, DATA PARTITION WIPED, PHONE SETUP AGAIN SUPER PARTITION FLASHED AGAIN, THEN XYZ... MORE TO COME!!!! INSTRUCTIONS WILL BE UPDATED FROM WHAT IS IN THE ZIP UNDER EXPERIMENTAL NOW.***

All needed files are here: https://mega.nz/file/StphHapb#I2Rughn5247115zLMxamTeCwwMZRGGpEJRlQHHQYtZY IT IS HIGHLY SUGGESTED NOT TO USE THE EXPERIMENTAL DIRECTIONS AS THEY HAVE NOT BEEN TESTED OUTSIDE OF CHINA. {Mod edit} AS I MENTIONED, ONLY THE WORKING VERSION THAT BREAKS THE FP SENSOR HAS BEEN TESTED BY ME AND IT WORKS.

Go to Settings / About phone / Build Number (NX659_J_ENCommon_V3.08 on North American Variant), click 7 times, Now you are a developer message appears, go back a menu to Settings / Other system settings / Developer options.

Enable:
OEM unlocking "Allow the bootloader to be unlocked"
USB debugging "Debug mode when USB is connected"

Install Minimal ADB and Fastboot (Windows 10 in this example): https://www.androidfilehost.com/?fid=746010030569952951
Default install path is:
C:\Program Files (x86)\Minimal ADB and Fastboot\

Go to the Search button on the bottom on Windows 10, type cmd, Command Prompt will appear in the menu. Right click it and Run as Administrator. All commands to be typed will be run in this Command Prompt window (referred to as terminal) unless otherwise stated to run on the phone.

Now Terminal window appears (it says Administrator: Command Prompt in the heading):
Text displayed is:

Microsoft Windows
(c) 2020 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>

Typed in terminal:
cd "c:\Program Files (x86)\Minimal ADB and Fastboot"

I now connected the phone to a USB port on the PC.
On the phone, a Window appeared:

"Allow USB debugging?"
The computer's RSA key fingerprint is:
[36 digit code] Example:
C8:A1:D7:E2:01:F6:A1
:36:D8:10:E8:33:20:FB:
93:7D

Always allow from this computer (it's my computer so I clicked it since I trust the computer)
CANCEL / ALLOW (I clicked ALLOW)

Typed in terminal:
adb reboot bootloader

The phone reboots. Once the phone screen boots, in the center it says: Now you are in fastboot mode.

From the terminal I typed:
fastboot oem nubia_unlock NUBIA_NX659J

The terminal now displayed:
...
(bootloader) START update nubia fastboot unlock flag!!!
(bootloader) START set state to 1 ok!!!

In the terminal I typed:
fastboot flashing unlock *** NOTE EXPERIMENTAL METHOD IN THE MEGA.NZ FILE INSTRUCTIONS MAY BE USED AT YOUR OWN RISK INSTEAD OF TYPING THIS COMMAND WHICH HAS BEEN CLAIMED TO NOT REMOVE THE FINGERPRINT, AND REQUIRES 1 MORE FILE TO BE FLASHED - NOT TESTED BY ME!!! ***

Now a screen appeared on the phone with a big <!> red icon in the left corner. The rest in white text is a warning message. "By unlocking the bootloader, you will be able to install custom operating system on this phone. A custom OS is not subject to the same level of testing as the original OS, and can cause your phone and installed applications to stop working properly-
Software integrity cannot be guaranteed with a custom OS, so any data stored on the phone while the bootloader is unlocked may be at risk.
To prevent unauthorized access to your personal data, unlocking the bootloader will also delete all personal data on your phone.
Press the Volume keys to select whether to unlock the bootloader, then the Power Button to continue."

I selected UNLOCK BOOTLOADER and my device was completely erased. The factory OS loaded then. This process takes some time to complete.

Now the device rebooted with a warning message, and a big <!> yellow icon in the left corner.

"The boot loader is unlocked and software integrity cannot be guaranteed. Any data stored on the device may be available to attackers. Do not store any sensitive data on the device.

Visit this link on another device:
g.co/ABH"

Now the device reloads the firmware apparently and wipes all user data. Upon setting up the phone, the fingerprint display registration comes up and asked to place my finger on the back of the phone. There is no fingerprint sensor on the back of the Redmagic 5G! It is under the screen! So this step must be skipped. The ROM setup is corrupt or incomplete, a beta possibly. I setup the phone then went into Settings / Security to try to add a fingerprint. The button to add fingerprint then appears. Once I click the button, I get this error:

Loss of fingerprint calibration data

Loss of fingerprint calibration data was detected.
Currently unable to complete fingerprint entry,
please contact Nuia after-sales service via
4007006600

I Know (button)

I WILL UPLOAD AN EXPERIMENTAL VERSION AFTER TESTING WHEREAS PEOPLE CLAIM THE FINGERPRINT SENSOR CONTINUES WORKING, AT LEAST ON THE CHINA VARIANT. THESE INSTRUCTIONS PROVIDED HERE HAVE BEEN VERIFIED TO WORK ON 4 PHONES. A MEGA.NZ LINK WILL INCLUDE THE MENTIONED BL UNLOCK AND MAGISK FILES. I ADVISE YOU USE THE (verified working) VS THE (experimental) FLASHING INSTRUCTIONS INCLUDED IN THIS FILE ONCE RELEASED. YOU WILL LIKELY BRICK YOUR PHONE!!!! I JUST DID! TO UNLOCK THE BOOTLOADER, YOU ***MUST*** REMOVE MAGISK FROM MAGISK MANAGER ON YOUR KERNEL OR YOU WILL SUPER BRICK YOUR DEVICE. CORRUPTED BOOTLOADER WON'T BOOT. IF YOU AREN'T AN EXPERT IN BRICK RESTORATION DON'T EVEN TRY THE EXPERIMENTAL METHOD, AND CERTAINLY DON'T TRY TO LOCK A BOOTLOADER WITH A MAGISK PATCHED BOOT.IMG!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

CHINA VERSION ONLY:
Once you get up and running you'll want APK Mirror app (search in a browser) to install Google apps on the China version. Gboard download as well and set as default it's a lot easier than the Chinese keyboard that swaps between Chinese and English. Set size extra tall for this huge phone (I prefer anyhow). Chrome go download it from APK Mirror app as well. Now install Google PlayStore 19.3.26 and setup your email under Settings / Other accounts / Google / login to your Google account. You'll want the Google Contacts Sync and Google Calendar Sync APKs as well from APK mirror. The rest of the Google apps you want you can just download in the PlayStore and set them as default over Nubia's in the Settings menu.

ROOT FOR ALL DEVICES:
Go to XDA and Download Magisk Manager and install the APK. Download the latest Magisk as well from the Manager. You can then reboot to Recovery (volume up + power, release the power button once the screen shows it loading, hold the volume up down until you see TWRP pop up). Flash Magisk from TWRP Install / Zip / sdcard / Magisk.zip reboot and you'll have root.

Note on my testing the fingerprint did not work after unlocking the bootloader (see my asterisks *** above, some have CLAIMED it kept function by not typing that command, and flashing a vbmeta.img). With the missing fingerprint, it says to contact Nubia support at some Chinese number. Tested on North American variant too of course you don't need to setup any Google Playstore on this version as it comes with it.

If at any time you want to remove the OEM unlock, you plug into the PC, go to the terminal for Minimal ADB and Fastboot, type: adb reboot fastboot; fastboot oem lock; adb flashing lock (*** ONLY if you typed adb flashing unlock prior, the way I've rooted thus far), last: fastboot oem relock. Reboot it should WIPE the entire phone and be back to normal Android 10 setup non rooted, no unlocked bootloader. Always beware of data loss doing root functions!!! Always be prepared to setup your phone entirely over again. Google Backup is very good to turn on before you do any of this stuff if you have already installed apps.


{Mod edit}
can you update the instructions? eith the vbmeta file it seems fingerprint will keep working on all rom variants, not only cn. and relocking the bootloader isn't required for the fingerprint to work it's just for those who dont want the boot prompt. we only require unlocked bootloader if we want to change or flash anything. also don't attempt to remove magisk with a locked bootloader!
 
Last edited by a moderator:

mslezak

Senior Member
Dec 12, 2016
266
248
43
Houston
can you update the instructions? eith the vbmeta file it seems fingerprint will keep working on all rom variants, not only cn. and relocking the bootloader isn't required for the fingerprint to work it's just for those who dont want the boot prompt. we only require unlocked bootloader if we want to change or flash anything. also don't attempt to remove magisk with a locked bootloader!
You can remove it via fastboot by flashing the unrooted one, nothing breaks. I've done it.

Updated the instructions for the non-unlocked BL one, posted before the Unlock your BL instructions, which break your FP. And a link to my BlackMagic5G Beta ROM released yesterday night. Will have a separate thread when I get working NFC and a custom boot theme.
 

bANONYMOUS

Senior Member
Dec 30, 2011
113
16
48
Canada, Earth.
I followed the steps here and the steps on Telegram, tried to get an understanding of this as I haven't done anything with root or custom roms in probably 8 years.

I'm running Linux which is the only thing different from the dev, but that shouldn't really matter as long as the commands all still work, however I'm stuck in TWRP. I'll repeat my steps below. Maybe someone can point out what went wrong.

On the phone
I enabled dev options, enabled oem unlocking and usb debugging, allowed USB debugging when prompted.

On the computer
$ adb reboot bootloader
$ fastboot oem nubia_unlock NUBIA_NX659J
$ fastboot flash recovery recovery-TWRP-3.4.1B-0324-NUBIA_REDMAGIC_5G-CN-wzsx150.img
$ fastboot flash vbmeta vbmeta.img
$ fastboot flash modem NON-HLOS.bin

On the phone
Held Power and Volume Down until it rebooted into TWRP

Now from this point, I wanted to install Black Magic 5G, so I went to backup, backed only the boot partition (so once I have the deviceID folder made, I can copy over the Black Magic 5G files over to that folder and restore it) however when I try to restore only the boot image, it says fails, something about not having storage permission or something, I can't remember exactly what it said but I have to go to bed for work tomorrow so I can get more detail tomorrow when I'm back home, but it basically just tells me to reboot and that it failed, and no folder is created with the DeviceID to copy the Black Magic 5G files over to.

I did try skipping this step so at least I would have my phone for while I'm at work tomorrow just by flashing Magisk-v20.4.zip, I did it with adb by sideloading and I didn't get any errors or anything, installed just fine, tried rebooting to system like the instructions say if you just want root, and it just reboots into TWRP lol, so now it's stuck in TWRP, can't restore with Black Magic 5G, can't boot into rooted Global.

Any idea's? Suggestions?

EDIT:


So the error trying to make a backup of the boot image only like the instruction say is
"Can not create '/usb-otg/TWRP/BACKUPS/deviceID/etc/etc/etc' folder (I/O error)"
"Failed to make backup folder"

So when I saw it was trying to use OTG, I decided to change the backup location to a USB stick using an OTG adapter and backing up the boot image worked.

I then went on my computer, copied over the Black Magic 5G files to the folder with my DeviceID, and now when I try to restore, it shows all of the partitions I can backup from by trying to do this off of a USB stick.

When I tried to restore all of the selected partitions, I get a different error now right after "Restoring Data (excl. storage)..." that says "extractTarFork() process ended with error 255"
Tried unmounting data from mount options in TWRP but I get the same error, so I tried restoring without the Data partition to see if any further partitions give me issues, and that ends up giving me three more errors, "/System (invalid argument), /vendor (invalid argument), /odm (invalid argument)"

Tried rebooting anyway but it just goes back to TWRP lol, something defiantly isn't working.
 
Last edited:
  • Like
Reactions: arjun_m4

VZTech

Senior Member
Dec 31, 2019
420
53
0
I followed the steps here and the steps on Telegram, tried to get an understanding of this as I haven't done anything with root or custom roms in probably 8 years.

I'm running Linux which is the only thing different from the dev, but that shouldn't really matter as long as the commands all still work, however I'm stuck in TWRP. I'll repeat my steps below. Maybe someone can point out what went wrong.

On the phone
I enabled dev options, enabled oem unlocking and usb debugging, allowed USB debugging when prompted.

On the computer
$ adb reboot bootloader
$ fastboot oem nubia_unlock NUBIA_NX659J
$ fastboot flash recovery recovery-TWRP-3.4.1B-0324-NUBIA_REDMAGIC_5G-CN-wzsx150.img
$ fastboot flash vbmeta vbmeta.img
$ fastboot flash modem NON-HLOS.bin

On the phone
Held Power and Volume Down until it rebooted into TWRP

Now from this point, I wanted to install Black Magic 5G, so I went to backup, backed only the boot partition (so once I have the deviceID folder made, I can copy over the Black Magic 5G files over to that folder and restore it) however when I try to restore only the boot image, it says fails, something about not having storage permission or something, I can't remember exactly what it said but I have to go to bed for work tomorrow so I can get more detail tomorrow when I'm back home, but it basically just tells me to reboot and that it failed, and no folder is created with the DeviceID to copy the Black Magic 5G files over to.

I did try skipping this step so at least I would have my phone for while I'm at work tomorrow just by flashing Magisk-v20.4.zip, I did it with adb by sideloading and I didn't get any errors or anything, installed just fine, tried rebooting to system like the instructions say if you just want root, and it just reboots into TWRP lol, so now it's stuck in TWRP, can't restore with Black Magic 5G, can't boot into rooted Global.

Any idea's? Suggestions?

EDIT:


So the error trying to make a backup of the boot image only like the instruction say is
"Can not create '/usb-otg/TWRP/BACKUPS/deviceID/etc/etc/etc' folder (I/O error)"
"Failed to make backup folder"

So when I saw it was trying to use OTG, I decided to change the backup location to a USB stick using an OTG adapter and backing up the boot image worked.

I then went on my computer, copied over the Black Magic 5G files to the folder with my DeviceID, and now when I try to restore, it shows all of the partitions I can backup from by trying to do this off of a USB stick.

When I tried to restore all of the selected partitions, I get a different error now right after "Restoring Data (excl. storage)..." that says "extractTarFork() process ended with error 255"
Tried unmounting data from mount options in TWRP but I get the same error, so I tried restoring without the Data partition to see if any further partitions give me issues, and that ends up giving me three more errors, "/System (invalid argument), /vendor (invalid argument), /odm (invalid argument)"

Tried rebooting anyway but it just goes back to TWRP lol, something defiantly isn't working.
FORMAT data
 
  • Like
Reactions: bANONYMOUS

bANONYMOUS

Senior Member
Dec 30, 2011
113
16
48
Canada, Earth.
FORMAT data
You didn't say when to format data, so, I just did every variant I could think of.
So, in TWRP, I tried..
Wipe data, restoring Black Magic, failed restoring data.
Wipe data, unmounted Data, restore Black Magic, failed restoring data.
Wipe data, restoring black magic without Data (success), reboots into TWRP only.
Wipe data, restoring Black Magic without Data (success), Wipe Data, reboots into TWRP only.
Wipe data, unmounted Data, restore Black Magic without Data (success), reboots into TWRP only.
Wipe data, unmounted Data, restore Black Magic without Data (success), Wipe Data, reboots into TWRP only.

I also tried installing zip through TWRP of the CN ROM, I get
Zip file is corrupt!
Error installing zip file '/usb-otg/NX659J-update.zip'

Keeping in mind that when I tried to create a back up after I first got into TWRP, it failed, so I currently don't have any backup I am able to restore to, essentially the phone is a brick at this moment lol. If anyone wants to toss up a TWRP recovery of official Global, that would be super awesome. At least then I would be able to restore, have a proper boot.img, restore the factory recovery, flash the official CN ROM, and then try Black Magic again over top of the CN ROM instead of Global becuase there seems to be an issue doing it this way.
 

VZTech

Senior Member
Dec 31, 2019
420
53
0
You didn't say when to format data, so, I just did every variant I could think of.
So, in TWRP, I tried..
Wipe data, restoring Black Magic, failed restoring data.
Wipe data, unmounted Data, restore Black Magic, failed restoring data.
Wipe data, restoring black magic without Data (success), reboots into TWRP only.
Wipe data, restoring Black Magic without Data (success), Wipe Data, reboots into TWRP only.
Wipe data, unmounted Data, restore Black Magic without Data (success), reboots into TWRP only.
Wipe data, unmounted Data, restore Black Magic without Data (success), Wipe Data, reboots into TWRP only.

I also tried installing zip through TWRP of the CN ROM, I get
Zip file is corrupt!
Error installing zip file '/usb-otg/NX659J-update.zip'

Keeping in mind that when I tried to create a back up after I first got into TWRP, it failed, so I currently don't have any backup I am able to restore to, essentially the phone is a brick at this moment lol. If anyone wants to toss up a TWRP recovery of official Global, that would be super awesome. At least then I would be able to restore, have a proper boot.img, restore the factory recovery, flash the official CN ROM, and then try Black Magic again over top of the CN ROM instead of Global becuase there seems to be an issue doing it this way.
Re read you quoting me. FORMAT data. NOT WIPE.
 
  • Like
Reactions: bANONYMOUS

bANONYMOUS

Senior Member
Dec 30, 2011
113
16
48
Canada, Earth.
Re read you quoting me. FORMAT data. NOT WIPE.
How do you format in TWRP? I googled it quick and found some threads about formatting in TWRP and everything said wipe = format.

EDIT:
Holy **** I'm an idiot, I seriously have no idea how I didn't see the literal "Format Data" button RIGHT beside Advanced Wipe.. I need to get more sleep..

EDIT 2:
I got it working, it was a process, so many formats, restores, and reboots... It's all good though, thanks!
 
Last edited:

mslezak

Senior Member
Dec 12, 2016
266
248
43
Houston
Just updated the instructions new link check now

As feedback comes in (others installing root from different original ROMs) I'm updating the instructions in the Root installer zip file here. Global has been added to instructions. The original assumed you already were on a CN variant. Download the new link installer and there's another .txt file included.
 
  • Like
Reactions: terrapin4

terrapin4

Senior Member
Sep 14, 2010
91
20
28
Sorry to bother you, one last question(s)

When you say:

"I suggest you flash my new ROM BlackMagic5G Beta and don't unlock your bootloader at all"

..does that imply with TWRP and root? What are the conditions for this? Assuming you can't flash with stock recovery.

I have TWRP and non-rooted currently and followed your guide....

fastboot oem nubia_unlock NUBIA_NX659J

fastboot flash recovery recovery-TWRP-3.4.1B-0324-NUBIA_REDMAGIC_5G-CN-wzsx150.img

fastboot flash vbmeta vbmeta.img
fastboot flash modem NON-HLOS.bin


I'm unsure where to go from here to get your ROM flashed.



Sent from my NX659J using Tapatalk
 

kassem1992

New member
May 11, 2020
1
0
0
where can i find twrp-3.4.1b-0324-nubia_redmagic_5g-cn-wzsx150.img

i want to download twrp-3.4.1b-0324-nubia_redmagic_5g-cn-wzsx150.img
but i can't find it anywhere.
anyone can help pleas
 

Xyconious

New member
May 13, 2020
4
0
0
i know this is probably a question i should know the answer to, but a lot of this is new to me anways, when i downloaded the adb fastboot and twrp recovery, all my twrp files are in .rar form, how would i get it changed to an .img file? so that way i can flash it
 
Last edited:

Xyconious

New member
May 13, 2020
4
0
0
i know this is probably a question i should know the answer to, but a lot of this is new to me anways, when i downloaded the adb fastboot and twrp recovery, all my twrp files are in .rar form, how would i get it changed to an .img file? so that way i can flash it
nevermind, figured out that i needed to use a different program to unzip
 

Xyconious

New member
May 13, 2020
4
0
0
Having issues trying to flash recovery, says error: cannot load recovery-TWRP-3.4.1B-0324-NUBIA_REDMAGIC_5G-CN-wzsx150.img : no such file or directory. if i try to unzip the file it changes it to a .rar file and i dont know how to extract without changing it.
 

m8822

Member
May 6, 2016
22
2
3
hi, thanks for the efforts. where can i find global stock rom? for safety reasons just incase i mess things up
also is there any blackmagic rom.zip so we can flash it via twrp? if not any ETA.
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone