Xiaomi Mi Box 3 (xiaomi-once)

There are 2 variants:


 * Mi Box 3/, running Android TV and sold everywhere else.
 * Mi Box 3C/, running MIUI TV and sold in China. Seems to only have 4GB of storage and 1GB of RAM.

Some people succeeded at flashing the  firmware to an   set-top box though.

Note that these instructions are only expected to work on the  variant.

If running Android 8/7/6
It can be intercepted when it is booting.

It will load either  (more info) or recovery.img (android recovery mode image), both at the root of a USB stick, the latter being booted when Android TV and the recovery mode aren't bootable.

If running Android 9
You're out of luck! You need to downgrade to Android 8.

Installation
Before doing everything here, please follow the instructions in.

Only installing to a USB drive works currently.

Use pmbootstrap to build your own image, like so:

After you created the image, connect the UART to your Mi Box.

Next, intercept U-Boot when it's booting. You should get a shell.

Run these commands to modify the default boot behavior and reboot:

Downgrading from Android 9 to Android 8
There's a guide for downgrading from Android 9 to 8: https://forum.xda-developers.com/t/mi-box-3-mdz-16-ab-downgrade-android-9-pie-to-android-8-oreo.4194075/

If that guide doesn't work, try this:


 * 1) Plug a USB drive into your computer and format it as FAT32
 * 2) Download https://mega.nz/file/gh0xCCrR#ctdPivezVFNAuMLq19eOepO1LHJCfVNhowmZz7Fx87s
 * 3) Extract   and   from the zip file, as well as   from   and put them at the root of your USB drive
 * 4) Power your Mi Box on and boot it into the recovery mode
 * 5) Plug your USB drive to it
 * 6) 'Apply update from EXT' > 'From Udisk' >   (note: "Udisk" is a translation error in the recovery)
 * 7) Flash and reboot! Your Mi Box should reboot a few times. You should see a progress bar after that. (It only flashed U-Boot, and Android 9 isn't bootable from it, and thus it loads   from the USB drive, which runs  )
 * 8) After that, it's going to boot into Android 8, which will fail. It's then going to boot into recovery mode and you should see the following error message: "Cannot load Android system. Your data may be corrupt. If you continue to get this message, you may need to perform a factory data reset and erase all user data stored on this device."
 * 9) 'Factory data reset' > 'Yes'
 * 10) Then it should reboot automatically by itself
 * 11) Done!

Recover back to the default booting behavior
Run these commands:

Unlock the bootlocker
This device has a locked bootloader (It seem only mda-16-ab have this kind of bl) that can only signed boot image supposedly.However exkc find out it can chainboot a unlocked bootloader from the locked bootloader via "multiboot" mode.There are some work on unlocking the android 6 bootloader which allow you to boot unsigned boot image directly from the stock bootloader.

Maintainer

 * exkc