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

Search This thread

krispuniq

Senior Member
Oct 21, 2008
533
71
Birmingham
Generally speaking, all the GSIs ROMs are based on Phhusson AOSP GSI ROM, so they have more or less the same performance and bugs.

At he moment FOD is not working well. You cannot unblock the device while on screen off or while on AOD.

For camera, you can install BSG Google Camera mod, that is working quite good.
Thanks for your feedback mate.. I will have to hold on until atleast dtw gets working so it's easier to unlock!

I just hate this miui coming from oneplus!

Sent from my Mi 9 SE using Tapatalk
 

Humpfrey

Senior Member
Jan 18, 2013
93
27
Hey guys,

I'm into trying a stock-like ROM on my Mi9SE Global. I just want to get some things cleared to avoid bricking my phone.

Currently I'm on xiaomi.eu 9.6.20 beta, bootloader unlocked, using TWRP 3.3.1-2. I've checked for ARB and got a "1".

So to be clear, it's recommended to first flash the stable global miui Rom and go on from there. To not brick my phone at this point I've to check if the ARB status of this stable Rom is at least a "1' or higher?

And if I'd like to go back to miui, the Rom to flash has to have at least the ARB status of the stable miui Rom I've flashed before..?


In case for the GSI ROMs I don't have to worry about anything about ARB, this is just concerning miui/xiaomi.eu Roms?

Thanks OP for your afford in keeping this structured and giving us a guide to flash gsi.

Cheers

Gesendet von meinem Mi 9 SE mit Tapatalk
 

raber111

Senior Member
Aug 25, 2013
281
36
Havoc rom working fine over xiaomi.eu . I tried it ... But first is better to flash official rom

Отправлено с моего Mi 9 SE через Tapatalk
 

Hijacks

Senior Member
Jul 21, 2008
88
28
Did somebody managed to get Havoc OS 2019-06-25 booting. It bootloops to TWRP. I tried clean flash and dirty flash over 2019-06-12 but everytime bootloop.
With version 2019-06-12 it boots normal.
 
Last edited:
  • Like
Reactions: moorware

pbjr92

Member
Mar 15, 2014
43
9
Porto Alegre
I have a problem. The command "--disable-verity" is not working. It's showing this message: "fastboot: unrecognized option `--disable-verity'".
I'm using macOS, so I can't use the ADB posted here.

EDIT¹: Just updated to latest Android SDK Platform Tools available (https://developer.android.com/studio/releases/platform-tools.html) and the command is still not working.
EDIT²: macOS was a no-go for me. Thankfully I had an old Windows laptop in here and everything is working fine now.
 
Last edited:

Atlantisway

Member
Aug 23, 2019
5
1
Today I had some time and I tried to install the latest Havoc Gsi, unfortunately the result was negative, I ran the guide both from xda and from here, my basic rom was 10.2.3.0, arrived at the command fastboot -w performs the various wipes, but then it does not allow me to go into recovery, it always and only goes in fastboot, and the only way to make the smartphone work is to use miflash and put the official version back.


I'm in the same boat as you. I cant find a proper working version of TWRP for the 9SE yet.

Keeping getting into a boot loop or fastboot loop.

What ROM's are stable on the 9SE as well?
 

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