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

Search This thread

afylioe

Member
Aug 9, 2013
11
2
Sorry, I'm a bit new to this one. I have already unlocked my bootloader but I am not sure which TWRP to install. Can you link me the one you are using for Mi 9 SE? I'm currently on the latest stock MIUI Global 11.0.4
 

Flounderist

Senior Member
Jan 7, 2016
836
407
Cork
Sorry, I'm a bit new to this one. I have already unlocked my bootloader but I am not sure which TWRP to install. Can you link me the one you are using for Mi 9 SE? I'm currently on the latest stock MIUI Global 11.0.4
Redispade build 3.3.11 is the most up to date
You will find it easily in the forum.
 

afylioe

Member
Aug 9, 2013
11
2
Redispade build 3.3.11 is the most up to date
You will find it easily in the forum.

Thank you. I was able to successfully installed TWRP using your instructions and was able to boot on it and made a backup of my current ROM. However, after rebooting my phone and trying to boot back to TWRP by pressing power button + volume up, it's now showing the default from Xiaomi (one that says wipe data / reboot / connect to mi account) and not going back to TWRP.

Already tried restarting my phone and tried different key combinations such as power button + vol up button / Power Button + vol up + vol down button but none of these worked. Seems like I am not able to boot back to TWRP
 

lordnils

Member
Aug 3, 2010
32
4
Hey guys,

I'm lost here. Shouldn't the Fingerprint-Sensor be working with GSI roms? Am I missing something important?

What happens is that the screen turns dark and the green spot lights up, in ADB I get messages about this (see log at the end) but the touch is never recognized while setting up the fingerprint. It worked with latest stock rom ("grus_global_images_V11.0.4.0.PFBMIXM_20191023.0000.00_9.0_global") but it doesn't with Lineage 16 and Lineage 17. I tried to setup crDroid but ended bootlooping so I flashed stock again, tried again and it worked, then flashed Lineage 17 again and it didn't work.

Is there any setting I am missing? Or is there some info on this I didn't see? I tried reading a lot but couldn't find much about FPS problems with this device. :crying:

I'd appreciate any hints! Thank you!


edit: I forgot to mention this was all also tested without GApps and Magisk, just plain Lineage.



Code:
01-07 18:05:36.461  1401  1401 D PHH-Enroll: Got action 2, x = 118.90466, y = 178.90454, inside = true/true
01-07 18:05:36.477  1401  1401 D PHH-Enroll: Got action 2, x = 119.90411, y = 182.8081, inside = true/true
01-07 18:05:36.494  1401  1401 D PHH-Enroll: Got action 2, x = 121.89032, y = 185.89038, inside = true/false
01-07 18:05:36.502  1401  1401 D PHH-Enroll: Drawing at 448, 1938, 185, 185
01-07 18:05:36.503  1227  1227 I [GF_HAL]: [goodix_extCmd]receive MIUI cmd=10, param=0
01-07 18:05:36.503  1227  1227 I [GF_HAL]: [goodix_extCmd]HBM or Green Spot vanished
01-07 18:05:36.513  1401  1401 D PHH-Enroll: Got action 2, x = 122.86597, y = 188.73193, inside = false/false
01-07 18:05:36.527  1401  1401 D PHH-Enroll: Got action 2, x = 123.0, y = 190.84155, inside = false/false
01-07 18:05:36.544  1401  1401 D PHH-Enroll: Got action 2, x = 123.0, y = 191.90015, inside = false/false
01-07 18:05:36.561  1401  1401 D PHH-Enroll: Got action 2, x = 123.0, y = 192.88892, inside = false/false
01-07 18:05:36.577  1401  1401 D PHH-Enroll: Got action 2, x = 123.0, y = 193.47559, inside = false/false
01-07 18:05:36.611  1401  1401 D PHH-Enroll: Got action 2, x = 123.0, y = 194.86938, inside = false/false
01-07 18:05:36.627  1401  1401 D PHH-Enroll: Got action 2, x = 123.0, y = 196.71631, inside = false/false
01-07 18:05:36.635   912   985 D DisplayFeatureHal: isStartSensorControl ret 0
01-07 18:05:36.635   912   985 D DisplayFeatureHal: HandleHBM enter
01-07 18:05:36.635   912   985 D DisplayFeatureHal: HandleHBM exit ret=-1 enable:0
01-07 18:05:36.637  1229  1229 I libsensor_ssccalapi: send_phycial_sensor_config_msg for sensor: ambient_light
01-07 18:05:36.644  1401  1401 D PHH-Enroll: Got action 2, x = 124.0, y = 199.67627, inside = false/false
01-07 18:05:36.661  1401  1401 D PHH-Enroll: Got action 2, x = 125.0, y = 201.67334, inside = false/false
01-07 18:05:36.677  1401  1401 D PHH-Enroll: Got action 2, x = 126.0, y = 203.64624, inside = false/false
01-07 18:05:36.694  1401  1401 D PHH-Enroll: Got action 2, x = 127.0, y = 205.62231, inside = false/false
01-07 18:05:36.710  1401  1401 D PHH-Enroll: Got action 2, x = 127.59094, y = 208.59106, inside = false/false
01-07 18:05:36.727  1401  1401 D PHH-Enroll: Got action 2, x = 129.5, y = 210.5, inside = false/false
01-07 18:05:36.744  1401  1401 D PHH-Enroll: Got action 2, x = 130.0, y = 211.55396, inside = false/false
01-07 18:05:36.761  1401  1401 D PHH-Enroll: Got action 2, x = 131.52539, y = 213.0, inside = false/false
01-07 18:05:36.777  1401  1401 D PHH-Enroll: Got action 2, x = 133.48346, y = 214.4834, inside = false/false
01-07 18:05:36.794  1401  1401 D PHH-Enroll: Got action 2, x = 134.23578, y = 215.23584, inside = false/false
01-07 18:05:36.843  1401  1401 D PHH-Enroll: Got action 2, x = 135.0, y = 215.0, inside = false/false
01-07 18:05:36.844  1401  1401 D PHH-Enroll: Got action 1, x = 135.0, y = 215.0, inside = false/false
01-07 18:05:37.960  1401  1401 D PHH-Enroll: Got action 0, x = 99.0, y = 120.0, inside = false/true
01-07 18:05:37.985  1401  1401 D PHH-Enroll: Drawing at 448, 1938, 185, 185
01-07 18:05:37.573  1229  1229 I chatty  : uid=1000(system) citsensorservic identical 13 lines
01-07 18:05:38.002  1229  1229 I libsensor_ssccalapi: send_phycial_sensor_config_msg for sensor: ambient_light
01-07 18:05:38.046  1227  1227 I [GF_HAL]: [goodix_extCmd]receive MIUI cmd=10, param=3
01-07 18:05:38.046  1227  1227 I [GF_HAL]: [goodix_extCmd] HBM and Green spot ready
01-07 18:05:38.058  1229  1229 I libsensor_ssccalapi: send_phycial_sensor_config_msg for sensor: ambient_light
01-07 18:05:38.244  1401  1401 D PHH-Enroll: Got action 2, x = 98.0, y = 119.0, inside = true/true
01-07 18:05:38.260  1401  1401 D PHH-Enroll: Got action 2, x = 94.53894, y = 117.76953, inside = true/true
01-07 18:05:38.277  1401  1401 D PHH-Enroll: Got action 2, x = 92.81799, y = 116.818115, inside = true/true
01-07 18:05:38.294  1401  1401 D PHH-Enroll: Got action 2, x = 90.87836, y = 114.87842, inside = true/true
 
Last edited:

Flounderist

Senior Member
Jan 7, 2016
836
407
Cork
@lordnils I can't find any point in flashing GSI ROM at this stage.
Apart ROM posted on XDA, there is plenty of custom ROM based on P or Q firmware that are working very well.
If you use telegram, just make some search.
 

lordnils

Member
Aug 3, 2010
32
4
@lordnils I can't find any point in flashing GSI ROM at this stage.
Apart ROM posted on XDA, there is plenty of custom ROM based on P or Q firmware that are working very well.
If you use telegram, just make some search.


My main concern with any ROMs from out there was my safety. I think ROMs posted by renowned developers on XDA are more trustworthy than any other sources (except official Lineage website maybe) so I wanted to use a ROM from here. And then I thought maybe GSI ROMs are the way to go from now on since they should be easier to maintain.



Which ROM seems the most trustworthy to you?


EDIT: For anyone else having trouble with the FPS (FOD - Fingerprint On Display??), I found a few issues on https://github.com/phhusson/treble_experimentations/issues that suggest it's a more general problem with the Mi 9 SE and project Treble, not only Lineage. Especially this one where someone already provided logs and system images: https://github.com/phhusson/treble_experimentations/issues/859
 
Last edited:

Flounderist

Senior Member
Jan 7, 2016
836
407
Cork
Which ROM seems the most trustworthy to you?

I am using CrDroid 6.1 Q build and so far everything is fine.
Dig in Telegram and you will find some very good unofficial LOS16 and LOS17, plus Pie Bootleggers and Q BlissROM.
Sadly, none of those ROM are posted on XDA (except a 4PDA mirror for Bliss).

The FP issue is well known since ages. I used FlokoROM GSI before moving to CrDroid and it had FP working on screen on because it was built with some optimizations for Mi9 and Mi9SE.
You can try that one, if you want to stick with GSIs, but keep in mind that the development stopped a long time ago.
You will find info and builds here: https://treble.andro.plus/
 

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