forked from Blendman974/faceclaw
Merge main into ios-port and update the iOS CFW transport
This commit is contained in:
commit
e8e144f3f2
156 files changed
+10528
-1679
No files matched your search
@@ -7,14 +7,13 @@
|
||||
<Label col="2" text="{{ connectionStatusLabel }}" tap="{{ onConnectionStatusTap }}" class="action-bar-status" />
|
||||
<Label col="3" text="⚠️" tap="{{ onWarningIconTap }}" visibility="{{ warningIconVisibility }}" class="action-bar-warning" />
|
||||
</GridLayout>
|
||||
<ActionItem text="{{ buttonLabel }}" tap="{{ onTap }}" isEnabled="{{ connectItemEnabled }}" android.position="popup" />
|
||||
<ActionItem text="{{ buttonLabel }}" tap="{{ onTap }}" isEnabled="{{ connectItemEnabled }}" visibility="{{ glassesMenuItemsVisibility }}" android.position="popup" />
|
||||
<ActionItem text="Pair glasses" tap="{{ onPairGlassesTap }}" isEnabled="{{ canRun }}" android.position="popup" />
|
||||
<ActionItem text="Configure devices" tap="{{ onConfigureTap }}" isEnabled="{{ canRun }}" android.position="popup" />
|
||||
<ActionItem text="Permissions" tap="{{ onPermissionsTap }}" android.position="popup" />
|
||||
<ActionItem text="Conversations" tap="{{ onConversationsTap }}" android.position="popup" />
|
||||
<ActionItem text="Take screenshot" tap="{{ onTakeScreenshotTap }}" android.position="popup" />
|
||||
<ActionItem text="Record screen" tap="{{ onRecordScreenTap }}" android.position="popup" />
|
||||
<ActionItem text="Uninstall custom firmware" tap="{{ onUninstallFirmwareTap }}" isEnabled="{{ canRun }}" android.position="popup" />
|
||||
<ActionItem text="Uninstall custom firmware" tap="{{ onUninstallFirmwareTap }}" isEnabled="{{ canRun }}" visibility="{{ glassesMenuItemsVisibility }}" android.position="popup" />
|
||||
</ActionBar>
|
||||
|
||||
<GridLayout>
|
||||
|
||||
@@ -27,6 +27,7 @@ import {
|
||||
import { sampleBleTraffic } from "../native/ble-traffic";
|
||||
import { isValidMacAddress, loadDeviceAddresses } from "../g2/device-addresses";
|
||||
import { isAutoReconnectSuppressed, resumeAutoReconnect } from "../g2/reconnect-policy";
|
||||
import { isPreviewOnlyMode } from "./onboarding-state";
|
||||
import { formatErrorMessage } from "../util/format-error";
|
||||
import { G2_LENS_HEIGHT, G2_LENS_WIDTH } from "../graphics/image";
|
||||
|
||||
@@ -887,11 +888,6 @@ export class MainViewModel extends Observable {
|
||||
}
|
||||
}
|
||||
|
||||
onConfigureTap(): void {
|
||||
if (!this.canRun) return;
|
||||
Frame.topmost()?.navigate("phone-ui/config-page");
|
||||
}
|
||||
|
||||
onPermissionsTap(): void {
|
||||
Frame.topmost()?.navigate({
|
||||
moduleName: "phone-ui/permissions-page",
|
||||
@@ -904,6 +900,16 @@ export class MainViewModel extends Observable {
|
||||
Frame.topmost()?.navigate("phone-ui/conversations-page");
|
||||
}
|
||||
|
||||
/**
|
||||
* Preview-only users have no glasses paired, so the Connect and Uninstall
|
||||
* menu items have nothing to act on; hide them until pairing completes.
|
||||
* The view model is rebuilt on every visit to the main page, so this picks
|
||||
* up the mode change when pairing/flashing returns here.
|
||||
*/
|
||||
get glassesMenuItemsVisibility(): "visible" | "collapse" {
|
||||
return isPreviewOnlyMode() ? "collapse" : "visible";
|
||||
}
|
||||
|
||||
/**
|
||||
* Live scan that names each nearby pair by model, colour, and serial and
|
||||
* checks both arms belong together. A connected arm stops advertising, so
|
||||
@@ -911,9 +917,18 @@ export class MainViewModel extends Observable {
|
||||
* state; pairing is a detour, not a Disconnect, so lift the suppression
|
||||
* right away — nothing dials the glasses until the main page's autoConnect
|
||||
* runs again on the way back.
|
||||
*
|
||||
* In preview-only mode there are no glasses yet, so pairing is really the
|
||||
* rest of onboarding: re-enter that chain at its "Disconnect Other Apps"
|
||||
* step, which leads to the scan, the firmware check, and flashing. The
|
||||
* chain's Back buttons pop history, so its first page returns here.
|
||||
*/
|
||||
async onPairGlassesTap(): Promise<void> {
|
||||
if (!this.canRun) return;
|
||||
if (isPreviewOnlyMode()) {
|
||||
Frame.topmost()?.navigate({ moduleName: "phone-ui/onboarding-unpair-page" });
|
||||
return;
|
||||
}
|
||||
if (this.phase === "connected" || this.phase === "charging" || this.phase === "connecting") {
|
||||
try {
|
||||
await dashboardController.disconnect();
|
||||
@@ -1002,8 +1017,15 @@ export class MainViewModel extends Observable {
|
||||
// Each pad therefore defers its double-click until the finger-up (the touch
|
||||
// handler) and converts the deferred pair into the G2 tap-then-hold gesture
|
||||
// when a longPress lands first.
|
||||
//
|
||||
// A hold is two events, like the hardware's: longPress sends the press
|
||||
// (long-press-start, which the controller delivers as a plain long-press)
|
||||
// and the finger-up sends the release, so a hold really holds (the
|
||||
// Glanceboard stays up until the finger lifts). The firmware sends the
|
||||
// same release after a tap-then-hold, so that pair gets one too.
|
||||
|
||||
private ringPadDoubleTapPending = false;
|
||||
private ringPadHeld = false;
|
||||
|
||||
async onRingPadTap(): Promise<void> {
|
||||
await dashboardController.injectSyntheticRingInput("click");
|
||||
@@ -1014,8 +1036,9 @@ export class MainViewModel extends Observable {
|
||||
}
|
||||
|
||||
async onRingPadLongPress(): Promise<void> {
|
||||
const kind = this.ringPadDoubleTapPending ? "short-then-long-press" : "long-press";
|
||||
const kind = this.ringPadDoubleTapPending ? "short-then-long-press" : "long-press-start";
|
||||
this.ringPadDoubleTapPending = false;
|
||||
this.ringPadHeld = true;
|
||||
await dashboardController.injectSyntheticRingInput(kind);
|
||||
}
|
||||
|
||||
@@ -1023,6 +1046,11 @@ export class MainViewModel extends Observable {
|
||||
if (args.action !== "up" && args.action !== "cancel") return;
|
||||
const pending = this.ringPadDoubleTapPending;
|
||||
this.ringPadDoubleTapPending = false;
|
||||
if (this.ringPadHeld) {
|
||||
this.ringPadHeld = false;
|
||||
await dashboardController.injectSyntheticRingInput("long-press-release");
|
||||
return;
|
||||
}
|
||||
if (args.action === "up" && pending) {
|
||||
await dashboardController.injectSyntheticRingInput("double-click");
|
||||
}
|
||||
@@ -1049,8 +1077,9 @@ export class MainViewModel extends Observable {
|
||||
|
||||
private padTwoFingerDown = false;
|
||||
// See the ring pad above: defers the double-click so a longPress can turn
|
||||
// the pair into tap-then-hold.
|
||||
// the pair into tap-then-hold, and pairs every hold with a release.
|
||||
private padDoubleTapPending = false;
|
||||
private padHeld = false;
|
||||
|
||||
/** What the next gesture lands on, as the watch pad shows it. */
|
||||
get padFocusLine(): string {
|
||||
@@ -1072,8 +1101,10 @@ export class MainViewModel extends Observable {
|
||||
}
|
||||
|
||||
async onPadLongPress(): Promise<void> {
|
||||
const kind = this.padDoubleTapPending ? "short-then-long-press" : "long-press";
|
||||
if (this.padTwoFingerDown) return;
|
||||
const kind = this.padDoubleTapPending ? "short-then-long-press" : "long-press-start";
|
||||
this.padDoubleTapPending = false;
|
||||
this.padHeld = true;
|
||||
await dashboardController.injectSyntheticRingInput(kind, "watch");
|
||||
this.refreshPadFocusLine();
|
||||
}
|
||||
@@ -1093,6 +1124,12 @@ export class MainViewModel extends Observable {
|
||||
if (args.action === "up" || args.action === "cancel") {
|
||||
const pendingDouble = this.padDoubleTapPending;
|
||||
this.padDoubleTapPending = false;
|
||||
if (this.padHeld) {
|
||||
this.padHeld = false;
|
||||
await dashboardController.injectSyntheticRingInput("long-press-release", "watch");
|
||||
this.refreshPadFocusLine();
|
||||
return;
|
||||
}
|
||||
const twoFinger = this.padTwoFingerDown;
|
||||
if (twoFinger) {
|
||||
// Let the single-tap recognizer's delayed tap see the flag first.
|
||||
|
||||
@@ -7,12 +7,19 @@ import {
|
||||
hasExtractedEvenHubFonts,
|
||||
type FirmwareProgress,
|
||||
} from "../g2/firmware-builder";
|
||||
import { classifyOnboardingFirmware, FLASHABLE_STOCK_VERSION_TEXT, type OnboardingFirmwareKind } from "../g2/firmware-compat";
|
||||
import {
|
||||
BASE_STOCK_VERSION_TEXT,
|
||||
REQUIRED_FACECLAW_FIRMWARE_VERSION,
|
||||
classifyOnboardingFirmware,
|
||||
describeFirmwareExtension,
|
||||
type FirmwareExtension,
|
||||
type OnboardingFirmwareKind,
|
||||
} from "../g2/firmware-compat";
|
||||
import { DeviceInfoProbe, DeviceInfoState } from "../native/device-info-probe";
|
||||
import { setOnboardingCompleted, setPreviewOnlyMode } from "./onboarding-state";
|
||||
import { formatErrorMessage } from "../util/format-error";
|
||||
|
||||
type CheckPhase = "checking" | "fonts" | "custom" | "flashable" | "newer" | "error";
|
||||
type CheckPhase = "checking" | "fonts" | "custom" | "flashable" | "newer-validated" | "newer" | "error";
|
||||
|
||||
export class OnboardingFirmwareCheckViewModel extends Observable {
|
||||
private _phase: CheckPhase = "checking";
|
||||
@@ -72,6 +79,7 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
||||
case "custom":
|
||||
return "Finish";
|
||||
case "flashable":
|
||||
case "newer-validated":
|
||||
return "Install Firmware";
|
||||
case "newer":
|
||||
return "Proceed Anyway";
|
||||
@@ -107,6 +115,7 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
||||
this.finish();
|
||||
return;
|
||||
case "flashable":
|
||||
case "newer-validated":
|
||||
case "newer":
|
||||
this.goToFlashing();
|
||||
return;
|
||||
@@ -143,7 +152,7 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
||||
if (this._phase !== "error") return;
|
||||
// Same path as a real "custom" classification, so the phone-side G2 fonts
|
||||
// still get extracted when they're missing.
|
||||
this.applyClassification("custom", "", "");
|
||||
this.applyClassification("custom", "", { kind: "none" });
|
||||
}
|
||||
|
||||
// --- probe flow ------------------------------------------------------------
|
||||
@@ -169,35 +178,39 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
||||
this.disposeProbe();
|
||||
const probe = new DeviceInfoProbe(stored.right, stored.left);
|
||||
this.probeInstance = probe;
|
||||
probe.onStateChange((state) => this.reportProbeState(state));
|
||||
probe.onStateChange((state, detail) => this.reportProbeState(state, detail));
|
||||
|
||||
const info = await probe.run();
|
||||
this.probeInstance = null;
|
||||
|
||||
const { kind, version } = classifyOnboardingFirmware(info);
|
||||
this.applyClassification(kind, version, info.capabilities.trim());
|
||||
const { kind, version, extension } = classifyOnboardingFirmware(info);
|
||||
this.applyClassification(kind, version, extension);
|
||||
} catch (error) {
|
||||
this.probeInstance = null;
|
||||
this.toError(this.formatError(error));
|
||||
}
|
||||
}
|
||||
|
||||
private reportProbeState(state: DeviceInfoState): void {
|
||||
private reportProbeState(state: DeviceInfoState, detail: string): void {
|
||||
// The probe brings up the right lens, then the left, and pairs with each
|
||||
// in turn (they are separate Bluetooth devices with separate bonds).
|
||||
const lens = detail === "left" || detail === "right" ? `the ${detail} lens` : "your glasses";
|
||||
if (state === "connecting") {
|
||||
this.status = "Connecting to your glasses...";
|
||||
this.status = `Connecting to ${lens}...`;
|
||||
} else if (state === "authenticating") {
|
||||
// First-time connections pair here; the OS may show a Bluetooth dialog.
|
||||
this.status = "Authenticating with your glasses... If Android asks to pair, tap Pair.";
|
||||
this.status = `Pairing with ${lens}... Each lens pairs separately; if Android asks to pair, tap Pair.`;
|
||||
} else if (state === "querying") {
|
||||
this.status = "Reading the firmware version...";
|
||||
}
|
||||
}
|
||||
|
||||
private applyClassification(kind: OnboardingFirmwareKind, version: string, capabilities: string): void {
|
||||
private applyClassification(kind: OnboardingFirmwareKind, version: string, extension: FirmwareExtension): void {
|
||||
this.busy = false;
|
||||
// `kind` is classifyOnboardingFirmware's OnboardingFirmwareKind ("custom" |
|
||||
// "flashable-stock" | "newer-stock" | "unknown") -- NOT CheckPhase's shorter
|
||||
// "flashable"/"newer" (used below via setPhase for _phase/primaryLabel/etc).
|
||||
// "older-faceclaw" | "other-custom" | "flashable-stock" | "newer-stock-unvalidated" |
|
||||
// "newer-stock-validated" | "unknown") -- NOT CheckPhase's shorter
|
||||
// "flashable"/"newer-validated"/"newer" (used below via setPhase for _phase/primaryLabel/etc).
|
||||
// The two types share two of four names, so a typo'd case label here type-checks
|
||||
// fine as long as `kind` stays plain `string`, but silently falls through to
|
||||
// `default` (the hard "couldn't read a firmware version" error) for every real
|
||||
@@ -206,10 +219,26 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
||||
switch (kind) {
|
||||
case "custom":
|
||||
if (!hasExtractedEvenHubFonts()) {
|
||||
void this.extractFontsForCustomFirmware(version, capabilities);
|
||||
void this.extractFontsForCustomFirmware(version, extension);
|
||||
break;
|
||||
}
|
||||
this.showCustomReady(version, capabilities, false);
|
||||
this.showCustomReady(version, extension, false);
|
||||
break;
|
||||
case "older-faceclaw":
|
||||
this.setPhase("flashable");
|
||||
this.headline = "Firmware Update Available";
|
||||
this.status =
|
||||
`Your glasses run ${describeFirmwareExtension(extension)}${version ? `, based on stock ${version}` : ""}. ` +
|
||||
`This version of Faceclaw needs revision ${REQUIRED_FACECLAW_FIRMWARE_VERSION}. ` +
|
||||
"Tap Install Firmware to update it.";
|
||||
break;
|
||||
case "other-custom":
|
||||
this.setPhase("flashable");
|
||||
this.headline = "Other Custom Firmware";
|
||||
this.status =
|
||||
`Your glasses run ${describeFirmwareExtension(extension)}${version ? `, based on stock ${version}` : ""}. ` +
|
||||
`Faceclaw needs its own custom firmware (revision ${REQUIRED_FACECLAW_FIRMWARE_VERSION}). ` +
|
||||
"Tap Install Firmware to replace the current firmware with it.";
|
||||
break;
|
||||
case "flashable-stock":
|
||||
this.setPhase("flashable");
|
||||
@@ -218,11 +247,21 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
||||
`Your glasses run stock firmware ${version}. This is compatible — tap Install Firmware to flash ` +
|
||||
"Faceclaw's custom firmware.";
|
||||
break;
|
||||
case "newer-stock":
|
||||
case "newer-stock-validated":
|
||||
this.setPhase("newer-validated");
|
||||
this.headline = "Ready to Install";
|
||||
this.status =
|
||||
`Your glasses run stock firmware ${version}, which is compatible. This version is newer than the ` +
|
||||
`${BASE_STOCK_VERSION_TEXT} release Faceclaw's custom image is built from. You may not be able to ` +
|
||||
`use the official Even app without upgrading back to ${version} first (the official Even app will ` +
|
||||
`perform that upgrade for you if you re-pair it).`;
|
||||
break;
|
||||
|
||||
case "newer-stock-unvalidated":
|
||||
this.setPhase("newer");
|
||||
this.headline = "Unrecognized Firmware";
|
||||
this.status =
|
||||
`Your glasses run stock firmware ${version}, which is newer than the ${FLASHABLE_STOCK_VERSION_TEXT} ` +
|
||||
`Your glasses run stock firmware ${version}, which is newer than the ${BASE_STOCK_VERSION_TEXT} ` +
|
||||
"release Faceclaw's custom image is built from. Flashing may not work correctly and carries extra risk. " +
|
||||
"You can proceed anyway, or go back.";
|
||||
break;
|
||||
@@ -236,7 +275,7 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
||||
}
|
||||
}
|
||||
|
||||
private async extractFontsForCustomFirmware(version: string, capabilities: string): Promise<void> {
|
||||
private async extractFontsForCustomFirmware(version: string, extension: FirmwareExtension): Promise<void> {
|
||||
this.setPhase("fonts");
|
||||
this.headline = "Preparing G2 Fonts";
|
||||
this.busy = true;
|
||||
@@ -245,7 +284,7 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
||||
"Downloading the official firmware to extract them; your glasses will not be reflashed.";
|
||||
try {
|
||||
await downloadAndExtractEvenHubFonts((progress) => this.reportFontProgress(progress));
|
||||
this.showCustomReady(version, capabilities, true);
|
||||
this.showCustomReady(version, extension, true);
|
||||
} catch (error) {
|
||||
this.toError(
|
||||
`Custom firmware is installed, but the G2 fonts could not be prepared: ${this.formatError(error)}`,
|
||||
@@ -270,13 +309,16 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
||||
}
|
||||
}
|
||||
|
||||
private showCustomReady(version: string, capabilities: string, extractedFonts: boolean): void {
|
||||
private showCustomReady(version: string, extension: FirmwareExtension, extractedFonts: boolean): void {
|
||||
this.busy = false;
|
||||
this.setPhase("custom");
|
||||
this.headline = extractedFonts ? "Fonts Ready" : "Custom Firmware Detected";
|
||||
const details = [
|
||||
extension.kind === "faceclaw" ? `revision ${extension.version}` : "",
|
||||
version ? `based on stock ${version}` : "",
|
||||
].filter(Boolean);
|
||||
this.status =
|
||||
`Your glasses already run Faceclaw's custom firmware${version ? ` (version ${version})` : ""}` +
|
||||
`${capabilities ? `, extensions: ${capabilities}` : ""}. ` +
|
||||
`Your glasses already run Faceclaw's custom firmware${details.length ? ` (${details.join(", ")})` : ""}. ` +
|
||||
(extractedFonts
|
||||
? "The phone-side G2 fonts were extracted successfully. No flashing was needed — you're all set."
|
||||
: "The phone-side G2 fonts are present. No flashing needed — you're all set.");
|
||||
@@ -288,7 +330,9 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
||||
this.disposeProbe();
|
||||
Frame.topmost()?.navigate({
|
||||
moduleName: "phone-ui/onboarding-flash-page",
|
||||
context: { mode: "install", fromOnboarding: true },
|
||||
// This page already described the install; skip the flash page's
|
||||
// intro/"Connect & Confirm" step and connect immediately.
|
||||
context: { mode: "install", fromOnboarding: true, autoStart: true },
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,12 @@ import { FlashMode, OnboardingFlashViewModel } from "./onboarding-flash-view-mod
|
||||
export function navigatingTo(args: NavigatedData): void {
|
||||
const page = args.object as Page;
|
||||
if (!page.bindingContext) {
|
||||
const context = (args.context as { mode?: FlashMode; fromOnboarding?: boolean } | undefined) ?? undefined;
|
||||
const context =
|
||||
(args.context as { mode?: FlashMode; fromOnboarding?: boolean; autoStart?: boolean } | undefined) ?? undefined;
|
||||
page.bindingContext = new OnboardingFlashViewModel({
|
||||
mode: context?.mode ?? "install",
|
||||
fromOnboarding: context?.fromOnboarding ?? true,
|
||||
autoStart: context?.autoStart ?? false,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ import { resumeAutoReconnect, suppressAutoReconnect } from "../g2/reconnect-poli
|
||||
import { setOnboardingCompleted, setPreviewOnlyMode } from "./onboarding-state";
|
||||
import { formatErrorMessage } from "../util/format-error";
|
||||
|
||||
type FlashPhase = "intro" | "prompt" | "building" | "ready" | "flashing" | "flashed" | "error";
|
||||
type FlashPhase = "intro" | "prompt" | "building" | "flashing" | "flashed" | "error";
|
||||
|
||||
export type FlashMode = "install" | "uninstall";
|
||||
|
||||
@@ -53,7 +53,7 @@ export class OnboardingFlashViewModel extends Observable {
|
||||
private flasherUnsubscribers: Array<() => void> = [];
|
||||
private retryAction: () => void = () => this.beginPrompt();
|
||||
|
||||
constructor(options?: { mode?: FlashMode; fromOnboarding?: boolean }) {
|
||||
constructor(options?: { mode?: FlashMode; fromOnboarding?: boolean; autoStart?: boolean }) {
|
||||
super();
|
||||
// The flash flow needs the glasses to itself: from here on the main
|
||||
// page must not auto-reconnect, until an install succeeds (below) or
|
||||
@@ -68,13 +68,19 @@ export class OnboardingFlashViewModel extends Observable {
|
||||
"and reflashes the official firmware — removing Faceclaw's custom features."
|
||||
: "This connects to your glasses, asks for confirmation on the lens, checks the battery, then downloads, " +
|
||||
"verifies, and flashes Faceclaw's custom firmware.";
|
||||
if (options?.autoStart) {
|
||||
// Entered from a page that already explained what's about to happen
|
||||
// (the onboarding firmware check), so the intro/"Connect & Confirm"
|
||||
// step would be redundant: go straight to connecting.
|
||||
void this.beginPrompt();
|
||||
}
|
||||
}
|
||||
|
||||
// Kept short to fit the glasses' ~50-column text grid.
|
||||
private get glassesWarning(): string {
|
||||
return this.mode === "uninstall"
|
||||
? "Reinstalling the official firmware removes Faceclaw's custom features. Continue?"
|
||||
: "Flashing custom firmware will void your warranty and carries some risk of bricking the glasses. Continue?";
|
||||
: "Flashing custom firmware will void your warranty. Continue?";
|
||||
}
|
||||
|
||||
private get noun(): string {
|
||||
@@ -161,8 +167,6 @@ export class OnboardingFlashViewModel extends Observable {
|
||||
switch (this._phase) {
|
||||
case "intro":
|
||||
return "Connect & Confirm";
|
||||
case "ready":
|
||||
return "Flash Now";
|
||||
case "flashed":
|
||||
return "Finish";
|
||||
case "error":
|
||||
@@ -176,8 +180,6 @@ export class OnboardingFlashViewModel extends Observable {
|
||||
switch (this._phase) {
|
||||
case "prompt":
|
||||
return "Cancel";
|
||||
case "ready":
|
||||
return "Not Now";
|
||||
default:
|
||||
return "Back";
|
||||
}
|
||||
@@ -201,9 +203,6 @@ export class OnboardingFlashViewModel extends Observable {
|
||||
case "intro":
|
||||
void this.beginPrompt();
|
||||
return;
|
||||
case "ready":
|
||||
this.startFlashing();
|
||||
return;
|
||||
case "flashed":
|
||||
this.finish();
|
||||
return;
|
||||
@@ -330,7 +329,7 @@ export class OnboardingFlashViewModel extends Observable {
|
||||
this.disposePrompt();
|
||||
if (!approved) {
|
||||
this.busy = false;
|
||||
this.toError("You declined on the glasses. No firmware was written.", () => this.beginPrompt());
|
||||
this.toError("You declined on the glasses. Firmware was not installed.", () => this.beginPrompt());
|
||||
return;
|
||||
}
|
||||
const lowBattery = this.describeLowBattery(this.promptBattery);
|
||||
@@ -392,15 +391,9 @@ export class OnboardingFlashViewModel extends Observable {
|
||||
const build = this.mode === "uninstall" ? buildStockFirmware : buildCustomFirmware;
|
||||
const result = await build((progress) => this.reportBuildProgress(progress));
|
||||
this.firmwarePath = result.path;
|
||||
this.busy = false;
|
||||
this.setPhase("ready");
|
||||
this.headline = "Firmware Ready";
|
||||
this.status =
|
||||
`The ${this.noun} is prepared and verified (${result.bytes.toLocaleString()} bytes).\n\n` +
|
||||
"Tap Flash Now to write it to your glasses. Keep both lenses powered on and nearby — " +
|
||||
"each lens takes a few minutes, and the glasses will reboot when each lens finishes. " +
|
||||
"Do not close the app during flashing.";
|
||||
this.appendLog(`saved to ${result.path}`);
|
||||
this.appendLog(`${this.noun} prepared and verified (${result.bytes.toLocaleString()} bytes), saved to ${result.path}`);
|
||||
// The user already said Yes on the lens; no second confirmation here.
|
||||
this.startFlashing();
|
||||
} catch (error) {
|
||||
this.busy = false;
|
||||
const message =
|
||||
@@ -445,7 +438,9 @@ export class OnboardingFlashViewModel extends Observable {
|
||||
this.headline = "Flashing Firmware";
|
||||
this.busy = true;
|
||||
this.progress = 0;
|
||||
this.status = "Starting. Do not close the app or power off the glasses.";
|
||||
this.status =
|
||||
"Starting. Keep both lenses powered on and nearby — each lens takes a few minutes, " +
|
||||
"and the glasses will reboot when each lens finishes. Do not close the app during flashing.";
|
||||
|
||||
this.disposeFlasher();
|
||||
const flasher = new FirmwareFlasher(this.addresses, this.firmwarePath);
|
||||
|
||||
@@ -4,9 +4,12 @@
|
||||
<StackLayout>
|
||||
<Label text="Disconnect Other Apps" class="h1 text-center m-t-24" textWrap="true" />
|
||||
<Label
|
||||
text="Faceclaw and the official Even Realities app can't both be connected to the glasses at once. Before continuing, open the Even app, go to Home, select your glasses, open the Connection submenu, and press Disconnect (or turn off the Even app's Bluetooth). If any other glasses app is installed (such as Mentra), disconnect it too."
|
||||
text="Your glasses can only be connected to one app or phone at a time. If they're connected to another app (such as Even Realities or MentraOS) or another phone, disconnect them there before continuing. If nothing else is connected, you can continue."
|
||||
class="body-text m-t-24" textWrap="true" />
|
||||
<Button text="Open Even App Settings" tap="{{ onOpenEvenAppSettingsTap }}" width="{{ settingsButtonWidth }}" horizontalAlignment="center" class="-primary m-t-24" />
|
||||
<Label
|
||||
text="If you use the Even Realities app, go to Home, select your glasses, open the Connection submenu, and press Disconnect (or disable the Even app's "nearby devices" permission)."
|
||||
class="body-text m-t-16" textWrap="true" />
|
||||
<Button text="Open Even App Settings" tap="{{ onOpenEvenAppSettingsTap }}" visibility="{{ settingsButtonVisibility }}" width="{{ settingsButtonWidth }}" horizontalAlignment="center" class="-primary m-t-24" />
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@ import { Frame, Observable, Screen } from "@nativescript/core";
|
||||
import { openEvenAppSettings } from "../native/even-app-conflict";
|
||||
|
||||
export class OnboardingUnpairViewModel extends Observable {
|
||||
get settingsButtonVisibility(): "visible" | "collapsed" {
|
||||
return global.isAndroid ? "visible" : "collapsed";
|
||||
}
|
||||
|
||||
onOpenEvenAppSettingsTap(): void {
|
||||
openEvenAppSettings();
|
||||
}
|
||||
|
||||
@@ -28,8 +28,7 @@ const STEP_CONTENT: Record<OnboardingStep, StepContent> = {
|
||||
2: {
|
||||
headline: "Before You Continue",
|
||||
tagline: "",
|
||||
body:
|
||||
"This unofficial software provides a custom user interface and functionality for the Even Realities G2 smart glasses. It is not created or supported by Even Realities. If this software somehow breaks my headset, this is not Even's fault and is not covered by the hardware's warranty. If this software doesn't break my headset, using this software may void the hardware's warranty anyways, at the sole discretion of Even Realities. This software is a development prototype and may not be relied on for anything important. This software may be broken at any time by software or firmware updates created by Even, and this will not be Even's fault.",
|
||||
body: "This software provides a custom user interface and functionality for the Even Realities G2 smart glasses. It is not created or supported by Even Realities. If this software somehow breaks your headset, this is not Even's fault and is not covered by the hardware's warranty. If this software doesn't break you headset, using this software may void the hardware's warranty anyways, at the sole discretion of Even Realities. This software is beta; don't rely on it for anything critically important.",
|
||||
primaryLabel: "Agree",
|
||||
secondaryLabel: "Back",
|
||||
splash: false,
|
||||
@@ -38,8 +37,7 @@ const STEP_CONTENT: Record<OnboardingStep, StepContent> = {
|
||||
3: {
|
||||
headline: "Custom Firmware Required",
|
||||
tagline: "",
|
||||
body:
|
||||
"Faceclaw only runs on Even Realities G2 glasses that have Faceclaw's custom firmware installed. You have two choices:\n\n• Preview Only — explore Faceclaw's interface on your phone's screen without pairing any glasses. Nothing is written to a headset.\n\n• Flash Firmware — install the custom firmware on your glasses now, then use Faceclaw for real. Faceclaw scans for nearby glasses so you can pick yours by model, colour, and serial, then connects, asks for confirmation on the lens, and downloads and prepares the firmware.\n\nFlashing replaces the official firmware. It may void your warranty and, like any firmware update, carries a risk of bricking the device. The glasses can only be connected to one app at a time, so the next step will walk you through disconnecting the official Even app (and any other glasses apps) first.",
|
||||
body: "Faceclaw only runs on Even Realities G2 glasses that have Faceclaw's custom firmware installed. You have two choices:\n\n• Preview Only — explore Faceclaw's interface on your phone's screen without pairing any glasses. Nothing is written to a headset.\n\n• Flash Firmware — install the custom firmware on your glasses now, then use Faceclaw for real.\n\nFlashing replaces the official firmware. You can uninstall and return to the official firmware later, by reconnecting the official Even Realities app. Installing custom firmware is not covered by warranty.",
|
||||
primaryLabel: "Flash Firmware",
|
||||
secondaryLabel: "Preview Only",
|
||||
splash: false,
|
||||
|
||||
@@ -171,9 +171,9 @@ export class PairingViewModel extends Observable {
|
||||
|
||||
get instructions(): string {
|
||||
return (
|
||||
"Take the glasses out of their case (or open the lid) and keep them next to the phone. " +
|
||||
"Each arm advertises its serial; a pair is ready when both arms report the same one. " +
|
||||
"An arm connected to the official Even app stops advertising — disconnect it there first."
|
||||
"Select your G2 glasses and R1 ring below. Wear the glasses or take them out of the case, " +
|
||||
"and keep the glasses and phone nearby. If your glasses are not detected, make sure no other " +
|
||||
"apps are connected."
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user