forked from Blendman974/faceclaw
cb78841a9d683c21de541f6ebb7177deb1a53aa5
We're going to extend the Faceclaw app onboarding process to include checking for and installing the custom firmware (currently handled externally with the scripts in ../g2flash). We'll add script scripts/resetOnboarding.sh that uses adb to reset the app on the attached phone to default/pre-onboarding state for testing. The onboarding process will explain that it's only compatible with custom firmware, with options to either skip and try out the app using only the phone-screen preview (instead of pairing with glasses), or proceed with flashing. If the user proceeds with flashing, we first connect to the glasses (with the existing mechanism), and display an on-glasses confirmation prompt. Because this prompt needs compatibility with stock firmware, it will use a different subset of the BLE protocol than the main app does (in particular, no image containers), so we'll have a separate bluetooth communication class rather than extending FaceclawBleCommunicator. We'll send an init message to start a Hub app, initialize a layout with a text container and a list, populate the text container with a message saying that flashing will void warranty and the list with No and Yes, set up a keepalive/heartbeat message timer, and wait for a menu selection. (Refer to ../g2-kit-unofficial/ble/docs and ../g2-kit-unofficial/ble/gen for protocol details). If the prompt is approved, we go to the flashing screen. On the flashing screen, we first download the official firmware, apply patches to it, and check that it has the expected result hash. See ../g2flash/build_cfw.sh and ../g2flash/apply_patches.py for details. Let's implement everything prior to the update itself now, ie, the on-device confirmation prompt, and downloading, patching and verifying the modded firmware. scripts/resetOnboarding.sh is meant to reset a pref so that Faceclaw reruns its first-run onboarding on next launch, but fails with "No onboarding keys were set. App is already in pre-onboarding state." (And onboarding doesn't trigger on next launch) Thanks. I tested the on-glasses prompt on real hardware and it worked as expected. Next up, let's port the flashing procedure itself. One detail of the flashing procedure worth noting: the two lenses get updated separately, and at the end of updating either lens, both lenses get rebooted, creating a brief period when neither is reachable, so the timeout to look for the second lens should not be too short.
# Faceclaw - An unofficial user interface for the Even Realities G2 smart glasses This is an unofficial user interface for the Even Realities G2 smart glasses. It is entirely unofficial, and comes with no support or warranty from Even Realities or from anyone. To use it, you uninstall or unpair the official Even Realities app, then install the custom firmware from from https://github.com/jimrandomh/g2flash, then install this app on the same phone. Faceclaw is not compatible with the stock firmware due to limitations in how the stock firmware handles images. THIS IS AN UNFINISHED DEVELOPMENT PROTOTYPE; IF YOU DON'T HAVE ANY PROGRAMMING EXPERIENCE, OR YOU AREN'T COMFORTABLE EDITING, COMPILING, AND SIDELOADING AN ANDROID APPLICATION YOURSELF, OR YOU DON'T HAVE AN ANDROID DEVICE TO RUN IT ON, THIS IS NOT FOR YOU. The name Faceclaw implies plans to integrate this with OpenClaw. These plans have not yet been iplemented. If you want to use OpenClaw with Even Realities G2 smart glasses today, consider using OcuClaw (which is an Even Hub app) instead. ## Compiling and Installing To compile this, you will need an Android SDK environment, with SDK version 35 installed and licenses accepted, and the ANDROID_HOME pointing to the install. You will need a JDK environment (v21), with the JAVA_HOME environment variable pointed at it. You will also need a reasonably up to date npm and nodejs installed. ## Features * Integration with Android notifications: A top-bar that shows the same icons your phone does, popups when notifications arrive, and menu items to dismiss or use Android-app-provided custom actions like mark as read or quick reply. * An app-launcher and app-switcher sidebar * Mirror terminal apps such as coding agents with g2mirror (https://github.com/jimrandomh/g2mirror) and view them on the glasses * A media player integration, which can view and control the currently playing track and playlist. Compatible with most Android media players (Spotify and VLC media player tested). * Integratation with Nightscout, an outside app for viewing blood-glucose data. * Voice transcription using the G2's microphone with ElevenLabs' cloud transcription model (requires an API key from ElevenLabs) * Connection management with auto-reconnect, autodetection of conflict with the official Even Realities app, and some amount of experience/iteration on the issues that come with keeping it runnign all day * On-phone screen mirroring and simulated ring input * Dual-language NativeScript architecture with Java for the multithreaded Android API and bluetooth stack bits, Typescript for the bits you want to hack on ## Additional Caveats Some permissions are used, but may not reliably prompted for. Go to Android Settings > Apps > Faceclaw to ensure permissions are available or things may not work. Being a background app on a locked Android phone is fraught, and there may be issues with manufacturer-psecific battery optimization software that lead to it getting paused, throttled to low CPU usage, etc.
Languages
TypeScript
51.1%
Kotlin
23.2%
JavaScript
12.9%
C
6.6%
Objective-C
2.2%
Other
4%