Installing a Custom Rom on the Xiaomi MiA1


Read the warning before Installing a Custom Rom on the Xiaomi MiA1

Warning: Installing or Flashing a Custom ROM voids the warranty of your smart phone. So unless you are sure you want to do this and have a basic idea of ROM and how to flash them on smart phones, there is a good chance you may brick your phone. Please proceed at your own risk.

Now that you have been warned and despite it if you would want to risk your sanity and the sanctity of your smart phone then read on…

Process to install a custom ROM on the Xiomi MiA1 has been updated. The process for a clean flash is as under

  1. Open up ADB on your PC. Steps to start or install ADB on your PC are given here.
  2. Check ADB is detecting your phone. There should be a number followed by devices. If it shows as unknown device or something else please read the instructions given here
  3. Remove phone lock if enabled on your phone- this could be a pattern or fingerprint. Set it to none under Settings >>Security & Privacy >> Screen lock
  4. At the command prompt type
    adb reboot bootloader
  5. This should take your phone into the boot loader mode.
  6. At the command prompt type
    fastboot devices
  7. When you see your device showing up type the following at the command prompt
    fastboot boot boot-recovery.img
  8. Wait for a few seconds your phone screen will display the TWRP main screen
  9. Go to the main menu, and tap Wipe.
  10. Now tap Format Data and continue with the formatting process. This will remove encryption as well as delete all files stored on the internal storage.
  11. Return to the previous menu and tap Advanced Wipe.
  12. Select the System partition to be wiped and then Swipe to Wipe.
  13. Place the LineageOS .zip package, as well as any other .zip packages on the root of /sdcard:
    • Using adb: adb push /sdcard/
    • You can use any method you are comfortable with. adb is universal across all devices, and works both in Android and recovery mode, providing USB debugging is enabled.
  14. Go back to return to main menu, then tap Install.
  15. Navigate to /sdcard, and select the LineageOS .zip package.
  16. Follow the on-screen prompts to install the package.
  17. Once the Lineage OS is installed install TWRP immediately.
  18. Reboot to recovery. This will take you to the TWRP recovery. This is an important step for the MiA1 as it has two partitions.
  19. Once you are in the TWRP push the other files using adb push commands to the same /sdcard/ folder
  20. You can push the Magisk, Open Gaps and Camera fix zip files. All the urls for all the files are given on this page.
  21. Install in the following sequence
  22. Magisk
  23. OpenGapps
  24. Reboot system

Wait for the phone to reboot. It will take a few minutes to start.

————————————Previous Article __________________

Files to Download before proceeding

  1. Custom ROM of your choice. I prefer the Lineage 15.1 Unofficial version downloadable from here

Please note this is the site of the XDA forum for MiA1. To read more details on XDA and the other ROM options available please scroll down.

  1. TWRP and recovery
    Download both the recovery image and the TWRP installer. Please check which version you are downloading as both the nougat and the Oreo version are available at the site. The choice will depend on which OS you have on your MiA1 currently. For e.g. if it is the Oreo 8.0 version from Xiaomi that you want to overwrite then download the oreo version of TWRP. Click here to download
  2. Google Platform Tools.

Once you have the files installed on your PC copy the recovery img downloaded in Step # 2 about and place it in this folder. Preferably on C Drive. To understand what exactly happens here read this article.
Google Platform Tools download urls




This is a suite of Google applications that will install the framework as well as google applications on your phone. Unless you plan not to use Google applications or do any downloads from google Play you will need a version of GApps as well.

I would recommend downloading the Aroma variant as it has a graphical interface where you can pick and choose which google applications to. For example, you can un select Gmail and Duo and the rest of the Google Apps will still work!

The other combinations to choose are Arm 64 and 8.1
All Variant under Arm64 and 8.1 work. PICO has the smallest size when it comes to downloads.

Gapps Url :

  1. Magisk .Download the latest version from here
  2. The fix for the camera. The stock camera tends to misbehave on custom ROM’s. Remember Xiaomi also provides its own camera along with the default ROM!

Download the Google_Cam_Fix_for_LineageOS_v1.0 from here.

Steps to install the ROM

  1. Copy all the above files in your download folder.
  2. Enable developer options if not already done. To read how to do it click here.
  3. Remove any Pattern or Fingerprint locks you may have set. You can do this from Settings >> Security & Privacy >> Device Security >> Screen Pattern set it to none. It will ask you for the pattern to confirm. Select None.
  4. Power Off your phone.
  5. Wait for a minute for the phone to completely power down.
  6. Now there are two options. If you are installing the custom ROM and TWRP for the first time, then you have to Press the power button and the Volume Down – button together.

To better explain what that mean – the volume button is a long button right? Now press the lower end of it along with the power button.

You should feel the phone vibrate in about 2-3 seconds. Let go of all the buttons.

  1. The phone will boot into the Fastboot screen. This image of a Chinese army hat wearing bunny should appear on your screen with the words Fastboot written all over.
  2. Connect your phone via the data cable to your PC. Open command prompt (CMD) and browse to the folder where you have the Google Platform Tools copied.
  3. If you have not unlocked your phone, then you would need to read this and perform these steps first
  4. On your PC open up the command prompt and type
    fastboot devices

This would show you an ID and a device. This is your phone showing up in the fastboot mode.

  1. Now type at the command prompt

fastboot boot recovery…img

where recovery.img is the name of the recovery file you have downloaded and copied in to the Google Platform tools folder.

  1. This will install the recovery image on your phone. Wait for 2-3 seconds and you will get a message saying success.
  2. The TWRP screen as visible to the right will show up.
  3. Swipe to factory reset
  4. Got to Wipe and clear out Data, dalvik,system
  5. Go to Install
  6. Flash ROM zip
  7. Go to Twrp reboot options and switch to another slot (ex. if you are on slot_a then switch to slot_b)
  8. REMEMBER DO NOT REBOOT AT THIS STAGE. You do not have an operating system on your phone and will end up with a bricked phone if you reboot now.
  9. Flash latest Twrp installer
  10. Reboot into Twrp recovery
  11. Flash latest Magisk
  12. Flash gapps zip (platform ARM64 + Android 8.1 + Variant (all gapps will work))
  13. Flash Camera…zip
  14. Reboot to system

Remember the first time it reboots it will take about 10-15 minutes. So have a cup of tea or at least leave the phone alone. Let the OS do its magic. Once it reboots the phone will ask you for the setup details.

Go ahead use a custom ROM and declare your independence!!!

To download the latest build unofficial Lineage build for the MiA1 click the links below:

Please note that you are downloading and installing the build at your own risk. I will not be responsible for your phone bricking up and also will not be able to support you in case of any issues.

On a personal note I have been using the same build on my daily driver for the last couple of days with no issues. I have GApps installed and am able to use some 46 apps with no issues including Twitter, Whatsapp, Quora, XDA, WordPress among others. The phone camera and fingerprint features are working normally.

Download Links


TWRP boot image :
Boot recovery image

TWRP Recovery Installer:

GApps Aroma 64bit ( please note all arm64 bit variant work,but i prefer Aroma as it gives me the option to select what I want to install. You can download the latest Gapps from here


Fix for the camera in case it does not work

Some important links: