Xiaomi Mi A1
Android One
Android
custom-fix
Mi A1
OTA
Fastboot
TWRP
In this article, you will find step-by-step instructions for all scenarios, from unlocking the bootloader to installing LineageOS or returning to stock firmware. We will also analyze typical errors (for example, Error 7 in TWRP or getting stuck on the Xiaomi logo) and give recommendations for choosing software. Importantly, the Mi A1 has a unique feature β its bootloader locks automatically after each flashing, so you will have to unlock it every time.
If you are a beginner, start with the official methods (sections 2β3). Power users can immediately jump to custom firmware installation (sections 4β6). Donβt forget to back up data β the flashing process erases all user files from internal memory!
1. Firmware preparation: Backup and unlock the bootloader
Before any firmware manipulations, you need to save important data and unlock the bootloader. Xiaomi Mi A1 uses a closed bootloader by default, so installing custom software is impossible without unlocking.
Step 1: Backup
Copy it to your PC or cloud:
- π Photos and videos (Folders DCIM, Pictures)
- π± Contacts (export via Google Contacts)
- π Logins and passwords (use Google Smart Lock or Bitwarden)
- π΅ Music and Documents (check Download, Documents folders)
β οΈ Warning: Fastboot or TWRP firmware formats the /data partition, removing all user files, including installed applications and their data (e.g., saves in games).
Step 2: Unlocking the Xiaomi bootloader requires official permission to unlock.
- Link your Mi Account to your device: Settings β Xiaomi account.
- Activate Developer Options: Go to Settings β About Phone and click on the Build Number 7 times.
- Enable USB Debugging and OEM Unlocking in Settings β For Developers.
- Connect your phone to your PC, install ADB/Fastboot Tools, and execute the command: fastboot oem unlock
Once confirmed on the phone screen, the bootloader will be unlocked. Note: this will reset the device to factory settings!
Is Mi Account connected to phone | USB | Installed ADB drivers on PC | At least 60% charged | All important data is saved-->
2.Official firmware methods: OTA and Mi Flash Tool
If you don't need custom firmware, start with the official methods. They're safe and don't require unlocking the bootloader (except in downgrad cases).
Method 1: Air Update (OTA) Mi A1 supports updates via Settings β System β System Update. However, since 2020, official updates have stopped. If you are offered an upgrade to Android 9 Pie (the latest official version), follow the instructions on the screen.
- π All data and settings are stored.
- π‘οΈ Minimum risk of "bricking."
- π± No PC required.
Method 2: Firmware with the Mi Flash Tool
If OTA is not available or you need to reinstall the stock firmware:
- Download the official firmware for the Mi A1 (select the Fastboot version).
- Unpack the archive into a folder without Cyrillic characters (e.g., C:\MiA1\).
- Install the Mi Flash Tool and connect the phone in Fastboot mode (clip Volume Down + Power).
- In the program, select a firmware folder and press Refresh, then Flash.
Choose Clean all or Clean all and lock mode, the second option is recommended if you plan to sell the phone.
What if the Mi Flash Tool canβt see the device?
3. Installation of custom TWRP Recovery
TWRP (Team Win Recovery Project) is an alternative recovery that allows you to install custom firmware, make backups and restore the system. For the Mi A1, there is a special version of TWRP 3.6.2, adapted for Android One.
Installation instructions:
- Download the latest version of TWRP for Mi A1 (.img file).
- Move the file to the platform-tools folder and rename it to twrp.img.
- Connect your phone in Fastboot mode and execute the command: fastboot flash recovery twrp.img
- Immediately after that, go to the recap, holding Volume up + Nutrition (otherwise, the stock recap will overwrite TWRP).
Features of the TWRP for the Mi A1:
- π§ Supports F2FS and ext4 for the /data partition.
- π± Has a touchscreen interface (finger control).
- β οΈ The /data encryption doesnβt work β youβll have to format the partition when you install the firmware.
β οΈ Warning: Once installed, the TWRP stock recavator will automatically recover when rebooted. To avoid this, immediately after firmware TWRP follow the command: fastboot flash boot twrp.img This will replace the boot image, but may result in a bootloop ( looped reboot) if you do not plan to install custom software.
4. Custom firmware choice: MIUI vs Android One vs LineageOS
Once you have TWRP installed, you can choose between three types of firmware, each with pros and cons:
| Type of firmware | Advantages | Deficiencies | Recommended version |
|---|---|---|---|
| Official MIUI | Stability, OTG support, optimization for iron | Closed source, advertising, no Android 10+ | MIUI 12.5 (Android 9) |
| Android One (Stock) | Clean Android, Quick Updates (previously) | Outdated version (maximum Android 9), no customization | Android 9 Pie (OPM7.181205.001) |
| LineageOS | Android 11/12, open source, no Bloatware | There may be camera bugs or Wi-Fi, there are no Google Apps by default | LineageOS 18.1 (Android 11) |
| Pixel Experience | Interface like Google Pixel, Android 12 | Less optimization for Mi A1, possible lags | Pixel Experience Plus (Android 12) |
How do you choose?
- π± If you want the most stable option, stay on the stock Android One or MIUI.
- π If newer versions of Android are important, go with LineageOS or Pixel Experience.
- π― If you want customization (themes, gestures) try MIUI with patches or Havoc-OS.
π‘
Before installing custom firmware, check the reviews on the XDA-Developers forum. Pay attention to camera bugs (the dual module on the Mi A1 often works incorrectly) and the NFC module (if you use contactless payments).
5. Step-by-step installation of custom firmware through TWRP
The custom software installation process consists of 5 steps. Don't miss any! Any mistake at any step can lead to a brick.
Step 1: Preparing files
Download to your phone (in internal memory or SD- card):
- π¦ Firmware (e.g. lineage-18.1-20230510-nightly-tissot-signed.zip).
- π€ Google Apps (open_gapps-arm-11.0-nano-20230510.zip β choose the nano or pico version).
- π Magisk (optional, for root rights: Magisk-v25.2.zip).
Step 2: Cleaning the sections
In TWRP, do:
- Wipe β Advanced Wipe.
- Check the boxes: Dalvik / ART Cache, System, Data, Cache.
- Swipe for confirmation.
β οΈ Warning: If you are installing Android 10+-based firmware and you were previously running Android 9, make sure to change the /data partition file system to F2FS (in TWRP: Wipe β Format Data β F2FS).
Step 3: Install firmware and GApps
- Return to the main TWRP menu and click Install.
- Select the firmware file and swipe for installation.
- Repeat the step for GApps (if you need Google services).
- If you install Magisk, add it to the queue after the firmware.
Step 4: First download
After installation:
- Press Reboot System.
- The first download will take 5-15 minutes β do not interrupt the process!
- If the phone has been stuck on the logo for more than 20 minutes, go back to TWRP and repeat the steps (the firmware may not be compatible with your bootloader version).
π‘
If you don't have a network after the firmware (IMEI is gone), go back to TWRP and run the modem.img file from stock firmware. This is a common problem when switching from MIUI to Android One or custom firmware.
Typical errors and their solution
Even with the correct instructions, there can be problems, and here are the most common ways to correct them:
Error 1: Error 7 in TWRP
Reason: The firmware is not compatible with the current version of Android or the device model.
Decision:
- Check that you downloaded the firmware for Mi A1 (codename - tissot).
- If you are switching from Android 8 to Android 11, install the middle firmware (such as Android 9) first.
- Open the updater-script file in the firmware archive and delete the line with the model verification (if you are sure of compatibility).
Error 2: Phone not turned on (black screen)
Reasons:
- Improperly sewn boot.img.
- Damaged section of EFS (responsible for IMEI)
- Failure to format /data.
Decision:
- Try booting up to Fastboot (Loudness Down + Power) and running the stock firmware through the Mi Flash Tool.
- If it doesnβt work, check the EFS with the Xiaomi EFS Tools tool.
Error 3: No network (IMEI missing)
Cause: Damage to the modem or EFS partition when running firmware.
Decision:
- Return to TWRP and swipe modem.img from stock firmware.
- If IMEI is reset on 0, restore it using the QCN- file (backup required).
How to make an IMEI backup before firmware?
7. rollback to stock firmware and locking the loader
If custom firmware is unstable or you plan to sell your phone, go back to the stockware.
Step 1: Download the official firmware
Select the version on the Xiaomi or Xiaomi Firmware Updater website. For Mi A1, the following are relevant:
- Android One (Pure Android) β if you want the original system.
- MIUI Global Stable β if you need Xiaomi features (themes, dual applications).
Step 2: Fastboot through the Fastboot
Use the Mi Flash Tool (instruction in Section 2). Select Clean all and lock mode to:
- Return the stock recap.
- Lock the loader (important for security).
- Remove all traces of custom software.
Step 3: System inspection
After the firmware:
- Restart your phone and wait for the first setup.
- Check the IMEI in Settings β About Phone β Status.
- Update the system via OTA if updates are available.
β οΈ Warning: If you block the bootloader on custom firmware (not stock), the phone won't turn on. First, go back to the official software!