In a previous article, I published a small userspace image and Linux kernel for the Zenwatch 3 that enables root access with SSH over USB on the watch. By now, I reached my initial goal to get AsteroidOS, the alternative Android Wear operating system, running on the Zenwatch 3. Similar to SailfishOS and Ubuntu Touch, AsteroidOS uses the original Android kernel - a patched Linux kernel - with a GNU/Linux userspace that, in turn, also uses some of the original, closed-source Android libraries to access certain hardware like the GPU. As the Android libraries expect a different software ecosystem, e.g., a different C library called bionic, we cannot simply call the Android libraries from within a common GNU/Linux application. Instead, we need an additional software layer that translates between the Android and the common GNU/Linux world. This layer is called libhybris.
Compared to other watches that already run AsteroidOS, the Zenwatch 3 ships with Android Wear 1.5 which is based on Android 6 Marshmallow. Luckily, Marshmallow support got included into the official libhybris sources recently. Hence, most of the hard work was already done. To use libhybris with the required closed-source Android libraries, we have to build some additional Android libraries and tools - that are available as open source on https://android.googlesource.com - with additional libhybris patches from the mer-hybris project. The tricky part here was to find the corresponding branch for this watch as there is no specific branch for Android Wear 1.5. I used the
marshmallow-dr1.5-release branch as it was one of the few Marshmallow branches that contains support for the CPU model (msm8909) in the
hardware/qcom/display repository. The detailed steps to build the Android part for AsteroidOS which resides in the
/system directory can be found in this file. A general overview of porting a device to AsteroidOS can be found in the official documentation.
Currently, we do not have complete support for the Zenwatch 3 but working GPU acceleration, touchscreen, wifi, vibrator and hardware buttons. Getting the sensors, audio and, hopefully, bluetooth to work are the next steps on my porting to-do list. Nonetheless, the watch already achieves a quite long uptime with currently 45% energy left after 4 days at my wrist with the display and wifi disabled most of the time. Hence, the watch might even make it through an entire week. Of course, having wifi or bluetooth enabled all the time for instant notifications will reduce this significantly.
On the software side, not everything is wired up yet and there are only a few simple applications. Especially synchronizing with an Android phone is only possible over Bluetooth right now - which also only works on the LG G Watch. However, the UI is really smooth - even smoother than Wear sometimes - and you can already choose from a small set of watchfaces and wallpapers.
If you are interested in trying AsteroidOS, you can run it without modifying your Android Wear installation. But, please remember that AsteroidOS is still in alpha state. Thus, there might still be bugs with unpredictable consequences - use it at your own risk!
You can download the root filesystem here and the kernel boot image here. Extract the root filesystem and follow the official documentation with these files. For example, if you already have an unlocked bootloader:
# tar -xvzf asteroid-image-swift.ext2.tgz
# adb push -p asteroid-image-swift-20170219083511.rootfs.ext2 /sdcard/linux/rootfs.ext2
# adb reboot bootloader
# fastboot boot zImage-dtb-swift.fastboot
Similar to Android Wear, you can enable/disable the display with the middle button and navigate through the menus using swipe gestures:
- Moving the welcome screen down gets you to the quick settings page where you can enable/disable different options and see the battery state.
- Moving the screen up gets you in the launcher menu where you can select one of the different apps.
- Moving the welcome screen to the right gives you an overview of the currently running apps.
- Moving the screen to the right gets you to the notification window.
If you are in an app, you can close the app if you swipe in from the top border or you can minimize the app if you swipe in from the left border.