Xiaomi Mi A1 is the first Android smartphone released under the Android One program BY the company. Unlike other Xiaomi phones, unlocking bootloader on Mi A1 is a simple process. All you need a PC with ADB and Fastboot drivers installed.
Usually, unlocking the bootloader will wipe files and data on the phone, but a bug in Mi A1 allows unlocking its bootloader without wiping the userdata. Below is how to unlock Mi A1 bootloader without wiping data.
Xiaomi may fix the bootloader unlock bug on Mi A1 in a future update, however, many users have confirmed that it worked even with the latest Android 8.1 Oreo Beta build (OPM1.171019.019.V184.108.40.206.ODHMIFE). All you need to follow the below procedure.
Warning: Keep in mind that bootloader is a security feature of the device, so do not proceed unless you have a specific reason for unlocking the bootloader. This process will void device’s warranty.
Unlock Xiaomi Mi A1 Bootloader without Wiping Data
1. Enable USB debugging and OEM Unlock (To do so, go to Settings > About Phone > tap Build number 7 times. Now, go to Settings > Developers Options > Enable USB debugging & OEM Unlock)
2. Connect your phone to your PC via USB Type-C cable. Then go to the ADB installation directory and issue the command ‘
adb reboot bootloader’.
3. Now, type the command ‘
fastboot oem unlock’ and hit enter. After you hit enter, immediately press Volume Down button.
4. This process will stop the boot process to start (MI logo, splash screen), which trigger userdata wipe.
A big thanks to the XDA user IjazCI for the tip. Note that Xiaomi may fix this bug in a future update.