[Xiaomi Mi A2 Lite Guides, News, & Discussion] user-001:
FINALLY! FLASHING CUSTOM ROM​

STEP 0

Flash(if not flashed already) the stock base recommended by particular ROM, if the ROM doesn't recommend a specific stock base flash 10.0.18.0 from the above instructions.

PREREQUISITES

TWRP or ORANGE FOX RECOVERY

Fastboot drivers and platform tools (details above )

The ROM which you want to flash, choose from here

GAPPS package if rom is vanilla and you want to install it.

Magisk if you want to root.

As you may have known by experience, our device doesn't have recovery partition so, flashing recovery through fastboot isn't possible. For flashing recovery first we need to boot recovery image and then only we can flash it.

If you want to use twrp:

Download both twrp*.zip and twrp*.img and place it in a convenient place.

If you want to use orange fox recovery:

Download orangeFox*.zip and extract it.

Keep both the .zip and .img file in convenient place.

If you have sdcard then copy ROM file, gapps, magisk, twrp or orange fox files into sdcard.

If not then there will be further instructions.

Now, connect the phone to the PC via USB and enable usb debugging. And open terminal in the platform tools folder as in above instructions.

Check device connectivity:

adb devices

Reboot into fastboot:

adb reboot bootloader

Check device connectivity:

fastboot devices

Lets check if the bootloader is unlocked:

fastboot oem device-info

If bootloader isn't unlocked you won't be able to flash custom recovery into the device. So, first unlock the bootloader. This should be allowed in the developers option of your phone first. This will factory reset the device.

fastboot oem unlock

Now if everything is good then it's time to boot into custom recovery:

fastboot boot recovery.img

recover.img is name of image of whichever custom recovery you want to use.

fastboot boot '/media/user001/storage (1)/daisy/twrp/twrp-3.5.2_9-2-daisy-unofficial.img'

It's like this in my case. You can drag and drop after typing fastboot boot

The phone should now boot into custom recovery. If it ask for decryption then your lockscreen password should work there.

if you want to flash recovery only then find the recovery.zip you want and flash it.

The steps further is also valid for moving between different custom roms. The term used for such process is CLEAN FLASH.

For Flashing custom ROMS :

SOMETIMES FLASHING INSTRUCTIONS MAY DIFFER SO, BE SURE TO CROSS CHECK FOR INSTRUCTION IN ROM SPECIFIC XDA THREAD OR TELEGRAM GROUP

The following action will wipe userdata if not wiped already. Be sure to backup data before these steps. Also if you encounter any future problems full backup from custom recovery may be able to solve most of the problems. So, be sure to keep full backup(including every partition) of your device.

Go to main menu > wipe > select all except internal storage and microSD.

Swipe right to perform wipe.

Install custom recovery by flashing recovery.zip

(This is done in case adb push doesn't work below and sdcard isn't available for flashing)

Again go to main menu > wipe > format data

Type yes and press enter.

If you don't have files in your sdcard then:

push rom file + gapps + other files into your device through adb push.

The command will be something like this:

adb push '/media/user001/storage (1)/daisy/posp/potato_daisy-11-20210919-dumaloo.v4.2.3+20.Community.zip' /sdcard

If adb push fails to work then you can reboot recovery and simply copy the files through file explorer.

Reboot to recovery only if you had installed recovery after wiping system else the device will soft brick

Now flash the rom.zip by selecting the file and swiping right.

Flash custom recovery if the ROM doesn't contain recovery

We have to change current slot even if we don't want to flash anymore things.

Latest recoveries changes slot automatically So, go to main menu > reboot > recovery

Now flash files which you want to flash i.e. gapps and magisk.

Again, Don't flash gapps if the ROM is of Gapps variant

Most of the roms now have implemented FBE (File Based Encryption ). So, you need to format data before rebooting to system. Again, check for specific ROM installation instruction if that is required or not. If you keep data from previous ROM that won't be considered a clean flash so, for proper clean flash format data before rebooting to system.

reboot system