diff --git a/CHANGELOG b/CHANGELOG index 06ed53ca..618fa920 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,7 @@ * Phone screen preview: Add rotation option; improve landscape layout * Add "AI Chat" app (conversational-style use of the voice assistant with hold-to-talk) * Add rightness control to the system context menu +* Messaging in the flasher distinguishes between downgrading from stock firmwares where that's been validated and veresions where it hasn't, and considers 2.2.10 validated ## 0.6.5 - 2026-09-04 * Changed context menu gestures: — for system, ●— for app context menu. diff --git a/app/g2/firmware-compat.ts b/app/g2/firmware-compat.ts index 83d9a830..0620fec0 100644 --- a/app/g2/firmware-compat.ts +++ b/app/g2/firmware-compat.ts @@ -13,8 +13,10 @@ const REQUIRED_FIRMWARE_EXTENSIONS = ["img640", "fbguard", "wearnotify"] as cons // The stock firmware release Faceclaw's custom image is built from. Stock at or // below this can be flashed with our patched image; a newer stock version is // unrecognized (its layout may differ from what our patch set targets). -export const FLASHABLE_STOCK_VERSION = [2, 2, 9, 22]; -export const FLASHABLE_STOCK_VERSION_TEXT = FLASHABLE_STOCK_VERSION.join("."); +export const BASE_STOCK_VERSION = [2, 2, 9, 22]; +export const BASE_STOCK_VERSION_TEXT = BASE_STOCK_VERSION.join("."); +export const VALIDATED_STOCK_VERSION = [2, 2, 10, 10]; +export const VALIDATED_STOCK_VERSION_TEXT = VALIDATED_STOCK_VERSION.join("."); function parseDottedVersion(version: string): number[] { return version @@ -111,10 +113,12 @@ export function reportedFirmwareVersion(info: FirmwareInfo): string { * How the pre-flash firmware check should treat the connected glasses: * - "custom": Faceclaw's firmware is already installed — nothing to flash. * - "flashable-stock": stock firmware at or below the version we build from. - * - "newer-stock": stock firmware newer than we recognize — flash only on override. + * - "newer-stock-validated": stock firmware newer than the version we build + * from, on which the downgrade has been tested successfully + * - "newer-stock-unvalidated": stock firmware newer than we recognize — flash only on override. * - "unknown": no version could be read (treated as a probe/connection failure). */ -export type OnboardingFirmwareKind = "custom" | "flashable-stock" | "newer-stock" | "unknown"; +export type OnboardingFirmwareKind = "custom" | "flashable-stock" | "newer-stock-validated" | "newer-stock-unvalidated" | "unknown"; export function classifyOnboardingFirmware(info: FirmwareInfo): { kind: OnboardingFirmwareKind; @@ -127,8 +131,13 @@ export function classifyOnboardingFirmware(info: FirmwareInfo): { if (!version) { return { kind: "unknown", version: "" }; } - const comparison = compareVersions(parseDottedVersion(version), FLASHABLE_STOCK_VERSION); - return { kind: comparison <= 0 ? "flashable-stock" : "newer-stock", version }; + if (compareVersions(parseDottedVersion(version), BASE_STOCK_VERSION) <= 0) { + return { kind: "flashable-stock", version }; + } else if (compareVersions(parseDottedVersion(version), VALIDATED_STOCK_VERSION) <= 0) { + return { kind: "newer-stock-validated", version }; + } else { + return { kind: "newer-stock-unvalidated", version }; + } } /** Cached R1 battery reports in settings field 106 and query mode 17. */ diff --git a/app/phone-ui/onboarding-firmware-check-view-model.ts b/app/phone-ui/onboarding-firmware-check-view-model.ts index 88850ced..446efe8b 100644 --- a/app/phone-ui/onboarding-firmware-check-view-model.ts +++ b/app/phone-ui/onboarding-firmware-check-view-model.ts @@ -7,12 +7,12 @@ 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, classifyOnboardingFirmware, 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 +72,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 +108,7 @@ export class OnboardingFirmwareCheckViewModel extends Observable { this.finish(); return; case "flashable": + case "newer-validated": case "newer": this.goToFlashing(); return; @@ -196,8 +198,8 @@ export class OnboardingFirmwareCheckViewModel extends Observable { private applyClassification(kind: OnboardingFirmwareKind, version: string, capabilities: string): 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). + // "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 @@ -218,11 +220,22 @@ 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 = "Newer Firmware"; + 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. Applying custom ` + + `firmware will downgrade the firmware version, which may cause compatibility issues when using it ` + + `with the stock phone app. If you reconnect the stock phone app, it will offer an OTA update to ` + + `${version}; if you apply that update it will fully uninstall the custom firmware.`; + 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;