forked from Blendman974/faceclaw
Distinguish newer-than-base firmwares between validated and unvalidated; don't show scary messaging on validated versions
This commit is contained in:
1 parent
58ebe95e0c
commit
6f60cda9cc
3 files changed
+35
-12
No files matched your search
@@ -7,6 +7,7 @@
|
|||||||
* Phone screen preview: Add rotation option; improve landscape layout
|
* 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 "AI Chat" app (conversational-style use of the voice assistant with hold-to-talk)
|
||||||
* Add rightness control to the system context menu
|
* 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
|
## 0.6.5 - 2026-09-04
|
||||||
* Changed context menu gestures: — for system, ●— for app context menu.
|
* Changed context menu gestures: — for system, ●— for app context menu.
|
||||||
|
|||||||
@@ -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
|
// 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
|
// 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).
|
// unrecognized (its layout may differ from what our patch set targets).
|
||||||
export const FLASHABLE_STOCK_VERSION = [2, 2, 9, 22];
|
export const BASE_STOCK_VERSION = [2, 2, 9, 22];
|
||||||
export const FLASHABLE_STOCK_VERSION_TEXT = FLASHABLE_STOCK_VERSION.join(".");
|
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[] {
|
function parseDottedVersion(version: string): number[] {
|
||||||
return version
|
return version
|
||||||
@@ -111,10 +113,12 @@ export function reportedFirmwareVersion(info: FirmwareInfo): string {
|
|||||||
* How the pre-flash firmware check should treat the connected glasses:
|
* How the pre-flash firmware check should treat the connected glasses:
|
||||||
* - "custom": Faceclaw's firmware is already installed — nothing to flash.
|
* - "custom": Faceclaw's firmware is already installed — nothing to flash.
|
||||||
* - "flashable-stock": stock firmware at or below the version we build from.
|
* - "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).
|
* - "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): {
|
export function classifyOnboardingFirmware(info: FirmwareInfo): {
|
||||||
kind: OnboardingFirmwareKind;
|
kind: OnboardingFirmwareKind;
|
||||||
@@ -127,8 +131,13 @@ export function classifyOnboardingFirmware(info: FirmwareInfo): {
|
|||||||
if (!version) {
|
if (!version) {
|
||||||
return { kind: "unknown", version: "" };
|
return { kind: "unknown", version: "" };
|
||||||
}
|
}
|
||||||
const comparison = compareVersions(parseDottedVersion(version), FLASHABLE_STOCK_VERSION);
|
if (compareVersions(parseDottedVersion(version), BASE_STOCK_VERSION) <= 0) {
|
||||||
return { kind: comparison <= 0 ? "flashable-stock" : "newer-stock", version };
|
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. */
|
/** Cached R1 battery reports in settings field 106 and query mode 17. */
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import {
|
|||||||
hasExtractedEvenHubFonts,
|
hasExtractedEvenHubFonts,
|
||||||
type FirmwareProgress,
|
type FirmwareProgress,
|
||||||
} from "../g2/firmware-builder";
|
} 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 { DeviceInfoProbe, DeviceInfoState } from "../native/device-info-probe";
|
||||||
import { setOnboardingCompleted, setPreviewOnlyMode } from "./onboarding-state";
|
import { setOnboardingCompleted, setPreviewOnlyMode } from "./onboarding-state";
|
||||||
import { formatErrorMessage } from "../util/format-error";
|
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 {
|
export class OnboardingFirmwareCheckViewModel extends Observable {
|
||||||
private _phase: CheckPhase = "checking";
|
private _phase: CheckPhase = "checking";
|
||||||
@@ -72,6 +72,7 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
|||||||
case "custom":
|
case "custom":
|
||||||
return "Finish";
|
return "Finish";
|
||||||
case "flashable":
|
case "flashable":
|
||||||
|
case "newer-validated":
|
||||||
return "Install Firmware";
|
return "Install Firmware";
|
||||||
case "newer":
|
case "newer":
|
||||||
return "Proceed Anyway";
|
return "Proceed Anyway";
|
||||||
@@ -107,6 +108,7 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
|||||||
this.finish();
|
this.finish();
|
||||||
return;
|
return;
|
||||||
case "flashable":
|
case "flashable":
|
||||||
|
case "newer-validated":
|
||||||
case "newer":
|
case "newer":
|
||||||
this.goToFlashing();
|
this.goToFlashing();
|
||||||
return;
|
return;
|
||||||
@@ -196,8 +198,8 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
|||||||
private applyClassification(kind: OnboardingFirmwareKind, version: string, capabilities: string): void {
|
private applyClassification(kind: OnboardingFirmwareKind, version: string, capabilities: string): void {
|
||||||
this.busy = false;
|
this.busy = false;
|
||||||
// `kind` is classifyOnboardingFirmware's OnboardingFirmwareKind ("custom" |
|
// `kind` is classifyOnboardingFirmware's OnboardingFirmwareKind ("custom" |
|
||||||
// "flashable-stock" | "newer-stock" | "unknown") -- NOT CheckPhase's shorter
|
// "flashable-stock" | "newer-stock-unvalidated" | "newer-stock-validated" | "unknown") -- NOT CheckPhase's shorter
|
||||||
// "flashable"/"newer" (used below via setPhase for _phase/primaryLabel/etc).
|
// "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
|
// 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
|
// 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
|
// `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 ` +
|
`Your glasses run stock firmware ${version}. This is compatible — tap Install Firmware to flash ` +
|
||||||
"Faceclaw's custom firmware.";
|
"Faceclaw's custom firmware.";
|
||||||
break;
|
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.setPhase("newer");
|
||||||
this.headline = "Unrecognized Firmware";
|
this.headline = "Unrecognized Firmware";
|
||||||
this.status =
|
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. " +
|
"release Faceclaw's custom image is built from. Flashing may not work correctly and carries extra risk. " +
|
||||||
"You can proceed anyway, or go back.";
|
"You can proceed anyway, or go back.";
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in new issue
Block a user