[Android Q&A, Help & Troubleshooting] smvsmv:
All info current as of 05/12/2021

​

I'm editing this original post to update what I've cobbled together from various forums. I do not take credit for any of the below. Nor the responsibility if you brick your phone. So, proceed with caution and at your own risk.

All steps were tested on windows 10. Make sure you follow the steps below, in order.

Don't skip steps or ignore errors

.

TWRP

:

The only TWRP version available is an unofficial version. This version doesn't mount super/system and there's no reason to install it.​

​

Rooting your stock ROM

:

00. Save the folowing stock ROM files in your adb folder on your computer. If you plan to patch boot.img yourself, save the boot.img on your phone too. Attached is the patched boot.img (magisk 23).​

vbmeta.img

vbmeta_system.img

vbmeta_vendor.img

boot.img

01. Boot into stock ROM​

02. Go to settings/About phone. At the bottom, tap on "build number" until developer options are enabled.​

03. Connect the phone to your ADB installed computer. Ensure that your computer has the latest version of drivers and the latest version of adb.​

04. On your phone, go to settings/system/advanced/developer options. Enable "OEM Unlocking" and "USB debugging". Authorize device when the prompt shows up on your phone.​

05. Install Magisk and patch the boot.img from stock ROM. Alternatively, you can use the attached file. The file is required in step 14.​

06. Execute the below commands from the adb folder using a PowerShell window.​

07. ./adb reboot recovery. Wait for phone to reboot to recovery.​

08. factory reset the phone​

09. ./adb reboot bootloader. Wait for phone to reboot to fastboot.​

10. ./fastboot flashing unlock. Read disclaimer and press vol+ to confirm that you want the bootloader unlocked. ​

11. ./fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img​

12. ./fastboot --disable-verity --disable-verification flash vbmeta_system vbmeta_system.img​

13. ./fastboot --disable-verity --disable-verification flash vbmeta_vendor vbmeta_vendor.img​

14. ./fastboot --disable-verity --disable-verification flash boot magisk_patched_P3_23.img​

15. ./fastboot reboot​

16. You are now rooted.​

Installing a GSI

:

Installing Magisk on any GSI results in a boot loop. If you are already rooted, you can skip to step 12 after getting to fastboot. But I strongly recommend starting from step 01.​

01. Download an AB GSI. If it a zip file, extract the img from it. Flashing an A-Only GSI will result in a boot loop. ​

02. Flash the stock ROM. I used UMIDIGI_Power_3.E_V1.2_202003282206. Keep the stock firmware and SP flash tool folders.​

03. Boot into the stock rom. In developer settings enable OEM unlock, USB debugging and authorize it from your computer. Don't bother setting up Wi-Fi or installing apps. The phone will be factory reset shortly. ​

04. Perform the below commands in the latest version of adb.​

05. ./adb reboot recovery​

06. Select Factory reset and reset.​

07. ./adb reboot bootloader (or use the menu option). The screen should show "fastboot mode" at the bottom of the screen in small font.​

08. ./fastboot flashing unlock. Read phone screen for instructions. You will have to press volume up key to continue to unlock.​

09. ./fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img (from stock ROM)​

10. ./fastboot --disable-verity --disable-verification flash vbmeta_system vbmeta_system.img (from stock ROM)​

11. ./fastboot --disable-verity --disable-verification flash vbmeta_vendor vbmeta_vendor.img (from stock ROM)​

12. ./fastboot --disable-verity --disable-verification flash boot boot.img (from stock ROM)​

13. ./fastboot -w​

14. ./fastboot reboot fastboot (you MUST be at the fastbootd menu now. If not, you will not be able to flash the GSI successfully)​

15. ./fastboot erase system​

16. You will need a larger system partition to flash a GSI. There are 2 ways to achieve this​

16a. ./fastboot delete-logical-partition product - deletes the product partition, allowing a larger system partition​

OR​

16b. ./fastboot resize-logical-partition product 509344768​

16c. ./fastboot resize-logical-partition system 3089272064​

resizes product and system partitions. This gives you about 3GB of system partitions. Adjust the numbers as required.​

17 ./fastboot --disable-verity --disable-verification flash system <GSI file with .img extention>​

18. Reboot to system.​

19. Hold your breath and wait to see your GSI's bootscreen.​

Other useful info:

The boot.img is already present in the ROM. The below command will recover the boot.img from your phone and save it in your phone's Downloads folder. Execute it from a

terminal on your phone and as super user

. You will need root.​

dd if=/dev/block/by-name/boot of=/storage/emulated/0/Download/boot.img​

​

For retrieving super partition to your device's download folder,​

dd if=/dev/block/platform/bootdevice/by-name/super of=/storage/emulated/0/Download/super.img​

​

Unpacking and repacking super.img is a bit involved.

I've only gotten till step 06 so far.

​

01 You

WILL

need a linux environment. If you are on windows, you can install a linux distro from the microsoft store.​

02 Download lpunpack_and_lpmake-masterz.zip. Unzip it to a folder and execute the below commands in the linux shell​

x86 or x86_64: ​

sudo apt install clang zlib1g-dev ​

./make.sh​

arm or arm64:​

sudo apt install clang ​

./make.sh​

03 You should see 2 files in the folder - lpmake and lpunpack.​

04 Copy stock super.img into the folder and in the linux shell, execute ./lpunpack super.img.​

05 After a few minutes, you will see vendor, product and system images in the folder now.​

06 Replace system.img with a gsi of your choice. The file name MUST be system.img.​

07 Repack super.img using ./lpmake. Syntax.​

08 You should now be able to flash super.img using the SPFlash tool.​