[GUIDE][GRUS]How to flash TWRP and GSI ROMs on MI 9 SE

Search This thread

woohookjs

New member
Apr 15, 2020
3
0
Lineage OS is available as full ROM for Mi9SE, there is no need to use a GSI. Just make a search on Telegram, if you use it. :cowboy:

Thank you very much. I'm going to download Telegram soon.

---------- Post added at 05:16 AM ---------- Previous post was at 05:13 AM ----------

Lineage OS is available as full ROM for Mi9SE, there is no need to use a GSI. Just make a search on Telegram, if you use it. :cowboy:

By the way, is there a guide to install a full ROM for Mi9SE as simple as your GSI guide? Many thanks.
 

Flounderist

Senior Member
Jan 7, 2016
836
407
Cork
By the way, is there a guide to install a full ROM for Mi9SE as simple as your GSI guide? Many thanks.
Flashing the ROM is very simple as well.
Once you flashed a custom recovery and you disabled vbmeta, just wipe system, vendor and data partitions then flash ROM and gapps, if needed.
Edit: cancel any lock screen (pin, sequence or fingerprint) before starting to avoid any encryption issue.
 
Last edited:

hit321

Member
Mar 28, 2012
9
2
PoA
Xiaomi Mi 9 SE
Lineage OS is available as full ROM for Mi9SE, there is no need to use a GSI. Just make a search on Telegram, if you use it. :cowboy:
What's the benefit of a full ROM to a GSI?
Flashing the ROM is very simple as well.
Once you flashed a custom recovery and you disabled vbmeta, just wipe system, vendor and data partitions then flash ROM and gapps, if needed.
Edit: cancel any lock screen (pin, sequence or fingerprint) before starting to avoid any encryption issue.
I got a lot of flashboot loops because I did wipe system and vendor (without disabling vbmeta). So, why are you suggestion that? There's a difference wiping or not wiping the system and vendor from TWRP?
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    # I assume you are confident with ADB and Fastboot commands and you know what you are doing. :D #
    # If you don't, search on Google before messing with your device. #
    # I am not responsible for...you know what I mean. On the other hand, please feel free to point out any error in this guide. #
    # Lots of useful information can be found on Telegram Group for Mi 9 SE #

    # If you already unlocked your bootloader and flashed TWRP, go directly to part 2 of this guide #

    PART 1 - UNLOCK DEVICE AND FLASH TWRP

    # Before starting, be sure that you can unlock your bootloader and you have these files: #​

    - Mi Unlock tool (http://en.miui.com/unlock/)
    - Minimal ADB & Fastboot 1.4.3 (https://forum.xda-developers.com/showthread.php?t=2317790)
    - TWRP recovery for your device (please check the development section).
    Install ADB and Fastboot drivers on your PC, if you don't have them already.

    - enable developer options on device, allow OEM unlock and ADB debug.
    - install Minimal ADB & Fastboot tool and run a command window. PLEASE DON'T USE WINDOWS 10 POWER SHELL. Double click on "cmdhere.dll" in root folder instead.
    - move twrp image in the same folder where Minimal ADB & Fastboot is installed.
    - for your convenience, rename twrp file as "twrp" only.
    - connect your device to your PC USB port, pair it with PC then reboot it to bootloader (power + volume down combo).

    Unlock bootloader using Mi Unlock tool (full unlocking guide at https://c.mi.com/thread-1635834-1-1.html)
    Unlocking bootloader will erase all of your data, including storage.
    Once you unlocked:

    - reboot and setup device
    - enable developer options again
    - double check bootloader status and allow ADB debug
    - connect to USB port and pair device with PC for ADB debug bridge then type in command window:
    Code:
    adb devices
    Code:
    adb reboot bootloader
    once in bootloader screen code:
    Code:
    fastboot devices
    Code:
    fastboot flash recovery twrp.img
    - don't give fastboot command "fastboot boot recovery twrp" or "fastboot reboot recovery twrp". Just press and hold power+volume up for about 10 seconds to reboot to recovery.
    - swipe to allow twrp modifications.
    - I would suggest to NOT format data to get rid of encryption unless you actually need it. Encryption does not slow down your device or harm your battery life.
    - I would also suggest to NOT wipe system and reboot to recovery because it could lead to a fastboot bootloop.
    8
    PART 2 - HOW TO FLASH A GSI ROM​

    # IMPORTANT #

    When flashing a GSI ROM, it is recommended to use a Stable firmware as base.
    If device is running different builds, flash latest Global or China Stable before starting using MiFlash tool.
    Beware that device could have the anti-rollback enabled, so be careful when flashing another firmware.

    Mi 9 SE is a system-as-root device, so you must flash A/B type GSI ROMs.

    You will need these files:

    - GSI A/B ROM (FlokoROM at https://treble.andro.plus/ or choose one at https://forum.xda-developers.com/project-treble/trebleenabled-device-development)
    - vbmeta.img (https://androidfilehost.com/?fid=818070582850505317)
    - gapps for Google services (https://opengapps.org/) - select ARM64 - 9.0 - I would suggest nano or pico package.
    - magisk for root and modules (https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445)
    - MiFlash flashable STABLE stock firmware (http://en.miui.com/download or https://mirom.ezbox.idv.tw/en/phone/grus/)
    - MiFlash tool (https://www.xiaomiflash.com/)

    If you are already running a Stable firmware start from here, if you don't, flash a Stable firmware.

    - move GSI and vbmeta images in the same folder where Minimal ADB & Fastboot is installed.
    - for your convenience, rename GSI file as "system" only.
    - reboot device to bootloader, ensure you are connected with your PC properly
    - to double check it, run a command window and type:
    Code:
    fastboot devices

    once you get the device recognized type:
    Code:
    fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
    this command will disable dm-verity and AVB on device. PLEASE DON'T USE WINDOWS 10 POWER SHELL to disable vbmeta or you will get an error feedback. Double click on "cmdhere.dll" in root folder instead.
    then:
    Code:
    fastboot flash system system.img
    this command will flash system.img
    Code:
    fastboot -w
    this command will wipe data on device

    Reboot your device in recovery using button combo and resize system partition to install Gapps.
    From TWRP Wipe menu > advanced wipe > system > repair or change file system > resize system > swipe to resize

    - move magisk and gapps from PC to device
    - go to mount menu and tick mount system
    - go back to install menu and flash gapps
    - once you flashed gapps unmount system
    - go to install and flash magisk
    - go to wipe menu and swipe for factory reset
    - reboot

    once rebooted, complete the device setup.

    be aware that some GSI could bootloop or not boot at all even if you followed the guide properly.
    in case rely on GSI devs for assistance or fixes.
    3
    Of course you can flash a GSI ROM using TWRP.
    The only fastboot command you need to perform is to disable dm-verity and AVB.
    If you already disabled it while flashing TWRP for the first time, you can follow these steps to flash a GSI using TWRP:
    - Tap on advanced Wipe menu and wipe cache, dalvik, data and system
    - Tap on Install > Install Image > select image and flash it to system
    - Install Gapps with the same process shown above.
    - Swipe for factory reset and reboot.

    -----------------------------------------------------------------------------------------------------------------------------------------------

    If updating GSIs builds from the same branch (e.g. Floko 060219 to Floko 060919) you are not required to wipe data. You can update flashing system.img on TWRP and Gapps time by time.
    If you are moving from unofficial builds to official, or if you are moving between branches (e.g. Floko to Havoc), you need to wipe data as well.
    2
    What do I have to do if I just want to install magisk?
    Just flash Magisk zip in twrp :laugh:
    2
    Great guide. It will help a lot of people to flash and test roms. And us by extension to find the best rom for our device :p !
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