Porting onboarding/flashing flow io iOS

This commit is contained in:
James Babcock committed 2026-09-19 09:19:26 -07:00
1 parent 68b459751e
commit 64bf600ef9
46 files changed
+1419 -211

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
import { toData, fromData } from './kotlin-data'
declare const FaceclawCrypto: any
export function firmwareSha256(buffer: ArrayBuffer): string { return String(FaceclawCrypto.sha256(toData(new Uint8Array(buffer)))) }
export function writeFirmwareFile(path: string, buffer: ArrayBuffer): void {
if (!toData(new Uint8Array(buffer)).writeToFileAtomically(path, true)) throw new Error('Could not save the verified firmware image.')
}
export function readFirmwareFile(path: string): Uint8Array {
const data = NSData.dataWithContentsOfFile(path)
if (!data) throw new Error('Could not read the prepared firmware image.')
return fromData(data)
}