How to flash GSIs on the Red Magic 5G/How to build super.img from other imgs

VZTech

Senior Member
Dec 31, 2019
420
53
0
Hmm... That's weird.
Have you increased the size of the partition that you've added the file to in the script? (If it was added to the system img probably won't matter as I've set the value to something like 3gigs if I remember correctly)
So doing it without adding the file works, but if you add it it won't boot right?
Same size when its done. It doesnt boot
 

WiFlex

Member
Apr 28, 2020
6
2
0
kernel source repo has been created today by zte. there is nothing inside yet!
I found this too, there are three branches:

Code:
https://github.com/AndroidDumps/nubia_nx659j_dump/commits/qssi_NX659J-user-10-QKQ1.191219.002-eng.nubia.20200228.125411-release-keys
Code:
https://github.com/AndroidDumps/nubia_nx659j_dump/tree/qssi_NX659J-user-10-QKQ1.200127.002-eng.nubia.20200221.061255-release-keys?files=1
 
Last edited:

apersomany

Member
Apr 18, 2019
26
14
0
how to recover original firmware

when i try to update it from recovery stuck at 25%
Get the ota from nubia cn, build super.img with my script, flash it with fastboot. All partitions should be flashable with fastboot except the one's in the super partition. If you can't build the stock super.img I'll upload it for you. (This still doesn't fix ota tho, that's why I said anyone doing this should backup the super partition)
 

sasabasha123

Member
May 2, 2020
9
0
0
Get the ota from nubia cn, build super.img with my script, flash it with fastboot. All partitions should be flashable with fastboot except the one's in the super partition. If you can't build the stock super.img I'll upload it for you. (This still doesn't fix ota tho, that's why I said anyone doing this should backup the super partition)
thx brother
i really try to build super.img but i failed so i will be grateful if u make it for me
 

VZTech

Senior Member
Dec 31, 2019
420
53
0
Nubia's bootloader and fastbootd is **** and both can't flash images to the logical partitions like the system partition and vendor partition.
So we need to build an image for the super partition to be flashed.

If you just wanted to flash a custom rom skip part 1 and download the super.img from the link (los or havoc, havoc recommended as los's brightness control is half broken)

Requirements: An unlocked RM5G booted into the bootloader (not fastbootd, if you don't know what that is, you probably are in bootloader), An A/B GSI image (yes we need a A/B image not an A-only image, from android 9 released devices all phones are systeam as root), A linux environment (I did it in WSL), the download file

BACKUP YOU'RE SUPER PARTITION BEFORE FLASHING AND SAVE IT SOMEWHERE SAFE BEFORE FLASHING
(Seriously, tho I figured this out while trying to unbrick my phone after ****ing up my super partition. Trust me, it will be a life saver. Doing this will also break flashing stock ota rom via recovery until you flash your backup)

Part 1: Building the super image
Download tools.7z and extract it
Place the GSI image in the same folder and rename it to system.img
Execute the lpmake.sh script in a linux environment (It will say invalid headers at magic, it's not an error so just ignore it)
When it is complete there will be a super.img file in the folder (takes about 1 min)

Part 2: Flashing the super image
Before we flash the super.img we have to disable verity.
flash vbmeta and vbmeta_system with
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot --disable-verity --disable-verification flash vbmeta_system vbmeta_system.img
(You don't have to flash these every time. Just once)
Now we can flash the super.img with
fastboot flash super super.img
You also have to wipe dalvik, cache, data
If you have twrp do it in twrp.
If you don't, you shouldn't be doing this, I told you to backup your super partition.

That's it.

Tested GSIs:
LOS 17.X : Boots, Wifi/Data/BT works, Brightness control is half broken (always at full brightness)
Android 11 DP3 : Doesn't boot
Havoc 3.4 : Boots, 3.5 doesn't work
Phh-Quack : Doesn't boot
Descendant X : Boots, same as LOS

Oh, and for people wondering about the fingerprint sensor. It doesn't work. The phone doesn't even know it has it under the display(Maybe a problem with all under display fingerprint sensor phones).

After more testing, found out slot count can be 1 instead of 2.
New 3.5 havoc build. Mind making a new super.img??? Thanks
EDIT..NVM, Im a ****
 

apersomany

Member
Apr 18, 2019
26
14
0
Oh, really?
Is that supposed to be a literal oh really,
Or is it a expression of disbelief?

When a bootloader can be unlocked when oem unlocking is disabled on the phone, that is a major security issue and we call that a $hitty bootloader. And when a fastbootd can't flash to a logical partition when a phone has one, we also call that a $hitty bootloader.
 
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