[Google Home] octathorp:
Hello.

We have been discussing about this topic in another thread (https://xdaforums.com/t/unlocking-the-xiaomi-mi-smart-clock.4576091) but I have decided to create a new thread to have info about my project organized in a more or less "official" thread.

PLEASE: MAKE A BACKUP OF YOUR DEVICE WITH MTKCLIENT BEFORE TRYING ANYTHING FROM THIS POST

Xiaomi's Mi Smart Clock is a Google Assistant device with limited functionality. However, it runs a full version of Android Go 10 and thanks to certain procedures we can get a lot more out of the device.

A bit of history

The global Mi Smart Clock is really the same device as the Xiao AI Smart Speaker, a device developed for the local Chinese market, having the internal codes X04G for the global version and LX04 for the Chinese version.

Said Chinese version integrates Android 8.1 instead of Android Go 10 in the global version, and its respective assistant instead of Google's one. Otherwise they are the same device, and the firmware of one works on the other (or, at least, the LX04 firmware on X04G).

Some time ago a development version of Android 8.1 for the LX04 was "leaked", here you have a mirror for download: https://www.androidfilehost.com/?fid=10620683726822080151

and its flash tool: https://www.androidfilehost.com/?fid=10620683726822080152

Sorry but I don't have the original source for this files, as video got deleted from chinese video platform "Bilibili".

The leaked flash tool includes the signed files to be able to write this device, as it is protected. Later, with the appearance of MTKClient and the vulnerabilities on which it is based, it is no longer necessary to have the signatures to be able to write to the device.

This Android 8.1 is functional and certainly a big step forward from the limited stock system, but it has problems and limitations.

Another step forward

Therefore, and based on the original system of the global version, I have developed a series of guides and tools to be able to customize and create new systems for the device. Thanks to this we can, for example, modify the original image to remove the Google Assistant and add a standard launcher or even run GSI images thanks to the device's compatibility with Treble.

Instructions and tools in this repo:

https://github.com/octathorp/x04g_tools

Any questions you have I will try to help you as soon as possible.

An example of use, LineageOS 20

As an example of the potential of the device and the tools, here you have available for download and installation an image prepared with a GSI of LineageOS 20, ready to run on the device:

https://androidfilehost.com/?fid=10620683726822080854

To install it, please use this reference guide:

https://github.com/octathorp/x04g_tools/blob/master/howtos/FlashCustomImages.md

It's based on Andy Yan original GSI works on this link: https://sourceforge.net/projects/an...1-UNOFFICIAL-a64_bvS-vndklite.img.xz/download

As additional notes for this particular image:

- the setup wizard will appear cut off on the first screen, but scrolling down will allow you to continue.

- to get root permissions, install the Magisk apk. It will warn about the binary not being its own, but it is a limitation of this GSI and in any case it works properly.

- I recommend to use gestures instead of navigation buttons due to limited screen size.

- boot time is really long, so be patient.

The boot.img provided is patched to disable SELinux, since the precompiled policies were crashing on system boot.

Inside the provided super.img, in addition to the LOS20 GSI image is the original vendor.img partition of the device with some necessary changes to fix boot, ADB and audio issues. In addition, the mute button is also mapped as a power button. I recommend that anyone who is going to develop or test with other GSIs use my modified vendor.img instead of the original to have these problems fixed.

WARNING LX04 owners: none of the content I have developed will work on LX04 version. Partition schemes are different between Android 8.1 from LX04 and Android 10 from X04G.

You can convert X04G to LX04 because there is an existing (linked above) SPFlashTool factory image, but there is no equivalent for X04G, so the only way a LX04 or a X04G-to-LX04 converted device can run Android 10 system is restoring a full flash image created with MTKClient.

So, happy flashing! I'll try to help you if you need it.