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

mohammed510

Senior Member
Feb 3, 2012
557
181
73
Dubai
@Rich T figured out how to enable fingerprint calibration after a true bootloader unlock BTW: *#*# 466349#*#* in dialer
fingerprint calibration will open,
click the after-sale calibration,
it will prompt to put the meat weight,
press your finger on the white spot,
you will then be prompted to put on black weights,
use a black piece of paper, and press the white spot,
wait for the calibration to complete.
are you sure about the code? it didnt show anything after dialing the code ..
 

mslezak

Senior Member
Dec 12, 2016
266
248
43
Houston
No it's the wrong dial code we're still looking for the correct one. Apparently that's also not the "proper" calibration process. Just use the root bypass no need to unlock the bootloader on this device when you get root without it.
 

mohammed510

Senior Member
Feb 3, 2012
557
181
73
Dubai
No it's the wrong dial code we're still looking for the correct one. Apparently that's also not the "proper" calibration process. Just use the root bypass no need to unlock the bootloader on this device when you get root without it.
Will re-locking the bootloader fix the FP? I'll donate if someone figured out how to make it work again without sending it to Nubia..
 

mslezak

Senior Member
Dec 12, 2016
266
248
43
Houston
Tarfork error 255

Yeah that's a TWRP error. It's a bug in TWRP. It's best to go install the OS, don't sync anything, make it to the main screen after boot. Don't set any pins. Then go back to TWRP and try to restore again. Works 95% of the time. Mauronofrio TWRP has that bug fixed but this isn't his, he should have a release in less than a month though I'm guessing.
 

mslezak

Senior Member
Dec 12, 2016
266
248
43
Houston
No like setup the phone without logging into any accounts, then copy the TWRP restore over from your PC to the proper place (you may need to do a TWRP backup of boot and dtbo first, just so it makes the directory). Then it usually works without the Tarfork 255 error. Like I said, it's a TWRP error, but can be worked around. Usually setting up the phone gets the data partition flashable.
 

phhusson

Recognized Developer
Jul 23, 2009
2,448
4,674
0
Paris
@Rich T figured out how to enable fingerprint calibration after a true bootloader unlock BTW: *#*# 466349#*#* in dialer
fingerprint calibration will open,
click the after-sale calibration,
it will prompt to put the meat weight,
press your finger on the white spot,
you will then be prompted to put on black weights,
use a black piece of paper, and press the white spot,
wait for the calibration to complete.
Hum where did you get those instructions from?
The code doesn't work for me.

The secret phone codes I found are:
*#*#73733867#*#*
*#*#7664#*#*
*#*#225#*#*

None of those have fingerprint calibration.
However, you can start goodix calibration with:
adb shell am start com.goodix.fingerprint.setting/com.goodix.fingerprint.setting.MainActivity
Sadly I don't understand what it is asking me to do. Looks like flesh color (NOT finger), black piece, but it asks for a third thing, I don't understand what it is, google translate says "vertical weight"
 
  • Like
Reactions: ps000000

mslezak

Senior Member
Dec 12, 2016
266
248
43
Houston
Yes those codes are incorrect, here's what some people posted calibrating

Using the method Phhusson posted:

Start the test and when it says: "Put the Flesh Flat" press start/next and put your Finger on the Sensor, then when it says: "Put the Black Flat" put something non reflective over the sensor and tap next. The Last step where it says: "Put the Flesh Chart Flat" I used my Fingernail on the Sensor! and even though there was an error on the end, when you go to your Fingerprint/Security Settings you now can put in your Fingerprint as normal and it works again.

This is from another device but apparently people were actually able to get the FP working again using the same trick. The factory calibration actually uses tools or special materials so this is definitely a hack. I can't say this worked for anyone with an unlocked bootloader though (just a locked one where the data had been lost).
 
Last edited:

phhusson

Recognized Developer
Jul 23, 2009
2,448
4,674
0
Paris
Using the method Phhusson posted:

Start the test and when it says: "Put the Flesh Flat" press start/next and put your Finger on the Sensor, then when it says: "Put the Black Flat" put something non reflective over the sensor and tap next. The Last step where it says: "Put the Flesh Chart Flat" I used my Fingernail on the Sensor! and even though there was an error on the end, when you go to your Fingerprint/Security Settings you now can put in your Fingerprint as normal and it works again.

This is from another device but apparently people were actually able to get the FP working again using the same trick. The factory calibration actually uses tools or special materials so this is definitely a hack. I can't say this worked for anyone with an unlocked bootloader though (just a locked one where the data had been lost).
Well, it doesn't work for me (although I don't have the message in english...? Maybe because I'm on EU variant, and maybe you're not?), but relocking fixes fingerprint, so I guess I'll stick to oem nubia_unlock command, though it's very annoying, because it breaks fastbootd.
 

ps000000

Senior Member
Sep 17, 2011
1,603
348
113
Nonthaburi / Bangkok
Well, it doesn't work for me (although I don't have the message in english...? Maybe because I'm on EU variant, and maybe you're not?), but relocking fixes fingerprint, so I guess I'll stick to oem nubia_unlock command, though it's very annoying, because it breaks fastbootd.
do you have instruction and tool to install phh gsi rom on Red Magic 5G ?
 

phhusson

Recognized Developer
Jul 23, 2009
2,448
4,674
0
Paris
do you have instruction and tool to install phh gsi rom on Red Magic 5G ?
Yeah, I want to make a dedicated thread, but that's going to be for another day.
Anyway, it's pretty easy.
You'll need a modern fastboot (i.e. which supports Android 10's dynamic partitions), and we'll unlock bootloader.
Download vbmeta from https://dl.google.com/developers/android/qt/images/gsi/vbmeta.img
Download an ARM64 A/B GSI, for instance: https://github.com/phhusson/treble_...nload/v220/system-quack-arm64-ab-floss.img.xz
( https://github.com/phhusson/treble_...nload/v220/system-quack-arm64-ab-gapps.img.xz if you want gapps)

- Enable developers settings, tick oem unlock, reboot to bootloader with `adb reboot bootloader`
- Do `fastboot flashing unlock`
- Accept the unlock
- As soon as you get adb back, do `adb reboot fastboot` (/!\ THIS IS NOT `adb reboot bootloader` it is different /!\)
- `fastboot flash system system-quack-arm64-ab-floss.img`
- Select "Reboot to bootloader" on the phone
- `fastboot flash vbmeta vbmeta.img`
- Select "reboot to recovery mode" on the phone
- Wipe userdata partition from recovery
- Reboot

At the moment, fingerprint sensor doesn't work on GSI (it shouldn't take me long though), so there is no point in relocking, I guess I'll make a guide when I have it working.
 

ps000000

Senior Member
Sep 17, 2011
1,603
348
113
Nonthaburi / Bangkok
:good:

Yeah, I want to make a dedicated thread, but that's going to be for another day.
Anyway, it's pretty easy.
You'll need a modern fastboot (i.e. which supports Android 10's dynamic partitions), and we'll unlock bootloader.
Download vbmeta from https://dl.google.com/developers/android/qt/images/gsi/vbmeta.img
Download an ARM64 A/B GSI, for instance: https://github.com/phhusson/treble_...nload/v220/system-quack-arm64-ab-floss.img.xz
( https://github.com/phhusson/treble_...nload/v220/system-quack-arm64-ab-gapps.img.xz if you want gapps)

- Enable developers settings, tick oem unlock, reboot to bootloader with `adb reboot bootloader`
- Do `fastboot flashing unlock`
- Accept the unlock

I wish to add for semi-noob like me ,

The phone wipe itself as normal after unlock BL on all phones.

for a while it will Enter the 1st setup screen of the phones accept the adb access from computer,

no need to go through the entire setup just do next step.



- As soon as you get adb back, do `adb reboot fastboot` (/!\ THIS IS NOT `adb reboot bootloader` it is different /!\)
- `fastboot flash system system-quack-arm64-ab-floss.img`

- Select "Reboot to bootloader" on the phone


after that do the command before you can flash vbmeta.img

fastboot oem nubia_unlock NUBIA_NX659J


- `fastboot flash vbmeta vbmeta.img`

- Select "reboot to recovery mode" on the phone

- Wipe userdata partition from recovery

- Reboot

At the moment, fingerprint sensor doesn't work on GSI (it shouldn't take me long though), so there is no point in relocking, I guess I'll make a guide when I have it working.
 
Last edited:

Moxzot

Member
Jun 23, 2020
8
1
3
I only want to install twrp is there an option for that, I have searched everywhere for a compatible version and they either corrupt or boot loop back to the twrp recovery after install. On top of that I cant access system files in twrp, no downloads or anything.
 

kyotocafe

Member
Jul 27, 2011
14
0
0
kyoto
Well, it doesn't work for me (although I don't have the message in english...? Maybe because I'm on EU variant, and maybe you're not?), but relocking fixes fingerprint, so I guess I'll stick to oem nubia_unlock command, though it's very annoying, because it breaks fastbootd.
hi, could you please tell me what do you mean by oem nubia_unlock command ? I tried running the following:

adb reboot bootloader
fastboot oem nubia_unlock NUBIA_NX609J
fastboot reboot

but the fingerprint is still broken.
 
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