I just got the Xiaomi A2 Lite. A big upside of the phone is that it is part of the Android One program, which means it should be very easy to install custom ROMs.
I just wanted to document my process of getting a Google-free version of Android up and running on the phone. There are many guides out there on various websites and on the XDA forums, but I kept running into issues no matter which one I tried.
The usual steps
The guides generally follow these steps:
- Erase the (active) system partition:
fastboot erase system
- Flash the GSI ROM:
fastboot flash whatever_system.img
- Do a “factory reset”, wiping all user data:
You may also find people telling you that you should not erase the system before flashing. Another common piece of advice when it is not working is to erase and reformat user data from recovery (which is easily done in TWRP). I could not get any combination of these steps working for me. The phone would either boot up to the Android loading screen and then never make it past it, or it would get stuck in a bootloop before ever getting there.
What worked for me
My end goal was to get a usable OS that had zero Google crap. Github user
phhusson kindly maintains and builds several versions of AOSP images all located here. The image that ended up working for me was the 8.1 image with root and FLOSS apps preinstalled.
The missing piece was to flash the
userdata partition after the system image was flashed. I discovered this modifying the script and images that MIUI provides for the A2 Lite.