How to Find Xiaomi Rollback Index and Avoid ARB Bricks

Avoid Tripping Anti-Rollback Protection in Xiaomi Devices

Because Google has made it mandatory that all devices carrying Android Pie have built-in “Anti-Rollback Protection”, and it hasn’t become widely known yet, many people have been hard bricking their Xiaomi devices (and possibly other brand’s devices, but Xiaomi is particularly popular amongst the Android modding community).

What’s basically happening is that Xiaomi pushed out MIUI 10 Global Beta 8.7.5 for a handful of Xiaomi devices – however, this update contained anti-rollback protection. What ARB means is that you cannot rollback to a previous MIUI version or any ROM containing a previous Android version! It is impossible, and if you try, you will hardbrick your device and render it utterly useless.

There is currently no way whatsoever to fix or restore a device that has been bricked due to anti-rollback protection. You cannot restore a TWRP backup, flash a new ROM, or use MiFlash to restore a factory image. Once ARB has been tripped, the only method to recover the device is to either use EDL mode (which requires an authorized Xiaomi account), or bringing it to an authorized service center.

Why has Xiaomi included anti-rollback protection in their MIUI?

This isn’t necessarily Xiaomi’s fault – as we said above, this is a new mandatory Google policy for Android device manufacturers that will use the latest Android 9 Pie – so this ARB will actually be affecting every device out there that will use an Android 9 Pie based ROM.

However, Xiaomi is one of the very few Android phone companies that offer bootloader unlocking, and offer some kind of support to the modding and development community, hence why many Xiaomi users are suddenly surprised.

ARB is basically a new method of preventing phone thieves from flashing unofficial ROMs on stolen devices and re-selling them, or preventing shady retailers from importing phones that are typically only available in China, and flashing unofficial “global” ROMs on them. So basically, because future Xiaomi devices will be running official “MIUI China” based on Android Pie 9, shady retailers will not be able to flash “Global MIUI” running Android 7 Nougat and sell them.

What Happened to EDL Authorization?

So in the past, if you did something really bad to a Xiaomi or other Qualcomm SoC device, you could get into EDL (Emergency Download Mode), which is an alternative boot-mode for all Qualcomm devices that can be used to unbrick a device.

However, Xiaomi and other companies began to lock down the EDL mode, so only service centers have access to it. Thus, EDL can no longer be used to unbrick a Xiaomi device that was bricked due to ARB – which again, prevents shady retailers and thieves from recovering devices they accidentally bricked by flashing unofficial ROMs on imported devices.

Basically, Xiaomi doesn’t want consumers buying Chinese versions of their hardware with Global ROMs installed, so they did two things: Made it impossible to boot a Global ROM if the device isn’t a Global version (with the warning message “This MIUI can’t be installed on this device”), and made it so EDL mode can’t be used unless you have an authorized Mi account.

Xiaomi screen after ARB was triggered.

The biggest difference between Google’s implementation of ARB compared to Xiaomi’s, is that Xiaomi took it a step further. Google’s ARB (which is a feature of Android Verified Boot 2.0) can be disabled if you unlock the bootloader, whereas Xiaomi’s ARB can’t be disabled, even with an unlocked bootloader.

Here is a list of Xiaomi devices with ARB enabled (click image to enlarge):

Current list of Xiaomi devices and ROMs with anti-rollback protection.

How to check for Anti-Rollback Protection

If you want to be absolutely sure if ARB is enabled on your device before flashing a custom ROM, you can check the rollback index. A quick explanation of rollback index:

  • If the current rollback index is less than the rollback index in the images to be flashed, then the images will be flashed and the current rollback index will be incremented to match the new rollback index.
  • If the current rollback index is equal to the rollback index in the images to be flashed, then the images will be flashed and the rollback index won’t change.
  • If the current rollback index is greater than the rollback index in the images to be flashed, then the images will be rejected if you’re flashing via fastboot or Mi Flash. (TWRP does not check the rollback indices before flashing, which is why nearly all bricks were the result of downgrading via TWRP.)

How to find current rollback index

  1. Connect your Xiaomi device to your PC via USB
  2. Launch an ADB terminal (see Appual’s guide “How to Install ADB on Windows”)
  3. Reboot to fastboot mode
  4. Enter the following command: fastboot getvar anti

If the output returns empty, then ARB was not yet enabled on your device. If the output returns a number, then the number it returns is your current rollback index. For example, if it returns “anti: 4” then ‘4’ is your rollback index.

How to find rollback index of images

  1. Download the “fastboot” ROM equivalent of the recovery ROM you are trying to install. The recovery ROM always has the device’s marketing name in the filename and ends in .zip. The fastboot ROM always has the device’s code-name in the filename and ends in .tar.gz.
  2. Extract flash-all.bat from the .tar.gz archive.
  3. Open flash-all.bat in a text editor like Notepad++ and look for the following line: set CURRENT_ANTI_VER=#

That number (#) is the rollback index of the MIUI version you want to flash. If that number is equal to or greater than your current rollback index, then it’s safe to flash in TWRP, Mi Flash, etc. If that number is less than your current rollback index, then DO NOT FLASH THIS ROM VIA TWRP.

So to avoid tripping ARB and completely bricking your Xiaomi device, check your rollback index before trying a new ROM or downgrading via TWRP – though you should stick with Mi Flash or fastboot to flash MIUI ROMs, because Xiaomi’s bootloader has built-in protection that actually prevent you from flashing a ROM that has a lower rollback index.


Kamil Anwar

Kamil is a certified MCITP, CCNA (W), CCNA (S) and a former British Computer Society Member with over 9 years of experience Configuring, Deploying and Managing Switches, Firewalls and Domain Controllers also an old-school still active on FreeNode.