Root and configure a Lenovo Smart Clock 2 for use as a smart home display
This guide focuses on Ubuntu 23.04.
I recommend using Ubuntu over Windows purely because there are no shifty third-party-drivers-from-untrustworthy-website shenanigans required to get the clock recognised in Ubuntu.
I put together this guide as a product of following many guides and trying different things, seeing what works and what doesn't, and trying to rectify those problems. Most noteably the outdated webview component was causing issues when trying to use the HomeAssistant companion app, so I needed to find a way to install a more modern webview. HomeAssistant also does not play well with Bromite, so existing guides to install that were not of use to me.
🛍️ I have a small number of pre-rooted units available for purchase: eBay UK - Preconfigured.
I also offer a mail-in rooting service if you own a Lenovo Smart Clock 2 already: eBay UK - Mail-In Rooting Service
- A USB cable
- Preci-Dip or POGO pins (https://www.mouser.co.uk/ProductDetail/437-813S100810016101)
- Soldering iron and solder
- Print a stand to ensure the pins make contact with the correct spots on the clock. (https://www.printables.com/model/450827-lenovo-smart-clock-2-diy-programming-pogo-pin-dock/files)
- A bluetooth keyboard
- Cut one end from a USB A cable (I used a USB-A to Micro-B cable). Ensure that it is a data cable before proceeding, a charging-only cable will not work!
- Solder the pogo pins to match the following picture:
(Photo credit bj00rn @ XDA Developers)
AS SHOWN IN THE PICTURE ABOVE, with the wide side of the case horizontal and the connector at upper left, assuming correct usage of colours inside the USB cable:
DP / Green | DM / White |
---|---|
GND / Black | GND / Black |
VBUS / Red | N/A |
N/A | N/A |
Pin arrangements courtesy of cmccambridge @ XDA Developers
sudo apt-get install android-sdk-platform-tools
Install and set up the mtclient environment (via https://github.com/bkerler/mtkclient)
sudo apt install python3 git libusb-1.0-0 python3-pip python3-virtualenv
cd ~
git clone https://github.com/bkerler/mtkclient
cd mtkclient
python3 -m venv .
source bin/activate
pip3 install -r requirements.txt
python3 setup.py build
python3 setup.py install
sudo usermod -a -G plugdev $USER
sudo usermod -a -G dialout $USER
sudo cp Setup/Linux/*.rules /etc/udev/rules.d
sudo udevadm control -R
!! This is needed to recover your device if anything goes wrong !!
- Send the command below. The MTK client will begin to scan for the device
python mtk r boot,vbmeta boot.img,vbmeta.img
- Whilst holding
Volume +
andVolume -
and with the USB cable attached, insert the power cable for the clock - The
mtkclient
software should detect the device and dump the partitions we specified. - Reset the mtkclient connection to the device:
python mtk reset
- Power off the clock then power it back on again.
Magisk-v26.1.apk (https://github.com/topjohnwu/Magisk/releases/tag/v26.1)
- Set the device up from the Google Home app until the clock face is shown on the device
- Open the Google Home app and open the Devices tab at the bottom
- Select your smart clock in the list of available devices
- Press the settings icon in the top right hand corner
- Open the Accessibility menu and enable Screen reader.
This general process is shown very well in this video by Cameron Gray (https://youtu.be/uSHpvbbvz7Q?t=444) My process which differs slightly is written below:
-
With the account you are using to set up the device, open Google Calendar
-
Create a new event in the future with the title consisting only of
https://blakadder.com/assets/files/ultra-small-launcher.apk
-
Ask the clock to show upcoming events
-
With the event on screen, swipe sideways until the clock reads out the title of the event. (
https://blakadder.com/assets/files/ultra-small-launcher.apk
) -
Draw a "L" shape on the screen to open the TalkBack menu
-
Swipe sideways until "Copy last utterance to clipboard" is selected, then tap twice to select it.
-
Draw a "L" shape on the screen again to open the TalkBack menu
-
Swipe right on the screen until "Open Talkback settings" is selected, then tap twice to select it.
-
You can disable Screen Reader via the Google Home app on your phone now, we won't be needing it again for a while.
-
Scroll to the bottom of the list. Near the end is "Privacy policy". Tap it.
-
In the Browser window that opens, allow the permission prompts. We need to be able to download files using this browser, so storage access is necessary.
-
Tap the address bar. This will select the URL. Tap again in the address bar and press the
X
button to clear the address bar -
Long press in the address bar and paste the URL in.
-
Long press the URL again and press "Open"
-
The launcher will now download and ou will be taken to the Downloads folder.
-
Click the downloaded file to install the APK
-
Follow the prompts to allow the Browser to install the APK.
-
When prompted, change the default launcher to the launcher we just installed.
- Oprn the settings app from the home screen
- Pair your bluetooth keyboard in the normal way
Windows + Enter
orCtrl + Esc
will simulate the "home" button
- Open the settings app from the home screen
- Select "about phone"
- Find the build number and tap on it 7 times until it says "you are now a developer"
- Go back to the main Settings menu and select System.
- Select "Developer Options"
- Enable "USB debugging"
- Install the magisk app:
adb install Magisk-v26.1.apk
- Push the extracted
boot.img
file to the device:
adb push boot.img /sdcard/Download
- Open the Magisk app and press "Install".
- Select the option "Select and Patch a File"
- Select the Downloads folder, and then the boot.img we sent to the device earlier.
- Allow the process to complete, this may take a few minutes.
- Rename this new file so we don't get it confused with the original one:
adb shell mv /sdcard/Download/[displayed magisk patched boot filename here] /sdcard/Download/boot.patched
- Pull the patched
boot.patched
file back to yout computer:
adb pull /sdcard/Download/boot.patched
- Erase metadata and userdata:
python mtk e metadata,userdata,md_udc
- Unlock bootloader:
python mtk da seccfg unlock
- Reset the mtkclient connection:
python mtk reset
- Reboot the clock by removing the power cable and plugging it back in.
- Flash the boot.patched file to the clock:
python mtk w boot,vbmeta boot.patched,vbmeta.img.empty
- Reset the mtkclient connection:
python mtk reset
- Reboot the clock by removing the power cable and plugging it back in.
You may stop here if that's all you were intending to do. This method of root survives reboots and factory resets.
I used the following files to install a more modern WebView:
LSPosed_1.8.6.apk AnyWebView_1.2_experimental.apk (https://github.com/neoblackxt/AnyWebView/releases/tag/v1.2) LSPosed-v1.8.6-6712-zygisk-release.zip (https://github.com/LSPosed/LSPosed/releases/tag/v1.8.6) com.google.android.webview_114.0.5735.147-573514700_minAPI24_maxAPI28(armeabi-v7a)(nodpi).com.apk
- Open the Magisk app and open the settings tab
- Enable Zygisk
- Reboot if prompted
- Push the LSPosed files to the clock
adb push LSPosed-v1.8.6-6712-zygisk-release.zip /sdcard/Download
adb install LSPosed_1.8.6.apk
- Open Magisk and select the modules tab
- Select "Install from storage"
- Navigate to the Download folder and select
LSPosed-v1.8.6-6712-zygisk-release.zip
- Install the APK files for the new WebView component and AnyWebView:
adb install --user 0 com.google.android.webview_114.0.5735.147-573514700_minAPI24_maxAPI28(armeabi-v7a)(nodpi)_apkmirror.com.apk
adb install --user 0 AnyWebView_1.2_experimental.apk
- Reboot the device
- Open the LSPosed app and open the modules section
- Enable AnyWebView, selecting the webview you want to be enabled before you exit the module setup
- Reboot the device.
- Open the settings app, then navigate to Developer Options
- Open "WebView implementation" and select the newly installed WebView component.
- Download the Home Assistant Companion APK from F-Droid (https://f-droid.org/en/packages/io.homeassistant.companion.android.minimal/)
- Install the Home Assistant APK on your device:
adb install io.homeassistant.companion.android.minimal_[version].apk
- Download the MacroDroid APK and install it on your device:
adb install MacroDroid - Device Automation_5.35.11.apk
- Grant both of these applications the "Display over other apps" permission: !! This is important if you want to use Home Assistant notification commands to control the device. MacroDroid requires this permission to launch Home Assistant on boot.
adb shell pm grant io.homeassistant.companion.android.minimal android.permission.SYSTEM_ALERT_WINDOW
adb shell pm grant com.arlosoft.macrodroid android.permission.SYSTEM_ALERT_WINDOW
- Open MacroDroid and set up a macro as follows:
- Trigger > Device Events > Device Boot
- Actions > Applications > Launch Application > Select Application > HomeAssistant
- Optional: Force new > OK
- Set macro name
- Set up Home Assistant to your liking.
Upon reboot, your device will now open Home Assistant immediately after the device has fully booted. The launcher may show briefly.
Follow the instructions at https://github.com/mrh929/magisk-wifiadb
- Install and enable Magisk module https://github.com/sunilpaulmathew/De-Bloater
- Rebbot
- Open De-Bloater app and select all com.google.assistant.* and com.lenovo.* and apks to your liking.
- Reboot
Option 1
- Open De-bloater app
- Restore debloated apps
- Reboot
Option 2
- Disable Magisk De-Bloater module
- Reboot
-
Download the VirtualSoftKeys app from F-Droid
-
Grant the "display over other apps" permission
adb shell pm grant tw.com.daxia.virtualsoftkeys android.permission.SYSTEM_ALERT_WINDOW
-
Open the app, follow the on screen prompts to configure the nav bar to your liking.
-
Push microG Installer Revived to sdcard
adb push microG_Installer_Revived.zip /sdcard/Download
-
Push LSPosed framework to sdcard
adb push LSPosed-v1.8.6-6712-zygisk-release.zip /sdcard/Download
-
Install the LSPosed app:
adb install LSPosed_1.8.6.apk
-
Open the Magisk app and enable Zygisk from Magisk's settings.
-
Reboot
-
Open the Magisk app and install both modules from storage.
-
Reboot
-
Open the LSPosed app
-
Follow the steps to enable signature spoofing: https://github.com/microg/GmsCore/wiki/Signature-Spoofing
-
Push the FakeGapps package to sdcard https://github.com/whew-inc/FakeGApps/releases
adb push app-release.zip /sdcard/Download
-
Open LSPosed and enable the FakeGapps modules
-
Reboot
-
Open microG settings and observe whether the self-check passes. All checks should now pass if done correctly.
🎉 You can now add a Google account, register the device, enroll in cloud messaging and run apps that rely on the gApps package like Youtube Music.