diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawEvenHubJsBridge.java b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawEvenHubJsBridge.java new file mode 100644 index 00000000..6e40bbef --- /dev/null +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawEvenHubJsBridge.java @@ -0,0 +1,34 @@ +package com.faceclaw.app; + +import android.os.Handler; +import android.os.Looper; +import android.webkit.JavascriptInterface; + +/** + * The object injected into a hosted EvenHub app's WebView as + * window.__faceclawEvenHub. The document-start shim (served inline by + * FaceclawEvenHubWebViewClient) wraps it in a promise-returning + * window.flutter_inappwebview.callHandler, which is what the EvenHub SDK + * actually talks to. + * + * JavascriptInterface methods run on a WebView-internal thread; everything + * is bounced to the main thread before touching the NativeScript listener. + */ +public class FaceclawEvenHubJsBridge { + private final FaceclawEvenHubListener listener; + private final Handler mainHandler = new Handler(Looper.getMainLooper()); + + public FaceclawEvenHubJsBridge(FaceclawEvenHubListener listener) { + this.listener = listener; + } + + @JavascriptInterface + public void postMessage(final String handlerName, final String argsJson, final int callId) { + mainHandler.post(new Runnable() { + @Override + public void run() { + listener.onEvenAppMessage(handlerName, argsJson, callId); + } + }); + } +} diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawEvenHubListener.java b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawEvenHubListener.java new file mode 100644 index 00000000..56ff2d61 --- /dev/null +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawEvenHubListener.java @@ -0,0 +1,18 @@ +package com.faceclaw.app; + +/** + * Callbacks from a hosted EvenHub app's WebView to the TypeScript host. + * All methods are delivered on the Android main thread (NativeScript's JS + * thread), regardless of which WebView-internal thread produced them. + */ +public interface FaceclawEvenHubListener { + /** + * The app invoked window.flutter_inappwebview.callHandler(handlerName, ...args). + * argsJson is the JSON-encoded argument array; callId identifies the + * promise to resolve via window.__fcResolve(callId, ok, value). + */ + void onEvenAppMessage(String handlerName, String argsJson, int callId); + + /** The WebView finished loading the app's page. */ + void onPageFinished(String url); +} diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawEvenHubWebViewClient.java b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawEvenHubWebViewClient.java new file mode 100644 index 00000000..4d89a8bf --- /dev/null +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawEvenHubWebViewClient.java @@ -0,0 +1,147 @@ +package com.faceclaw.app; + +import android.os.Handler; +import android.os.Looper; +import android.webkit.WebResourceRequest; +import android.webkit.WebResourceResponse; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.net.Uri; +import android.util.Log; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.Locale; + +/** + * Serves an unpacked EvenHub app's files to its WebView from a fake per-app + * https origin, entirely offline. HTML responses get the host bridge shim + * injected at the top of the document, guaranteeing + * window.flutter_inappwebview exists before any app JS runs (apps race + * waitForEvenAppBridge against 4-6s timeouts and silently fall back to demo + * modes if the handler appears late). + * + * shouldInterceptRequest runs on a WebView-internal thread; it only touches + * files, never the NativeScript runtime. Requests to other hosts fall + * through to the network (the manifest whitelist is not yet enforced). + */ +public class FaceclawEvenHubWebViewClient extends WebViewClient { + private static final String TAG = "FaceclawEvenHub"; + + private final String rootDir; + private final String host; + private final String injectScript; + private final FaceclawEvenHubListener listener; + private final Handler mainHandler = new Handler(Looper.getMainLooper()); + + public FaceclawEvenHubWebViewClient( + String rootDir, String host, String injectScript, FaceclawEvenHubListener listener) { + this.rootDir = rootDir; + this.host = host; + this.injectScript = injectScript; + this.listener = listener; + } + + @Override + public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) { + Uri url = request.getUrl(); + if (url == null || !host.equals(url.getHost())) { + return null; // External hosts: normal network handling. + } + String path = url.getPath(); + if (path == null || path.isEmpty() || path.equals("/")) { + path = "/index.html"; + } + try { + File root = new File(rootDir).getCanonicalFile(); + File target = new File(root, path.substring(1)).getCanonicalFile(); + if (!target.getPath().startsWith(root.getPath()) || !target.isFile()) { + Log.w(TAG, "404 " + path); + return new WebResourceResponse( + "text/plain", "utf-8", + new ByteArrayInputStream("not found".getBytes(StandardCharsets.UTF_8))); + } + String mime = mimeTypeFor(target.getName()); + if (mime.equals("text/html")) { + return new WebResourceResponse(mime, "utf-8", new ByteArrayInputStream(injectIntoHtml(target))); + } + InputStream stream = new FileInputStream(target); + return new WebResourceResponse(mime, null, stream); + } catch (IOException e) { + Log.e(TAG, "serve failed for " + path, e); + return new WebResourceResponse( + "text/plain", "utf-8", + new ByteArrayInputStream("error".getBytes(StandardCharsets.UTF_8))); + } + } + + @Override + public void onPageFinished(WebView view, final String url) { + mainHandler.post(new Runnable() { + @Override + public void run() { + listener.onPageFinished(url); + } + }); + } + + private byte[] injectIntoHtml(File file) throws IOException { + byte[] raw = readAll(file); + String html = new String(raw, StandardCharsets.UTF_8); + String tag = ""; + // After if present, else before everything. + int headIndex = indexOfIgnoreCase(html, "= 0) { + int close = html.indexOf('>', headIndex); + if (close >= 0) { + return (html.substring(0, close + 1) + tag + html.substring(close + 1)) + .getBytes(StandardCharsets.UTF_8); + } + } + return (tag + html).getBytes(StandardCharsets.UTF_8); + } + + private static int indexOfIgnoreCase(String haystack, String needle) { + return haystack.toLowerCase(Locale.ROOT).indexOf(needle); + } + + private static byte[] readAll(File file) throws IOException { + FileInputStream in = new FileInputStream(file); + try { + byte[] data = new byte[(int) file.length()]; + int off = 0; + while (off < data.length) { + int n = in.read(data, off, data.length - off); + if (n < 0) throw new IOException("short read: " + file); + off += n; + } + return data; + } finally { + in.close(); + } + } + + private static String mimeTypeFor(String name) { + String lower = name.toLowerCase(Locale.ROOT); + if (lower.endsWith(".html") || lower.endsWith(".htm")) return "text/html"; + if (lower.endsWith(".js") || lower.endsWith(".mjs")) return "application/javascript"; + if (lower.endsWith(".css")) return "text/css"; + if (lower.endsWith(".json")) return "application/json"; + if (lower.endsWith(".png")) return "image/png"; + if (lower.endsWith(".jpg") || lower.endsWith(".jpeg")) return "image/jpeg"; + if (lower.endsWith(".gif")) return "image/gif"; + if (lower.endsWith(".svg")) return "image/svg+xml"; + if (lower.endsWith(".webp")) return "image/webp"; + if (lower.endsWith(".ico")) return "image/x-icon"; + if (lower.endsWith(".wasm")) return "application/wasm"; + if (lower.endsWith(".woff")) return "font/woff"; + if (lower.endsWith(".woff2")) return "font/woff2"; + if (lower.endsWith(".ttf")) return "font/ttf"; + if (lower.endsWith(".txt") || lower.endsWith(".map")) return "text/plain"; + return "application/octet-stream"; + } +} diff --git a/app/apps/all-apps.ts b/app/apps/all-apps.ts index 716f16a9..aef8d27f 100644 --- a/app/apps/all-apps.ts +++ b/app/apps/all-apps.ts @@ -17,6 +17,7 @@ import minesweeperApp from "./minesweeper"; import freecellApp from "./freecell"; import pinballApp from "./pinball"; import debugTestsApp from "./debug-tests"; +import evenhubApp from "./evenhub"; import settingsApp from "./settings"; /** @@ -43,5 +44,6 @@ export const ALL_APPS: readonly AppDefinition[] = [ freecellApp, pinballApp, debugTestsApp, + evenhubApp, settingsApp, ]; diff --git a/app/apps/evenhub/compositor.ts b/app/apps/evenhub/compositor.ts new file mode 100644 index 00000000..2c870b66 --- /dev/null +++ b/app/apps/evenhub/compositor.ts @@ -0,0 +1,135 @@ +/** + * Phone-side reimplementation of the on-glasses EvenHub page compositor: + * containers render into the 576x288 canvas the stock firmware gives apps. + * + * Known deviations from stock, acceptable for now: + * - Text uses Terminus 24 rather than the firmware's proportional LVGL font, + * so grid-aligned/padded layouts won't line up exactly (see + * notes/evenhub_compatibility.txt section 6 for the extraction plan). + * - List rendering is a plain vertical list; itemWidth-based horizontal + * layouts are not implemented yet. + */ +import { GrayImage } from "../../graphics/image"; +import { getFont } from "../../graphics/bdffont"; +import { + type EvenHubContainer, + type EvenHubImageContainer, + type EvenHubListContainer, + type EvenHubPage, + type EvenHubTextContainer, +} from "./containers"; + +export const EVENHUB_SCREEN_WIDTH = 576; +export const EVENHUB_SCREEN_HEIGHT = 288; + +const TEXT_WHITE = 255; +const LIST_ROW_PADDING = 4; + +function containerFont() { + return getFont("terminus24"); +} + +/** Chars the font lacks are skipped silently on stock (no tofu); drawText + * already skips unknown glyphs, matching that. */ +function paintTextContainer(image: GrayImage, container: EvenHubTextContainer): void { + paintBorder(image, container); + const inset = container.borderWidth + container.paddingLength; + const font = containerFont(); + image.drawTextWrapped({ + font, + x: container.x + inset, + y: container.y + inset, + width: Math.max(1, container.width - 2 * inset), + text: container.content, + value: TEXT_WHITE, + }); +} + +function paintBorder( + image: GrayImage, + container: { x: number; y: number; width: number; height: number; borderWidth: number; borderRadius: number }, +): void { + for (let i = 0; i < container.borderWidth; i++) { + if (container.borderRadius > 0) { + image.drawRoundedRect( + container.x + i, + container.y + i, + container.width - 2 * i, + container.height - 2 * i, + TEXT_WHITE, + Math.max(0, container.borderRadius - i), + ); + } else { + image.drawRect(container.x + i, container.y + i, container.width - 2 * i, container.height - 2 * i, TEXT_WHITE); + } + } +} + +function paintImageContainer(image: GrayImage, container: EvenHubImageContainer): void { + if (!container.pixels || container.pixelsWidth <= 0 || container.pixelsHeight <= 0) return; + const source = new GrayImage(container.pixelsWidth, container.pixelsHeight, 0); + source.pixels.set(container.pixels); + // Stock quirk: raw data smaller than the container tiles/repeats to fill it. + for (let ty = 0; ty < container.height; ty += container.pixelsHeight) { + for (let tx = 0; tx < container.width; tx += container.pixelsWidth) { + image.bitBlt(source, container.x + tx, container.y + ty, { + width: Math.min(container.pixelsWidth, container.width - tx), + height: Math.min(container.pixelsHeight, container.height - ty), + }); + } + } +} + +function paintListContainer(image: GrayImage, container: EvenHubListContainer, focused: boolean): void { + paintBorder(image, container); + const font = containerFont(); + const inset = container.borderWidth + container.paddingLength; + const rowHeight = font.lineHeight + LIST_ROW_PADDING; + const left = container.x + inset; + const top = container.y + inset; + const width = Math.max(1, container.width - 2 * inset); + const visibleRows = Math.max(1, Math.floor((container.height - 2 * inset) / rowHeight)); + // Keep the selection in view. + let firstRow = 0; + if (container.selectedIndex >= visibleRows) firstRow = container.selectedIndex - visibleRows + 1; + for (let row = 0; row < visibleRows; row++) { + const index = firstRow + row; + if (index >= container.itemNames.length) break; + const y = top + row * rowHeight; + const selected = index === container.selectedIndex; + if (selected && focused) { + image.fillRect(left, y, width, rowHeight - 1, 40); + } + if (selected && container.selectBorder) { + image.drawRect(left, y, width, rowHeight - 1, TEXT_WHITE); + } + image.drawText(font, left + 2, y + Math.floor(LIST_ROW_PADDING / 2), container.itemNames[index]!, TEXT_WHITE); + } +} + +/** Containers with a zOrderIndex sort by it; the rest keep declaration order. */ +function paintOrder(containers: EvenHubContainer[]): EvenHubContainer[] { + const anyZ = containers.some((c) => c.zOrderIndex !== undefined); + if (!anyZ) return containers; + return [...containers].sort((a, b) => (a.zOrderIndex ?? 0) - (b.zOrderIndex ?? 0)); +} + +/** Render a page into a fresh app-viewport image (positioned by the shell). */ +export function compositePage(page: EvenHubPage | null, size: { width: number; height: number }, focused: boolean): GrayImage { + const image = new GrayImage(size.width, size.height, 0); + if (!page) return image; + for (const container of paintOrder(page.containers)) { + switch (container.kind) { + case "image": + paintImageContainer(image, container); + break; + case "text": + paintTextContainer(image, container); + break; + case "list": + paintListContainer(image, container, focused); + break; + } + } + return image; +} diff --git a/app/apps/evenhub/containers.ts b/app/apps/evenhub/containers.ts new file mode 100644 index 00000000..5578b865 --- /dev/null +++ b/app/apps/evenhub/containers.ts @@ -0,0 +1,192 @@ +/** + * EvenHub page-container model and lenient JSON parsing. + * + * Hosts and apps in the wild emit both camelCase and protobuf names + * (Container_ID), and numbers sometimes arrive as strings, so all field + * reads go through loose key matching (the SDK's pickLoose behavior). + */ + +export type EvenHubTextContainer = { + kind: "text"; + id: number; + name: string; + x: number; + y: number; + width: number; + height: number; + borderWidth: number; + borderRadius: number; + paddingLength: number; + isEventCapture: boolean; + zOrderIndex: number | undefined; + content: string; +}; + +export type EvenHubImageContainer = { + kind: "image"; + id: number; + name: string; + x: number; + y: number; + width: number; + height: number; + zOrderIndex: number | undefined; + /** Decoded 8bpp grayscale, set by updateImageRawData; null until first update. */ + pixels: Uint8Array | null; + pixelsWidth: number; + pixelsHeight: number; +}; + +export type EvenHubListContainer = { + kind: "list"; + id: number; + name: string; + x: number; + y: number; + width: number; + height: number; + borderWidth: number; + borderRadius: number; + paddingLength: number; + isEventCapture: boolean; + zOrderIndex: number | undefined; + itemNames: string[]; + itemWidth: number; + selectBorder: boolean; + /** Selection is host-local: scroll moves it with no app round-trip. */ + selectedIndex: number; +}; + +export type EvenHubContainer = EvenHubTextContainer | EvenHubImageContainer | EvenHubListContainer; + +export type EvenHubPage = { + /** In declaration order (lists, images, texts); z-sorted at paint time. */ + containers: EvenHubContainer[]; +}; + +function normalizeKey(key: string): string { + return key.replace(/_/g, "").toLowerCase(); +} + +function pickLoose(obj: Record, key: string): unknown { + if (key in obj) return obj[key]; + const wanted = normalizeKey(key); + for (const k of Object.keys(obj)) { + if (normalizeKey(k) === wanted) return obj[k]; + } + return undefined; +} + +export function readNumber(obj: Record, key: string, fallback: number): number { + const value = pickLoose(obj, key); + if (typeof value === "number" && Number.isFinite(value)) return value; + if (typeof value === "string") { + const parsed = Number(value); + if (Number.isFinite(parsed)) return parsed; + } + return fallback; +} + +export function readOptionalNumber(obj: Record, key: string): number | undefined { + const value = readNumber(obj, key, Number.NaN); + return Number.isNaN(value) ? undefined : value; +} + +export function readString(obj: Record, key: string, fallback: string): string { + const value = pickLoose(obj, key); + if (typeof value === "string") return value; + if (typeof value === "number" || typeof value === "boolean") return String(value); + return fallback; +} + +export function asRecord(value: unknown): Record { + return value && typeof value === "object" && !Array.isArray(value) ? (value as Record) : {}; +} + +function parseTextContainer(json: Record): EvenHubTextContainer { + return { + kind: "text", + id: readNumber(json, "containerID", 0), + name: readString(json, "containerName", ""), + x: readNumber(json, "xPosition", 0), + y: readNumber(json, "yPosition", 0), + width: readNumber(json, "width", 0), + height: readNumber(json, "height", 0), + borderWidth: readNumber(json, "borderWidth", 0), + borderRadius: readNumber(json, "borderRadius", 0), + paddingLength: readNumber(json, "paddingLength", 0), + isEventCapture: readNumber(json, "isEventCapture", 0) !== 0, + zOrderIndex: readOptionalNumber(json, "zOrderIndex"), + content: readString(json, "content", ""), + }; +} + +function parseImageContainer(json: Record): EvenHubImageContainer { + return { + kind: "image", + id: readNumber(json, "containerID", 0), + name: readString(json, "containerName", ""), + x: readNumber(json, "xPosition", 0), + y: readNumber(json, "yPosition", 0), + width: readNumber(json, "width", 0), + height: readNumber(json, "height", 0), + zOrderIndex: readOptionalNumber(json, "zOrderIndex"), + pixels: null, + pixelsWidth: 0, + pixelsHeight: 0, + }; +} + +function parseListContainer(json: Record): EvenHubListContainer { + const itemContainer = asRecord(pickLoose(json, "itemContainer")); + const itemNamesRaw = pickLoose(itemContainer, "itemName"); + const itemNames = Array.isArray(itemNamesRaw) ? itemNamesRaw.map(String) : []; + return { + kind: "list", + id: readNumber(json, "containerID", 0), + name: readString(json, "containerName", ""), + x: readNumber(json, "xPosition", 0), + y: readNumber(json, "yPosition", 0), + width: readNumber(json, "width", 0), + height: readNumber(json, "height", 0), + borderWidth: readNumber(json, "borderWidth", 0), + borderRadius: readNumber(json, "borderRadius", 0), + paddingLength: readNumber(json, "paddingLength", 0), + isEventCapture: readNumber(json, "isEventCapture", 0) !== 0, + zOrderIndex: readOptionalNumber(json, "zOrderIndex"), + itemNames, + itemWidth: readNumber(itemContainer, "itemWidth", 0), + selectBorder: readNumber(itemContainer, "isItemSelectBorderEn", 0) !== 0, + selectedIndex: 0, + }; +} + +/** + * Parse a CreateStartUpPageContainer / RebuildPageContainer payload into a + * page. Containers keep declaration order within and across the three arrays + * (lists, then images, then texts — texts last so info panels and capture + * containers sit above image tiles when no zOrderIndex is given). + */ +export function parsePage(data: Record): EvenHubPage { + const containers: EvenHubContainer[] = []; + const lists = pickLoose(data, "listObject"); + if (Array.isArray(lists)) { + for (const item of lists) containers.push(parseListContainer(asRecord(item))); + } + const images = pickLoose(data, "imageObject"); + if (Array.isArray(images)) { + for (const item of images) containers.push(parseImageContainer(asRecord(item))); + } + const texts = pickLoose(data, "textObject"); + if (Array.isArray(texts)) { + for (const item of texts) containers.push(parseTextContainer(asRecord(item))); + } + return { containers }; +} + +/** The container that owns gesture events (exactly one per valid page). */ +export function eventCaptureContainer(page: EvenHubPage): EvenHubContainer | undefined { + return page.containers.find( + (container) => container.kind !== "image" && container.isEventCapture, + ); +} diff --git a/app/apps/evenhub/ehpk.ts b/app/apps/evenhub/ehpk.ts new file mode 100644 index 00000000..3c1c42de --- /dev/null +++ b/app/apps/evenhub/ehpk.ts @@ -0,0 +1,133 @@ +/** + * EvenHub .ehpk package unpacking. + * + * The .ehpk produced by `evenhub pack` (@evenrealities/evenhub-cli) is a + * custom record container holding the app's dist/ tree plus app.json, each + * entry zstd-compressed and XORed with the repeating ASCII key + * "EVEN REALITIES" (key index resets per field). Format details are in + * ../../../../ehpk-unpacker/ehpk_unpack.py, the reference implementation + * this ports. The trailing record is a SHA-512 of everything before it — + * an integrity check only, not a signature; we skip verifying it. + */ +import { decompress } from "fzstd"; + +const XOR_KEY = "EVEN REALITIES"; + +const RECORD_FILE = 0xe4; +const RECORD_DIR = 0xe5; +const RECORD_FOOTER = 0xe3; + +export type EhpkArchive = { + /** Relative path (e.g. "app.json", "dist/index.html") to contents. */ + files: Map; +}; + +/** The app.json manifest fields Faceclaw cares about (both spec generations). */ +export type EvenHubManifest = { + packageId: string; + name: string; + version: string; + /** Entry file relative to dist/ (default index.html). */ + entrypoint: string; + /** Hosts the app declares it will reach; not yet enforced. */ + networkWhitelist: string[]; + raw: Record; +}; + +function unxor(data: Uint8Array, start: number, length: number): Uint8Array { + const out = new Uint8Array(length); + for (let i = 0; i < length; i++) { + out[i] = data[start + i]! ^ XOR_KEY.charCodeAt(i % XOR_KEY.length); + } + return out; +} + +export function utf8Decode(bytes: Uint8Array): string { + let out = ""; + let i = 0; + while (i < bytes.length) { + const b = bytes[i]!; + if (b < 0x80) { + out += String.fromCharCode(b); + i += 1; + } else if (b < 0xe0) { + out += String.fromCharCode(((b & 0x1f) << 6) | (bytes[i + 1]! & 0x3f)); + i += 2; + } else if (b < 0xf0) { + out += String.fromCharCode(((b & 0x0f) << 12) | ((bytes[i + 1]! & 0x3f) << 6) | (bytes[i + 2]! & 0x3f)); + i += 3; + } else { + const cp = + ((b & 0x07) << 18) | ((bytes[i + 1]! & 0x3f) << 12) | ((bytes[i + 2]! & 0x3f) << 6) | (bytes[i + 3]! & 0x3f); + out += String.fromCodePoint(cp); + i += 4; + } + } + return out; +} + +export function parseEhpk(data: Uint8Array): EhpkArchive { + if (data.length < 20 || data[0] !== 0x45 || data[1] !== 0x48 || data[2] !== 0x50 || data[3] !== 0x4b) { + throw new Error("not an EHPK file"); + } + const view = new DataView(data.buffer, data.byteOffset, data.byteLength); + const firstRecord = view.getUint32(8, true); + const files = new Map(); + + let p = firstRecord; + while (p < data.length) { + const type = data[p]!; + if (data[p + 1] !== 0xba || data[p + 2] !== 0xa9 || data[p + 3] !== 0xba) { + throw new Error(`ehpk: bad record magic at ${p}`); + } + if (type === RECORD_FILE) { + const compressedLength = view.getUint32(p + 4, true); + const uncompressedLength = view.getUint32(p + 8, true); + const nameLength = view.getUint16(p + 14, true); + const name = utf8Decode(unxor(data, p + 16, nameLength)); + const blob = unxor(data, p + 16 + nameLength, compressedLength); + const content = decompress(blob, new Uint8Array(uncompressedLength)); + if (content.length !== uncompressedLength) { + throw new Error(`ehpk: ${name}: expected ${uncompressedLength} bytes, got ${content.length}`); + } + files.set(name, content); + p += 16 + nameLength + compressedLength; + } else if (type === RECORD_DIR) { + const nameLength = view.getUint16(p + 6, true); + p += 8 + nameLength; + } else if (type === RECORD_FOOTER) { + break; + } else { + throw new Error(`ehpk: unknown record type 0x${type.toString(16)} at ${p}`); + } + } + return { files }; +} + +/** + * Parse app.json, accepting both the older manifest shape (permissions as a + * {"network": [...]} map) and the current one (array of {name, whitelist?}). + */ +export function parseManifest(appJsonText: string): EvenHubManifest { + const raw = JSON.parse(appJsonText) as Record; + const packageId = String(raw.package_id ?? raw.packageId ?? "unknown.package"); + const name = String(raw.name ?? packageId); + const version = String(raw.version ?? "0"); + const entrypoint = String(raw.entrypoint ?? "index.html"); + + const networkWhitelist: string[] = []; + const permissions = raw.permissions; + if (Array.isArray(permissions)) { + for (const perm of permissions) { + if (perm && typeof perm === "object" && (perm as Record).name === "network") { + const whitelist = (perm as Record).whitelist; + if (Array.isArray(whitelist)) networkWhitelist.push(...whitelist.map(String)); + } + } + } else if (permissions && typeof permissions === "object") { + const network = (permissions as Record).network; + if (Array.isArray(network)) networkWhitelist.push(...network.map(String)); + } + + return { packageId, name, version, entrypoint, networkWhitelist, raw }; +} diff --git a/app/apps/evenhub/evenhub-window.ts b/app/apps/evenhub/evenhub-window.ts new file mode 100644 index 00000000..3e8c9770 --- /dev/null +++ b/app/apps/evenhub/evenhub-window.ts @@ -0,0 +1,92 @@ +/** + * The glasses-side window for a running EvenHub app: a layer that paints the + * session's composited page and forwards gestures to it. heightMode "medium" + * makes the content area exactly the 576x288 surface EvenHub apps expect. + */ +import { GrayImage } from "../../graphics/image"; +import { type DashboardInputEvent, type Layer, type LayerContext } from "../../ui/layers"; +import { MenuLayer } from "../../ui/menu"; +import { WINDOW_MENU_LAYOUT } from "../../ui/window-menu"; +import { + createInProcessWindow, + type InProcessAppOptions, + type InProcessWindow, +} from "../../ui/shell/in-process-window"; +import { shell } from "../../ui/shell/shell"; +import { EvenHubSession } from "./session"; + +class EvenHubAppLayer implements Layer { + constructor(private readonly session: EvenHubSession) {} + + paint(ctx: LayerContext): GrayImage { + const size = ctx.stack.getBaseSize(); + return this.session.paint(size, ctx.stack.isFocused()); + } + + handleInput(event: DashboardInputEvent): void { + // Everything goes to the app; long-press never reaches here (the window + // menu intercepts it), which is the guaranteed way out since EvenHub + // apps own double-click. + this.session.handleGesture(event); + } +} + +/** The stock exit confirm shown for shutDownPageContainer(1). */ +class ExitConfirmLayer extends MenuLayer { + constructor(session: EvenHubSession, appName: string) { + let answered = false; + const answer = (ctx: LayerContext, exit: boolean) => { + if (answered) return; + answered = true; + ctx.stack.pop(); + session.exitDialogAnswer(exit); + }; + super(`Exit ${appName}?`, [ + { label: "No", onSelect: (ctx) => answer(ctx, false) }, + { label: "Yes", onSelect: (ctx) => answer(ctx, true) }, + ], WINDOW_MENU_LAYOUT); + } +} + +export function createEvenHubWindow( + windowId: string, + session: EvenHubSession, + options: InProcessAppOptions, +): InProcessWindow { + const created = createInProcessWindow({ + appId: "evenhub", + windowId, + title: session.manifest.name, + iconLetter: session.manifest.name.charAt(0).toUpperCase() || "E", + closeable: true, + heightMode: "medium", + actions: options.actions, + baseLayer: new EvenHubAppLayer(session), + submitFrame: options.submitFrame, + setSurfaceVisible: options.setSurfaceVisible, + removeSurface: options.removeSurface, + onClosed: () => { + options.onClosed(); + session.windowClosed(); + }, + }); + + session.attachWindow({ + requestRender: created.requestRender, + closeWindow: () => shell.closeWindow(windowId), + openExitDialog: () => { + if (!created.stack.topMatches((layer) => layer instanceof ExitConfirmLayer)) { + created.stack.push(new ExitConfirmLayer(session, session.manifest.name)); + } + }, + }); + + // FOREGROUND_ENTER/EXIT for the app on shell focus changes. + const baseSetForeground = created.window.setForeground; + created.window.setForeground = (foreground) => { + baseSetForeground?.(foreground); + session.setForeground(foreground); + }; + + return created; +} diff --git a/app/apps/evenhub/index.ts b/app/apps/evenhub/index.ts new file mode 100644 index 00000000..a9f13786 --- /dev/null +++ b/app/apps/evenhub/index.ts @@ -0,0 +1,94 @@ +/** + * EvenHub compatibility host: runs apps built for Even Realities' EvenHub + * API (webview apps talking to the glasses through the phone) inside + * Faceclaw. Launched by picking an .ehpk file in the Files app; the app gets + * a phone WebView (its runtime + phone UI) and a 576x288 glasses window + * composited by Faceclaw instead of the stock firmware. + * + * Design notes: notes/evenhub_compatibility.txt. + */ +import { Frame } from "@nativescript/core"; +import { type AppContext, type AppDefinition } from "../app-definition"; +import { shell } from "../../ui/shell/shell"; +import { + appFilesDirPath, + deletePathRecursively, + readBinaryFile, + writeBinaryFile, +} from "../../native/file-access"; +import { parseEhpk, parseManifest, utf8Decode } from "./ehpk"; +import { EvenHubSession } from "./session"; +import { createEvenHubWindow } from "./evenhub-window"; + +const EVENHUB_WINDOW_ID = "evenhub:app"; + +let activeSession: EvenHubSession | null = null; + +export function getActiveEvenHubSession(): EvenHubSession | null { + return activeSession; +} + +/** + * Unpack an .ehpk and launch it: glasses window plus the phone WebView page. + * Only one EvenHub app runs at a time for now; opening another closes the + * previous one. + */ +export async function openEvenHubPackage(ctx: AppContext, ehpkPath: string): Promise { + const data = readBinaryFile(ehpkPath); + if (!data) { + ctx.appendLog(`evenhub: could not read ${ehpkPath}`); + return; + } + const archive = parseEhpk(data); + const appJson = archive.files.get("app.json"); + if (!appJson) { + ctx.appendLog("evenhub: package has no app.json"); + return; + } + const manifest = parseManifest(utf8Decode(appJson)); + + if (activeSession && !activeSession.isClosed()) { + activeSession.close(); + } + + // Unpack fresh into app-private storage, keyed by package id. + const safeId = manifest.packageId.replace(/[^A-Za-z0-9._-]/g, "_"); + const baseDir = `${appFilesDirPath()}/evenhub-apps/${safeId}`; + deletePathRecursively(baseDir); + for (const [name, content] of archive.files) { + if (!writeBinaryFile(`${baseDir}/${name}`, content)) { + ctx.appendLog(`evenhub: failed to write ${name}`); + return; + } + } + + const session = new EvenHubSession(manifest, `${baseDir}/dist`, ctx.appendLog); + activeSession = session; + ctx.appendLog(`evenhub: launching ${manifest.name} ${manifest.version} (${manifest.packageId})`); + + await ctx.launchInProcessApp(EVENHUB_WINDOW_ID, `window:${EVENHUB_WINDOW_ID}`, (options) => + createEvenHubWindow(EVENHUB_WINDOW_ID, session, options), + ); + + Frame.topmost()?.navigate({ moduleName: "phone-ui/evenhub-page" }); +} + +const evenhubApp: AppDefinition = { + appId: "evenhub", + title: "EvenHub", + icon: "package", + // Launching happens by opening an .ehpk in Files; the grid entry would + // have nothing to open. + showInLauncher: false, + launch: async (ctx) => { + const existing = shell.getWindows().find((window) => window.appId === "evenhub"); + if (existing) { + shell.focusWindow(existing.windowId); + ctx.requestShellRender(); + } else { + ctx.appendLog("EvenHub apps launch from .ehpk files in the Files app"); + } + }, +}; + +export default evenhubApp; diff --git a/app/apps/evenhub/session.ts b/app/apps/evenhub/session.ts new file mode 100644 index 00000000..95ab8762 --- /dev/null +++ b/app/apps/evenhub/session.ts @@ -0,0 +1,576 @@ +/** + * One running EvenHub app: the host side of the SDK's + * flutter_inappwebview.callHandler('evenAppMessage', ...) contract, the page + * container state, and the glue between the phone WebView and the glasses + * window. Wire shapes were captured empirically from even_hub_sdk 0.0.12 + * (see notes/evenhub_compatibility.txt). + * + * Wire contract summary: + * - Web -> host: callHandler('evenAppMessage', '') where the JSON is + * {type: "call_even_app_method", method, data?}. The handler's return + * value resolves the app-side promise (no response postMessage). + * - Host -> web: call window._listenEvenAppMessage({type: + * "listen_even_app_data", method, data}); for method "evenHubEvent", data + * is {type: "sysEvent"|"textEvent"|"listEvent", jsonData: {...}}. + * - Return values: createStartUpPageContainer -> int 0..3; + * updateImageRawData -> int 0..3 or enum string; rebuild/textUpgrade/ + * shutDown/setLocalStorage -> boolean; getLocalStorage -> string; + * getUserInfo/getGlassesInfo -> plain JSON objects (not strings). + */ +import { ApplicationSettings } from "@nativescript/core"; +import { GrayImage } from "../../graphics/image"; +import { getFont } from "../../graphics/bdffont"; +import { type DashboardInputEvent } from "../../ui/layers"; +import { + asRecord, + eventCaptureContainer, + parsePage, + readNumber, + readOptionalNumber, + readString, + type EvenHubImageContainer, + type EvenHubListContainer, + type EvenHubPage, +} from "./containers"; +import { compositePage } from "./compositor"; +import { type EvenHubManifest } from "./ehpk"; + +const UPNG = require("upng-js"); + +/** OsEventTypeList values (PB ordinals). */ +const CLICK_EVENT = 0; +const SCROLL_TOP_EVENT = 1; +const SCROLL_BOTTOM_EVENT = 2; +const DOUBLE_CLICK_EVENT = 3; +const FOREGROUND_ENTER_EVENT = 4; +const FOREGROUND_EXIT_EVENT = 5; +const SYSTEM_EXIT_EVENT = 7; + +/** + * Injected into every served HTML document at document start (before any app + * JS): the promise-returning flutter_inappwebview.callHandler the EvenHub + * SDK expects, backed by the FaceclawEvenHubJsBridge Java object. Kept in + * ES5 so it runs on any webview. + */ +export const EVENHUB_BRIDGE_INJECT_SCRIPT = ` +(function () { + if (window.flutter_inappwebview && window.flutter_inappwebview.callHandler) return; + var pending = {}; + var nextId = 1; + window.__fcResolve = function (id, ok, value) { + var entry = pending[id]; + if (!entry) return; + delete pending[id]; + (ok ? entry[0] : entry[1])(value); + }; + window.flutter_inappwebview = { + callHandler: function (name) { + var args = Array.prototype.slice.call(arguments, 1); + return new Promise(function (resolve, reject) { + var id = nextId++; + pending[id] = [resolve, reject]; + window.__faceclawEvenHub.postMessage(String(name), JSON.stringify(args), id); + }); + } + }; +})(); +`; + +/** How long after SYSTEM_EXIT the webview stays alive so the app can save. */ +const EXIT_GRACE_MS = 1500; +/** Stock blocks a repeated createStartUpPageContainer ~2s before failing it. */ +const DUPLICATE_CREATE_DELAY_MS = 2000; + +export type EvenHubPageHandle = { + /** Run JS inside the app's WebView (must be called on the main thread). */ + evaluateJs: (js: string) => void; + /** Tear the phone page down (navigate back if it is current). */ + closePage: () => void; +}; + +export type EvenHubWindowHooks = { + requestRender: () => void; + closeWindow: () => void; + /** Push the on-glasses exit confirm; answers come back via exitDialogAnswer. */ + openExitDialog: () => void; +}; + +export class EvenHubSession { + readonly manifest: EvenHubManifest; + readonly distDir: string; + + private page: EvenHubPage | null = null; + private pageCreated = false; + private pageHandle: EvenHubPageHandle | null = null; + private windowHooks: EvenHubWindowHooks | null = null; + private closed = false; + private launchContextPushed = false; + private systemExitSent = false; + private graceCloseTimer: ReturnType | null = null; + private log: (message: string) => void; + + constructor(manifest: EvenHubManifest, distDir: string, log: (message: string) => void) { + this.manifest = manifest; + this.distDir = distDir; + this.log = log; + } + + // ----- phone page wiring ----- + + attachPage(handle: EvenHubPageHandle): void { + this.pageHandle = handle; + } + + /** The WebView finished loading the app: push the one-shot launch context. */ + pageFinished(): void { + if (this.launchContextPushed) return; + this.launchContextPushed = true; + // Launched to drive the glasses (from the on-glasses file browser), so + // apps that branch on this should take their glasses path. + this.pushMessage("evenAppLaunchSource", { launchSource: "glassesMenu" }); + this.pushMessage("deviceStatusChanged", { + sn: "FACECLAW-G2", + connectType: "connected", + isWearing: true, + batteryLevel: 100, + isCharging: false, + isInCase: false, + }); + } + + /** The phone page went away (back navigation); the webview is gone too. */ + pageGone(): void { + this.pageHandle = null; + this.close(); + } + + // ----- glasses window wiring ----- + + attachWindow(hooks: EvenHubWindowHooks): void { + this.windowHooks = hooks; + } + + windowClosed(): void { + this.windowHooks = null; + this.close(); + } + + paint(size: { width: number; height: number }, focused: boolean): GrayImage { + if (!this.pageCreated || !this.page) { + const image = new GrayImage(size.width, size.height, 0); + const font = getFont("terminus24"); + image.drawText(font, 16, 16, `Loading ${this.manifest.name}...`, 255); + image.drawText(font, 16, 16 + 2 * font.lineHeight, "(waiting for the app to build its page)", 120); + return image; + } + return compositePage(this.page, size, focused); + } + + /** + * Route a gesture to the app, emulating stock hardware: clicks and + * double-clicks arrive as sysEvent (never textEvent) with zero-valued + * fields elided the way protobuf JSON elides them; list selection moves + * locally with events only for clicks and boundary scrolls. + */ + handleGesture(event: DashboardInputEvent): void { + if (!this.page) return; + const capture = this.page ? eventCaptureContainer(this.page) : undefined; + switch (event.type) { + case "click": + if (capture?.kind === "list") { + this.emitListEvent(capture, CLICK_EVENT); + } else { + this.emitSysEvent(CLICK_EVENT, gestureSource(event.source)); + } + break; + case "double-click": + this.emitSysEvent(DOUBLE_CLICK_EVENT, gestureSource(event.source)); + break; + case "scroll-up": + case "scroll-down": { + const eventType = event.type === "scroll-up" ? SCROLL_TOP_EVENT : SCROLL_BOTTOM_EVENT; + if (capture?.kind === "list") { + this.scrollList(capture, eventType); + } else { + this.emitSysEvent(eventType, 0); + } + break; + } + default: + break; + } + } + + private scrollList(list: EvenHubListContainer, eventType: number): void { + const delta = eventType === SCROLL_TOP_EVENT ? 1 : -1; + const next = list.selectedIndex + delta; + if (next < 0 || next >= list.itemNames.length) { + // At a boundary the selection stays put and the app hears about it. + this.emitListEvent(list, eventType); + return; + } + list.selectedIndex = next; + this.windowHooks?.requestRender(); + } + + setForeground(foreground: boolean): void { + if (!this.pageCreated) return; + this.emitSysEvent(foreground ? FOREGROUND_ENTER_EVENT : FOREGROUND_EXIT_EVENT, 0); + } + + /** The on-glasses exit confirm was answered. */ + exitDialogAnswer(exit: boolean): void { + if (exit) { + this.emitSysEvent(SYSTEM_EXIT_EVENT, 0); + this.systemExitSent = true; + // Give the app a beat to persist state; it usually calls + // shutDownPageContainer(0) well before this fires. + this.graceCloseTimer = setTimeout(() => this.close(), EXIT_GRACE_MS); + } else { + this.emitSysEvent(FOREGROUND_EXIT_EVENT, 0); + } + } + + // ----- bridge calls (web -> host) ----- + + /** + * Handle one callHandler('evenAppMessage', ...) invocation. argsJson is the + * JSON array of handler arguments; args[0] is the SDK's message JSON string + * (kept lenient: a bare object works too). + */ + handleBridgeCall(handlerName: string, argsJson: string, callId: number): void { + void (async () => { + let result: unknown = null; + try { + if (handlerName !== "evenAppMessage") throw new Error(`unknown handler ${handlerName}`); + const args = JSON.parse(argsJson) as unknown[]; + const first = args[0]; + const message = asRecord(typeof first === "string" ? JSON.parse(first) : first); + const method = readString(message, "method", ""); + const data = asRecord(message.data); + result = await this.dispatch(method, data); + } catch (error) { + this.log(`evenhub bridge call failed: ${error}`); + this.resolveCall(callId, false, String(error)); + return; + } + this.resolveCall(callId, true, result); + })(); + } + + private async dispatch(method: string, data: Record): Promise { + switch (method) { + case "createStartUpPageContainer": + return this.createStartUpPage(data); + case "rebuildPageContainer": + return this.rebuildPage(data); + case "textContainerUpgrade": + return this.textUpgrade(data); + case "updateImageRawData": + return this.updateImage(data); + case "shutDownPageContainer": + return this.shutDown(readNumber(data, "exitMode", 0)); + case "setLocalStorage": + ApplicationSettings.setString(this.storageKey(readString(data, "key", "")), readString(data, "value", "")); + return true; + case "getLocalStorage": + return ApplicationSettings.getString(this.storageKey(readString(data, "key", "")), ""); + case "getUserInfo": + return { uid: 0, name: "Faceclaw", avatar: "", country: "" }; + case "getGlassesInfo": + return { + model: "g2", + sn: "FACECLAW-G2", + status: { + sn: "FACECLAW-G2", + connectType: "connected", + isWearing: true, + batteryLevel: 100, + isCharging: false, + isInCase: false, + }, + }; + // Unsupported surface (mic, IMU, location, pickers): fail politely. + case "audioControl": + case "imuControl": + case "startAppLocationUpdates": + case "stopAppLocationUpdates": + return false; + case "getAppLocation": + case "pickImageFromAlbum": + case "captureImageFromCamera": + return null; + default: + this.log(`evenhub: unhandled method ${method}`); + return null; + } + } + + /** EhStartUpPageCreateResult: 0 success, 1 invalid, 2 oversize, 3 outOfMemory. */ + private async createStartUpPage(data: Record): Promise { + if (this.pageCreated) { + // One-shot per session on stock: a second call blocks ~2s, then fails. + await delay(DUPLICATE_CREATE_DELAY_MS); + return 1; + } + const page = parsePage(data); + this.warnOnInvalidPage(page); + this.page = page; + this.pageCreated = true; + this.windowHooks?.requestRender(); + return 0; + } + + private rebuildPage(data: Record): boolean { + // Also serves as create for apps that fall back to rebuild-on-error. + const page = parsePage(data); + this.warnOnInvalidPage(page); + this.page = page; + this.pageCreated = true; + this.windowHooks?.requestRender(); + return true; + } + + private warnOnInvalidPage(page: EvenHubPage): void { + // Stock rejects these outright; we accept-and-log until rejection is + // proven necessary for compatibility. + const captures = page.containers.filter((c) => c.kind !== "image" && c.isEventCapture).length; + if (captures !== 1) this.log(`evenhub: page has ${captures} event-capture containers (stock requires exactly 1)`); + const texts = page.containers.filter((c) => c.kind === "text").length; + const images = page.containers.filter((c) => c.kind === "image").length; + if (texts > 8 || images > 4) this.log(`evenhub: page exceeds stock limits (${texts} text, ${images} image)`); + } + + private textUpgrade(data: Record): boolean { + const id = readNumber(data, "containerID", -1); + const name = readString(data, "containerName", ""); + const container = this.page?.containers.find((c) => c.kind === "text" && c.id === id && c.name === name); + if (!container || container.kind !== "text") return false; + const content = readString(data, "content", ""); + const offset = readOptionalNumber(data, "contentOffset"); + const length = readOptionalNumber(data, "contentLength"); + if (offset !== undefined && length !== undefined) { + container.content = container.content.slice(0, offset) + content + container.content.slice(offset + length); + } else { + container.content = content; + } + this.windowHooks?.requestRender(); + return true; + } + + /** BleEhSendImageResult: 0 success, 1 imageException, 2 sizeInvalid, 3 sendFailed. */ + private updateImage(data: Record): number { + const id = readNumber(data, "containerID", -1); + const container = this.page?.containers.find((c) => c.kind === "image" && c.id === id); + if (!container || container.kind !== "image") return 3; + const bytes = imagePayloadBytes(data.imageData ?? data.rawData ?? asRecord(data).mapRawData); + if (!bytes || bytes.length === 0) return 1; + const decoded = decodeImageBytes(bytes, container); + if (!decoded) return 1; + container.pixels = decoded.pixels; + container.pixelsWidth = decoded.width; + container.pixelsHeight = decoded.height; + this.windowHooks?.requestRender(); + return 0; + } + + private shutDown(exitMode: number): boolean { + if (exitMode === 1) { + // Stock pops an on-glasses confirm and tells the app its page is gone. + this.emitSysEvent(FOREGROUND_ENTER_EVENT, 0); + this.windowHooks?.openExitDialog(); + this.windowHooks?.requestRender(); + return true; + } + // Immediate exit. Resolve first (the return travels via evaluateJs, and + // close() only tears the webview down after its own delay). + setTimeout(() => this.close(), 200); + return true; + } + + private storageKey(key: string): string { + return `evenhub:${this.manifest.packageId}:ls:${key}`; + } + + // ----- pushes (host -> web) ----- + + private resolveCall(callId: number, ok: boolean, value: unknown): void { + this.pageHandle?.evaluateJs( + `window.__fcResolve && window.__fcResolve(${callId}, ${ok ? "true" : "false"}, ${JSON.stringify(value ?? null)})`, + ); + } + + private pushMessage(method: string, data: unknown): void { + const message = { type: "listen_even_app_data", method, data }; + this.pageHandle?.evaluateJs( + `window._listenEvenAppMessage && window._listenEvenAppMessage(${JSON.stringify(message)})`, + ); + } + + private pushEvenHubEvent(payloadType: "sysEvent" | "textEvent" | "listEvent", jsonData: Record): void { + this.pushMessage("evenHubEvent", { type: payloadType, jsonData: elideZeroFields(jsonData) }); + } + + private emitSysEvent(eventType: number, eventSource: number): void { + this.pushEvenHubEvent("sysEvent", { eventType, eventSource }); + } + + private emitListEvent(list: EvenHubListContainer, eventType: number): void { + this.pushEvenHubEvent("listEvent", { + containerID: list.id, + containerName: list.name, + currentSelectItemIndex: list.selectedIndex, + currentSelectItemName: list.itemNames[list.selectedIndex] ?? "", + eventType, + }); + } + + // ----- teardown ----- + + /** Close everything: glasses window, phone page, session. Idempotent. */ + close(): void { + if (this.closed) return; + this.closed = true; + if (this.graceCloseTimer) { + clearTimeout(this.graceCloseTimer); + this.graceCloseTimer = null; + } + if (!this.systemExitSent) { + // Best effort: lets the app's teardown handlers run before the webview dies. + this.emitSysEvent(SYSTEM_EXIT_EVENT, 0); + this.systemExitSent = true; + } + const hooks = this.windowHooks; + this.windowHooks = null; + hooks?.closeWindow(); + const page = this.pageHandle; + this.pageHandle = null; + if (page) { + // Give in-flight resolves/pushes a beat to reach the webview first. + setTimeout(() => page.closePage(), 100); + } + } + + isClosed(): boolean { + return this.closed; + } +} + +function delay(ms: number): Promise { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +/** ring/left-arm/right-arm -> PB EventSourceType. */ +function gestureSource(source: "ring" | "left-arm" | "right-arm"): number { + switch (source) { + case "right-arm": + return 1; + case "ring": + return 2; + case "left-arm": + return 3; + } +} + +/** + * Protobuf JSON elides zero-valued fields, and apps depend on it (they test + * eventType === 0 || eventType === undefined). Emit the same shape. + */ +function elideZeroFields(obj: Record): Record { + const out: Record = {}; + for (const [key, value] of Object.entries(obj)) { + if (value === undefined || value === 0 || value === "") continue; + out[key] = value; + } + return out; +} + +/** Accept the payload forms seen on the wire: number[], JSON-ified typed + * array ({"0": 1, ...}), or base64 string. */ +function imagePayloadBytes(raw: unknown): Uint8Array | null { + if (Array.isArray(raw)) { + const out = new Uint8Array(raw.length); + for (let i = 0; i < raw.length; i++) out[i] = Number(raw[i]) & 0xff; + return out; + } + if (typeof raw === "string") return base64Decode(raw); + if (raw && typeof raw === "object") { + const record = raw as Record; + const keys = Object.keys(record); + const out = new Uint8Array(keys.length); + for (let i = 0; i < keys.length; i++) { + const value = record[String(i)]; + if (typeof value !== "number") return null; + out[i] = value & 0xff; + } + return out; + } + return null; +} + +const BASE64_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +function base64Decode(text: string): Uint8Array | null { + const clean = text.replace(/[\s=]+$/g, "").replace(/\s+/g, ""); + const out = new Uint8Array(Math.floor((clean.length * 3) / 4)); + let bits = 0; + let bitCount = 0; + let outIndex = 0; + for (const char of clean) { + const value = BASE64_ALPHABET.indexOf(char); + if (value < 0) return null; + bits = (bits << 6) | value; + bitCount += 6; + if (bitCount >= 8) { + bitCount -= 8; + out[outIndex++] = (bits >> bitCount) & 0xff; + } + } + return out.subarray(0, outIndex); +} + +/** + * Decode an image payload: PNG (what the SDK-era apps send — the host does + * the gray conversion), or raw grayscale sized to the container (8bpp, or + * 4bpp packed two pixels per byte, high nibble first). + */ +function decodeImageBytes( + bytes: Uint8Array, + container: EvenHubImageContainer, +): { pixels: Uint8Array; width: number; height: number } | null { + if (bytes.length > 4 && bytes[0] === 0x89 && bytes[1] === 0x50 && bytes[2] === 0x4e && bytes[3] === 0x47) { + try { + const buffer = bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength); + const decoded = UPNG.decode(buffer); + const frames = UPNG.toRGBA8(decoded) as ArrayBuffer[]; + if (!frames.length) return null; + const rgba = new Uint8Array(frames[0]!); + const pixels = new Uint8Array(decoded.width * decoded.height); + for (let i = 0; i < pixels.length; i++) { + const offset = i * 4; + const alpha = (rgba[offset + 3] ?? 0) / 255; + pixels[i] = Math.round( + (0.2126 * (rgba[offset] ?? 0) + 0.7152 * (rgba[offset + 1] ?? 0) + 0.0722 * (rgba[offset + 2] ?? 0)) * alpha, + ); + } + return { pixels, width: decoded.width, height: decoded.height }; + } catch (error) { + console.warn(`evenhub: PNG decode failed: ${error}`); + return null; + } + } + const area = container.width * container.height; + if (bytes.length === area) { + return { pixels: Uint8Array.from(bytes), width: container.width, height: container.height }; + } + if (bytes.length === Math.ceil(area / 2)) { + const pixels = new Uint8Array(area); + for (let i = 0; i < area; i++) { + const byte = bytes[i >> 1]!; + const nibble = i % 2 === 0 ? byte >> 4 : byte & 0x0f; + pixels[i] = nibble * 17; + } + return { pixels, width: container.width, height: container.height }; + } + return null; +} diff --git a/app/apps/files/files-app.ts b/app/apps/files/files-app.ts index 2e1f46c0..ce214395 100644 --- a/app/apps/files/files-app.ts +++ b/app/apps/files/files-app.ts @@ -16,12 +16,15 @@ export const FILES_WINDOW_ID = "files"; export const FILES_SURFACE_ID = "window:files"; const TEXT_FILE = /\.(txt|md|log)$/i; +const EHPK_FILE = /\.ehpk$/i; export type FilesAppOptions = InProcessAppOptions & { /** Open a text document as its own shell window (also used by the share intent). */ openDocumentWindow: (title: string, text: string) => void; /** Open an image file as its own shell window. */ openImageWindow: (title: string, path: string) => void; + /** Launch an EvenHub app package (.ehpk) through the EvenHub host. */ + openEhpkApp: (path: string) => void; }; /** @@ -32,7 +35,7 @@ export type FilesAppOptions = InProcessAppOptions & { export function createFilesAppWindow(options: FilesAppOptions): InProcessWindow { let created: InProcessWindow | null = null; const browser = new FileBrowserLayer({ - isSupportedFile: (name) => TEXT_FILE.test(name) || isDecodableImageFile(name), + isSupportedFile: (name) => TEXT_FILE.test(name) || EHPK_FILE.test(name) || isDecodableImageFile(name), // The browser handles double-click itself (up a level), so it is not // wrapped in YieldAtRootLayer; it yields explicitly from the top level. onLeave: () => shell.yieldFocusToSidebar(), @@ -131,6 +134,17 @@ function fileOpenActions(entry: DirectoryEntry, options: FilesAppOptions): FileI }, ]; } + if (EHPK_FILE.test(entry.name)) { + return [ + { + label: "Run app", + onSelect: (ctx) => { + ctx.stack.pop(); + options.openEhpkApp(entry.path); + }, + }, + ]; + } if (isDecodableImageFile(entry.name)) { return [ { diff --git a/app/apps/files/index.ts b/app/apps/files/index.ts index 30227243..ace81ca3 100644 --- a/app/apps/files/index.ts +++ b/app/apps/files/index.ts @@ -1,4 +1,5 @@ import { type AppContext, type AppDefinition } from "../app-definition"; +import { openEvenHubPackage } from "../evenhub"; import { createFilesAppWindow, createImageDocumentWindow, @@ -43,6 +44,11 @@ const filesApp: AppDefinition = { ...options, openDocumentWindow: (title, text) => openTextDocumentWindow(ctx, title, text), openImageWindow: (title, path) => openImageDocumentWindow(ctx, title, path), + openEhpkApp: (path) => { + void openEvenHubPackage(ctx, path).catch((error) => { + ctx.appendLog(`evenhub launch failed: ${error}`); + }); + }, }), ), // A document arriving via Android's Share intent opens as its own window. diff --git a/app/g2/firmware/cfw-patches.ts b/app/g2/firmware/cfw-patches.ts index c51da471..52e56a7e 100644 --- a/app/g2/firmware/cfw-patches.ts +++ b/app/g2/firmware/cfw-patches.ts @@ -19,7 +19,7 @@ export type FirmwarePatchSet = { export const CFW_PATCH_SET: FirmwarePatchSet = { "base": "g2_2.2.6.10.bin", "baseSha256": "f4dfb0b49ad3de3c2daf17f8a27a157c3dc98411d6a0d3ab2cfd0918f41b9afa", - "outputSha256": "20cba9377ea207c8c0a6fd936f32db9ecaf23da023cdf43a770b22b355107d1f", + "outputSha256": "ade1ca6b3329c66efe03c513d300058ef11f2112d81665fd648c54ac4c2887d6", "patches": [ { "offset": 1449549, @@ -42,61 +42,61 @@ export const CFW_PATCH_SET: FirmwarePatchSet = { { "offset": 1447919, "old": "7ef7fefd", - "new": "baf20cfb", + "new": "baf22cfb", "desc": "bl snapshot_side @ 0x4db968" }, { "offset": 1448931, "old": "7ef704fc", - "new": "baf212f9", + "new": "baf232f9", "desc": "bl snapshot_side @ 0x4dbd5c" }, { "offset": 1165461, "old": "45f0cefd", - "new": "fff2bdfa", + "new": "fff2ddfa", "desc": "bl image_deferred (deferred consumer -> FIFO restore + worker, both lenses)" }, { "offset": 1186287, "old": "d9f7d4ff", - "new": "fbf296f9", + "new": "fbf2e8f9", "desc": "bl settings_send_wrapper (append caps field 100)" }, { "offset": 1183983, "old": "f4f75aff", - "new": "fbf252fb", + "new": "fbf2a4fb", "desc": "bl settings_decode_wrapper (Faceclaw lease field 101)" }, { "offset": 926945, "old": "08f068fa", - "new": "3af375f8", + "new": "3af3c7f8", "desc": "bl faceclaw_display_start @ 0x45c65a (fail-open double-tap takeover)" }, { "offset": 927137, "old": "08f008fa", - "new": "3af315f8", + "new": "3af367f8", "desc": "bl faceclaw_display_start @ 0x45c71a (fail-open double-tap takeover)" }, { "offset": 822553, "old": "28f003f8", - "new": "54f363f8", - "desc": "bl evenhub_longpress (replaces force-quit dialog)" + "new": "54f3b5f8", + "desc": "bl evenhub_longpress (Faceclaw lease gates custom event vs stock dialog)" }, { "offset": 823369, "old": "1cf09bfb", - "new": "53f3e7fe", + "new": "53f343ff", "desc": "bl ring_release (forward ring release-long-press)" }, { "offset": 1474137, "old": "7fb50600", - "new": "b4f24fbf", + "new": "b4f2a1bf", "desc": "even_ai_display_ctrl entry -> conditional Faceclaw lease trampoline" }, { @@ -114,13 +114,13 @@ export const CFW_PATCH_SET: FirmwarePatchSet = { { "offset": 1198787, "old": "dff770fb", - "new": "f7f278fc", + "new": "f7f2cafc", "desc": "bl faceclaw_send_wear_event @ 0x49ec3c (outside onboarding)" }, { "offset": 1198881, "old": "dff741fb", - "new": "f7f249fc", + "new": "f7f29bfc", "desc": "bl faceclaw_send_wear_event @ 0x49ec9a (outside onboarding)" }, { @@ -132,43 +132,43 @@ export const CFW_PATCH_SET: FirmwarePatchSet = { { "offset": 4301227, "old": "", - "new": "02fb01f044f6d341c0f24701084700bf084644f61751c0f24701084770b500284ed001684ef66362ccf2ff02914218bf70bd90f8081190f8095142f6c52c8d42c0f2500c2ad205eb8501014491f80d2191f80e4191f80ae191f80b3191f80c1142ea0424012c4ff0010298bf14466e1c054680f80961b9b164294eea032028bf6421012888bf024644f62060824228bf02460cf5e2731046984706e0002180f80811bde870406047e047d5f8040138b149f29942c0f244022146bde87040104770bd00bf70b54ff6fd03c0f2450314460d46984743f6fc71c2f200010e6831466ff39601b1f1005f0ad131684ef66362ccf2ff02914218bf0026412d03d070bd0026412dfbd1002cf9d04af26951c0f2450105468847002e01462846efd00129edd196f807120029e9d02168002948bf70bd47f25d02c0f2580208469047284670bd00bf2de9f04f99b043f6fc76c2f20006d6f8009048466ff39600b0f1005f40f04d81d9f800004ef66367ccf2ff07b84240f0448199f82802002800f02d81d9f82442002c00f0288140f2b870c2f20000d0f8008004a801f006f9b8f1000f00f0fb8140f2030c45f24075cff6807ca4f1600008f160026ff0bf03c0f20205016ed4182166416ec0336166816eab42a166c16ee166016f2167416f6167816fa167c16fe167d0f88010c4f88010d0f88410c4f88410d0f88810c4f88810d0f88c10c4f88c10d0f89010c4f89010d0f89410c4f89410d0f89810c4f89810d0f89c10c4f89c10d0f8a010c4f8a010d0f8a410c4f8a410d0f8a810c4f8a810d0f8ac10c4f8ac10d0f8b010c4f8b010d0f8b410c4f8b410d0f8b810c4f8b810d0f8bc10c4f8bc1050f8c01fc4f8c0104168c4f8c4108168c4f8c810c168c4f8cc100169c4f8d0104169c4f8d4108169c4f8d810c169c4f8dc10016ac4f8e010416ac4f8e410816ac4f8e810c16ac4f8ec10016bc4f8f010416bc4f8f410816bc4f8f810c16bc4f8fc10016cc4f80011416cc4f80411816cc4f80811c16cc4f80c11016dc4f81011416dc4f81411816dc4f81811c16dc4f81c117ff462afd6f800e00eea0c00b0f1005f40f08180def80000b8427cd19ef8ce00002840f050819ef8dc00002100288df8141000f0b08105aa505c002800f0838153185878002800f059819878002800f05781d878002800f055811879002800f053815879002800f051819879002800f04f81d879002800f04d81187a002800f04b81587a002800f04981987a002800f04781d87a002800f04581187b002800f04381587b002800f04181987b002800f03f81d87b002800f03d81187c002800f03b81587c002800f03981987c002800f03781d87c002800f0358114315029abd155e199f82a0270b1d9f82c0240b144f63421c2f207010968401a002800f3fb80002089f82a024cf61520c0f2460019b0bde8f04f004744f6d341c0f247014ff40c708847002800f0cc804ff6d051cff6ff7100224318463183f8302283f8312283f8322283f8332283f8342283f8352283f8362283f8372283f8382283f8392283f83a2283f83b2283f83c2283f83d2283f83e2283f83f2283f8402283f8412283f8422283f8432283f8442283f8452283f8462283f8472283f8482283f8492283f84a2283f84b2283f84c2283f84d2283f84e2283f84f2283f8502283f8512283f8522283f8532283f8542283f8552283f8562283f8572283f8582283f8592283f85a2283f85b2283f85c2283f85d2283f85e2283f85f2283f8602283f8612283f8622283f8632283f8642283f8652283f8662283f8672283f8682283f8692283f86a2283f86b2283f86c2283f86d2283f86e2283f86f2283f8702283f8712283f8722283f8732283f8742283f875227ff470af012180f8ce104ff0ff310760a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe1010e0002089f82802c9f8240289f82a02012089f829024cf61520c0f24600804714e000203060002089f82802c9f824024ff4163045f20f11069005a8c0f24701cdf814808847012089f82a0204a801f017f8c9f8d40019b0bde8f08f013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f2921d84ff0520050541dd00a4445204e29507018d04f204d29907014d052204c29d07010d044204b2910710cd045204a29507108d052204929907104d020204829d07140f08d8600208df8630001219ef8dd00002870d0002205ab985c00284fd09f18787838b3b87838b3f87838b3387938b3787938b3b87938b3f87938b3387a38b3787a38b3b87a38b3f87a38b3387b38b3787b38b3b87b38b3f87b38b3387c38b3787c38b3b87c38b3f87c38b31432502ad2d13ce0013222e0023220e003321ee004321ce005321ae0063218e0073216e0083214e0093212e00a3210e00b320ee00c320ce00d320ae00e3208e00f3206e0103204e0113202e0123200e013324f2a15d84ff05300985411d013444b204e2a58700cd049204d2a987008d050204c2ad87004d020204b2a187140f0608100208df8630001319ef8de0000286cd0002105aa505c00284fd05318587838b3987838b3d87838b3187938b3587938b3987938b3d87938b3187a38b3587a38b3987a38b3d87a38b3187b38b3587b38b3987b38b3d87b38b3187c38b3587c38b3987c38b3d87c38b314315029d2d138e0013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f2911d84ff0440050540dd00a4455204e29507008d050204d29907004d020204c29d07040f0ec8000208df8630001219ef8df0000284dd0002105aa505c002800f0bc8053185878002800f092809878002800f09080d878002800f08e801879002800f08c805879002800f08a809879002800f08880d879002800f08680187a002800f08480587a002800f08280987a002800f08080d87a00287ed0187b00287dd0587b00287cd0987b00287bd0d87b00287ad0187c002879d0587c002878d0987c002877d0d87c002876d014315029b4d1d0e0002940f0d180002105aa505c002800f0b88053185878002800f08e809878002800f08c80d878002800f08a801879002800f088805879002800f086809879002800f08480d879002800f08280187a002800f08080587a00287ed0987a00287dd0d87a00287cd0187b00287bd0587b00287ad0987b002879d0d87b002878d0187c002877d0587c002876d0987c002875d0d87c002874d014315029b6d181e0013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f295ad84ff05300505456d00a444e204e29507051d041204d2990704dd050204c29d07049d04f204b29107145d046204a29507141d02020492990713dd00020d0713de00020107113e7002058719fe6013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f290dd84ff04f00505409d00a444b204e29507004d020204d29907040f07c8400208df8630000220df1140b1bf80200002850d00beb0203587838b3987838b3d87838b3187938b3587938b3987938b3d87938b3187a38b3587a38b3987a38b3d87a38b3187b38b3587b38b3987b38b3d87b38b3187c38b3587c38b3987c38b3d87c38b31432502ad0d12be0013222e0023220e003321ee004321ce005321ae0063218e0073216e0083214e0093212e00a3210e00b320ee00c320ce00d320ae00e3208e00f3206e0103204e0113202e0123200e013324f2a04d84ff077000bf8020003d100208df8630003e00beb020000214170def8d07000261bf80600002851d00beb0602507840b3907840b3d07840b3107940b3507940b3907940b3d07940b3107a40b3507a40b3907a40b3d07a40b3107b40b3507b40b3907b40b3d07b40b3107c40b3507c40b3907c40b3d07c40b31436502ed0d1502624e0013622e0023620e003361ee004361ce005361ae0063618e0073616e0083614e0093612e00a3610e00b360ee00c360ce00d360ae00e3608e00f3606e0103604e0113602e0123600e0133601240a2f1ed364224ff47a7342f2107504eb84004000b7fbf0f10a2911d304fb02f0b7fbf0f10a290bd304fb03f0b7fbf0f10a2905d36c43b7fbf4f00928e7d800e004463046cdf804e0cdf80c804f2e98bf4f20c0f10008009018eb060e53d0b7fbf4f00a2c00f130010bf806104cf6cd41ccf6cc41a4fb012147d31ef1010242d000fb147cc9085a46bcfbf1fb97190bf13000787048f21f50c5f2eb109246642ca4fb002033d31ef1020232d00bfb11c14009b1fbf0f244f6d35302f13005c1f26203bd70b4f57a7fa4fb033523d31ef10303d34617d002fb1010a90941f25973b0fbf1f2cdf2b713a4fb033502f13003fb7002fb110742f21070043684424fea5534a9d209e0009e07e0013605e0023602e0009e00e00336d346019900270bf806701bf80700002850d00beb0704607838b3a07838b3e07838b3207938b3607938b3a07938b3e07938b3207a38b3607a38b3a07a38b3e07a38b3207b38b3607b38b3a07b38b3e07b38b3207c38b3607c38b3a07c38b3e07c38b31437502fd0d13ae0013722e0023720e003371ee004371ce005371ae0063718e0073716e0083714e0093712e00a3710e00b370ee00c370ce00d370ae00e3708e00f3706e0103704e0113702e0123700e013374f2f13d84ff075000bf807000ed00beb070273204e2f507008d020204d2f907004d070204c2fd07040f0b98200208df86300d1f8d4604ff0000a1bf80a10002967d00beb0a04617859b3a17861b3e17869b3217971b3617979b3a17981b3e17989b3217a91b3617a99b3a17aa1b3e17aa9b3217bb1b3617bb9b3a17bc1b3e17bc9b3217cd1b3617cd9b3a17ce1b3e17ce9b30af1140abaf1500fced14ff0500a37e00af1010a34e00af1020a31e00af1030a2ee00af1040a2be00af1050a28e00af1060a25e00af1070a22e00af1080a1fe00af1090a1ce00af10a0a19e00af10b0a16e00af10c0a13e00af10d0a10e00af10e0a0de00af10f0a0ae00af1100a07e00af1110a04e00af1120a01e00af1130a01240a2e1ed364224ff47a7342f2107704eb84014900b6fbf1f50a2d11d304fb02f1b6fbf1f50a2d0bd304fb03f1b6fbf1f50a2d05d37c43b6fbf4f10929e7d800e00c46d646baf14f0f98bf4ff04f0ecef1000842f2107c18eb0a074dd0b6fbf4f14cf6cd4001f13002ccf6cc400bf80a200a2ca4fb003241d37b1c3dd001fb1461d208b1fbf2f548f21f5005f130030beb0a06c5f2eb107370642ca4fb000330d3b81c29d005fb12115a09b1fbf2f5b4f57a7f05f13000b07044f6d350c1f26200a4fb000320d3f81c16d005fb1210990941f25973b0fbf1f2cdf2b713a4fb033502f13003f37002fb11060af1040a64454fea5534afd209e0f24607e00af1010a04e00af1020a01e00af1030a039c00220bf80a20cdf808901bf80200002850d00beb0200417839b3817839b3c17839b3017939b3417939b3817939b3c17939b3017a39b3417a39b3817a39b3c17a39b3017b39b3417b39b3817b39b3c17b39b3017c39b3417c39b3817c39b3c07c38b31432502ad0d132e0013222e0023220e003321ee004321ce005321ae0063218e0073216e0083214e0093212e00a3210e00b320ee00c320ce00d320ae00e3208e00f3206e0103204e0113202e0123200e013324f2a0bd84ff075000bf8020006d00beb020073214e2a417040f0538100208df863009df81490b9f1000f10d002220beb020111f8013c63b11bf8023063b14b784bb1897804320029f1d1023a04e0002105e0013a00e0013202eb4201490041eae1718a1c04f5207c01f1010e02f0030822f0030704f5a0724ff0ff3504e001350d2d02f5a07269d005eb8501bef1030f0ceb811405d24ff0ff31b8f1000f2ed1ede70021164604e000bf8f4206f1020621d04b1cdb09042b03d8337803f0f00333708b1cdb09042b03d8737803f00f037370cb1cdb09042b03d8737803f0f00373700431cb09042bdfd84b08e05c00f00f00e054d9e70139b8f1000fbfd08e1cf009042808d87008235cce076ff00f0608bf0f2633402354b8f1010fafd0ce1cf009042809d87008235cce074ff00f0608bf6ff00f0633402354b8f1020f9ed00e1df00904289ad87008c907235c6ff00f0108bf0f211940215490e7b9f1000f00f0ab80039843f2e57cc0f2000c00f2812a02220df1140efc4440f27d2b40f27a2808e01ef8019f0632b9f1000f0af1030a00f09280a9f17f0010f15f0ff1d309eb49000ceb8000a0f5c0700027d409514605e000bf02370c2f01f52071e1d0c357042c06d8b3f1ff3f03dc0e7846f0f0060e70042cdeb206d816f0400303d00b7843f00f030b70b30605d55a4503d84b7843f0f0034b70f30606d5b2f51f7f03d84b7843f00f034b7033074fea920305d59e2b03d88d7845f0f0058d70750705d5424503d88d7845f00f058d70c51995f90160042c08d8b6f1ff3f05dc91f8405145f0f00581f84051042cf6b208d816f0400505d091f8405145f00f0581f84051b50607d55a4505d891f8415145f0f00581f84151f50608d5b2f51f7f05d891f8415145f00f0581f84151350707d59e2b05d891f8423143f0f00381f8423173077ff588af42453ff685af91f8423143f00f0381f842317de7dde90298fff719b900218170ace60020107146e50020d070fff783bb00201072fff772b9f0b581b041f204054cf65561cef20005ccf2ac51c5f8ac1f4ef6fc51cef200010a6843f6fc7642f080720a6055f8041cc2f2000641f0010145f8041c316807460a466ff39602b2f1005f07d108684ef66362ccf2ff02904200f0cb8044f6d341c0f247014ff40c708847002800f0f98001464ff6d050cff6ff7000220b18463083f8302283f8312283f8322283f8332283f8342283f8352283f8362283f8372283f8382283f8392283f83a2283f83b2283f83c2283f83d2283f83e2283f83f2283f8402283f8412283f8422283f8432283f8442283f8452283f8462283f8472283f8482283f8492283f84a2283f84b2283f84c2283f84d2283f84e2283f84f2283f8502283f8512283f8522283f8532283f8542283f8552283f8562283f8572283f8582283f8592283f85a2283f85b2283f85c2283f85d2283f85e2283f85f2283f8602283f8612283f8622283f8632283f8642283f8652283f8662283f8672283f8682283f8692283f86a2283f86b2283f86c2283f86d2283f86e2283f86f2283f8702283f8712283f8722283f8732283f8742283f875227ff470af4ef66360ccf2ff000860012081f8ce004ff0ff30a1f8e000a1f8e200a1f8e400a1f8e600a1f8e800a1f8ea00a1f8ec00a1f8ee00a1f8f000a1f8f200a1f8f400a1f8f600a1f8f800a1f8fa00a1f8fc00a1f8fe003160d1f8d800b0bb44f6342245f6e464c2f20702cff6f8741368204616689e420ed116689e420bd116689e4208d116689e4203d1002800f10400efd19e421ad02b6816681068b0420ed11068b0420bd11068b04208d11068b04203d1002c04f10404efd1b04206d02868c01ac1f8d80001e0002030602868386001b0f0bd00bf2de9f04141f2040843f6fc77cef20008c2f200070146d8f8004038680d6801466ff39601b1f1005f07d101684ef66362ccf2ff02914200f0ca8044f6d341c0f247014ff40c708847002800f0d0804ff6d051cff6ff7100224318463183f8302283f8312283f8322283f8332283f8342283f8352283f8362283f8372283f8382283f8392283f83a2283f83b2283f83c2283f83d2283f83e2283f83f2283f8402283f8412283f8422283f8432283f8442283f8452283f8462283f8472283f8482283f8492283f84a2283f84b2283f84c2283f84d2283f84e2283f84f2283f8502283f8512283f8522283f8532283f8542283f8552283f8562283f8572283f8582283f8592283f85a2283f85b2283f85c2283f85d2283f85e2283f85f2283f8602283f8612283f8622283f8632283f8642283f8652283f8662283f8672283f8682283f8692283f86a2283f86b2283f86c2283f86d2283f86e2283f86f2283f8702283f8712283f8722283f8732283f8742283f875227ff470af4ef66361ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe103860d0f8d81081b144f6d350c1f26200a1fb0001880901284ff0010088bf88094ce000203860fa2048e044f6342245f6e466c2f20702cff6f8761368314600bf17689f420ed117689f420bd117689f4208d117689f4203d1002901f10401efd19f422ad0d8f80030176800bf1168b9420ed11168b9420bd11168b94208d11168b94203d1002e06f10406efd1b94214d0d8f8001044f6d357ca1ac1f26207a2fb0776c0f8d820b00901284ff0010088bfb009994208bffa2000e0fa20611bb1fbf0f0bde8f08100bf2de9f04f83b043f6fc76c2f200063568824628466ff3960044f6d347b0f1005fc0f2470707d128684ef66361ccf2ff01884200f0c8804ff40c70b8470546002800f0c0804ff6d050cff6ff70002100bf2a18463082f8301282f8311282f8321282f8331282f8341282f8351282f8361282f8371282f8381282f8391282f83a1282f83b1282f83c1282f83d1282f83e1282f83f1282f8401282f8411282f8421282f8431282f8441282f8451282f8461282f8471282f8481282f8491282f84a1282f84b1282f84c1282f84d1282f84e1282f84f1282f8501282f8511282f8521282f8531282f8541282f8551282f8561282f8571282f8581282f8591282f85a1282f85b1282f85c1282f85d1282f85e1282f85f1282f8601282f8611282f8621282f8631282f8641282f8651282f8661282f8671282f8681282f8691282f86a1282f86b1282f86c1282f86d1282f86e1282f86f1282f8701282f8711282f8721282f8731282f8741282f875127ff470af4ef66360ccf2ff002860012085f8ce004ff0ff30a5f8e000a5f8e200a5f8e400a5f8e600a5f8e800a5f8ea00a5f8ec00a5f8ee00a5f8f000a5f8f200a5f8f400a5f8f600a5f8f800a5f8fa00a5f8fc00a5f8fe003560baf1000f18bf002d07d14af26950c0f2450003b0bde8f04f0047daf80cb0bbf1000ff2d0daf82080b8f1000fedd0a94659f8040f00287ad06869002879d0686a002878d0686b002877d0686c002876d0686d002875d0686e002874d0686f002873d0d5f88400002871d0d5f8940000286fd0d5f8a40000286dd0d5f8b40000286bd0d5f8b00029690290d5f8a0002c6a0190d5f89000d5f880600090d5f870e0d5f860c02b6d286b2a6c8c4238bf21464ff0000438bf012488423cbf014602248a423cbf114603248b423cbf194604248c453cbf614605248e453cbf714606248e423cbf31460724009888423cbf01460824019888423cbf014609240298884238bf0146d5f8c00038bf0a24884238bf0b2409eb0410406807f1440126018847002049f80600012085f8df0016e0002414e0012412e0022410e003240ee004240ce005240ae0062408e0072406e0082404e0092402e00a2400e00b244046b84700283ff452af08f0030c5fea98034ff0000219d0a2eb830e431c0bf101066ff00307029400bff119cc78da19d4700c79043714714c79547189790eeb070404349171f0d1029c3a1dbcf1000f10d01bf80230bcf1010f83540ad0531c1bf80370bcf1020fc75403d0911c1bf80120425409eb04114860d5f8c400220149f802a0421cc1f80880c5f8c420c8600de738464146fff722be2de9f04f81b043f6fc79c2f20009d9f80050044628466ff3960044f6d34816460f46b0f1005fc0f2470807d128684ef66361ccf2ff01884200f0c8804ff40c70c0470546002800f01e814ff6d050cff6ff7000212a18463082f8301282f8311282f8321282f8331282f8341282f8351282f8361282f8371282f8381282f8391282f83a1282f83b1282f83c1282f83d1282f83e1282f83f1282f8401282f8411282f8421282f8431282f8441282f8451282f8461282f8471282f8481282f8491282f84a1282f84b1282f84c1282f84d1282f84e1282f84f1282f8501282f8511282f8521282f8531282f8541282f8551282f8561282f8571282f8581282f8591282f85a1282f85b1282f85c1282f85d1282f85e1282f85f1282f8601282f8611282f8621282f8631282f8641282f8651282f8661282f8671282f8681282f8691282f86a1282f86b1282f86c1282f86d1282f86e1282f86f1282f8701282f8711282f8721282f8731282f8741282f875127ff470af4ef66360ccf2ff002860012085f8ce004ff0ff30a5f8e000a5f8e200a5f8e400a5f8e600a5f8e800a5f8ea00a5f8ec00a5f8ee00a5f8f000a5f8f200a5f8f400a5f8f600a5f8f800a5f8fa00a5f8fc00a5f8fe00c9f8005005f1040b4ff0000a4ff000094ff0ff30002200234ff0ff3105e000bf6032c02a03f1060332d0af187e68a64204d13e6986423cbf194630467e69a64204d13e6a86423cbf591c30467e6aa64204d13e6b86423cbf991c30467e6ba64204d13e6c86423cbfd91c30467e6ca64204d13e6d86423cbf191d30467e6da642ced13f6e87423cbf591d3846c8e700bf002910d40beb01104768090182684bf801a02046394600f013f8814608f1440138468847ace7484601b0bde8f08f204639463246c9f8005001b0bde8f04fffe72de9f047a4b0804640f6bb4043f6fc77c0f24e0091468a46c2f2000780473c68002021466ff39601b1f1005f02908df80c0007d120684ef66361ccf2ff01884200f0cb8044f6d341c0f247014ff40c7088470446002800f0bf804ff6d050cff6ff7000212218463082f8301282f8311282f8321282f8331282f8341282f8351282f8361282f8371282f8381282f8391282f83a1282f83b1282f83c1282f83d1282f83e1282f83f1282f8401282f8411282f8421282f8431282f8441282f8451282f8461282f8471282f8481282f8491282f84a1282f84b1282f84c1282f84d1282f84e1282f84f1282f8501282f8511282f8521282f8531282f8541282f8551282f8561282f8571282f8581282f8591282f85a1282f85b1282f85c1282f85d1282f85e1282f85f1282f8601282f8611282f8621282f8631282f8641282f8651282f8661282f8671282f8681282f8691282f86a1282f86b1282f86c1282f86d1282f86e1282f86f1282f8701282f8711282f8721282f8731282f8741282f875127ff470af4ef66360ccf2ff002060012084f8ce004ff0ff30a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe003c60baf1000f4ff0010618bfb9f1000f20d101af3846fff75bf902ad404651464a460123009500f0ebfd05463846fff787fa002e064608d19df80c0028b943f61f00c0f247004c308047002c18bfc4f8d06022e09af8000008280ed9a0f18301052905d8012202fa01f111f0290f09d100f07f000928ccd104e00121814011f4a47febd03cb143f61f00c0f24700804794f8280228b14ff0ff35284624b0bde8f0870026b5e700bf43f6fc70c2f20000016808466ff39600b0f1005f16d108684ef66362ccf2ff0290420fd1d1f8fc0160b144f63422c2f207021268801a0028cebf01200020c1f8fc01704700207047f0b101684ef66362ccf2ff02914218bf704790f8061299b110b544f62f344ff0000cc0f24604864680f806c20120002100220023aef804c2a446bde810406047704700bf70b543f6fc76c2f200063468054621466ff39601b1f1005f07d120684ef66361ccf2ff01884200f0cc8044f6d341c0f247014ff40c708847002800f0ea8004464ff6d050cff6ff70002100bf2218463082f8301282f8311282f8321282f8331282f8341282f8351282f8361282f8371282f8381282f8391282f83a1282f83b1282f83c1282f83d1282f83e1282f83f1282f8401282f8411282f8421282f8431282f8441282f8451282f8461282f8471282f8481282f8491282f84a1282f84b1282f84c1282f84d1282f84e1282f84f1282f8501282f8511282f8521282f8531282f8541282f8551282f8561282f8571282f8581282f8591282f85a1282f85b1282f85c1282f85d1282f85e1282f85f1282f8601282f8611282f8621282f8631282f8641282f8651282f8661282f8671282f8681282f8691282f86a1282f86b1282f86c1282f86d1282f86e1282f86f1282f8701282f8711282f8721282f8731282f8741282f875127ff470af4ef66360ccf2ff002060012084f8ce004ff0ff30a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe00346000230820032184f81b322a2384f8180284f81912102184f81c32042384f81e02012045f61b4c04f5067284f81a1284f81d3284f81f0284f82012002d18bf0125c0f2470c0a2384f82152bde8704060470020306070bd2de9f04143f6fc77c2f200073f684ff000083c466ff39604b4f1005f07d13e684ef66365ccf2ff05ae4208bfb84601280fd11c4615460f460646fff78ffe2346044639462a463046002c18bfb8f1000f06d144f62f3cc0f2460cbde8f041604798f8060270b1d8f800020021002888f80612a8f804123ed049f2d941c0f24401884738e0b8f804020121013080b2012898bf0846a8f80402d8f8000249f2d944c0f2440488f8061268b94ff6eb40cff6ff70a4f594777844002142460023b847c8f8000240b1a047d8f80002a4f140024ff4c8719047c8b198f80602002808bfbde8f081d8f80002002188f80612a8f8041200b1a04744f62f3cc0f2460c0120002100220023bde8f04160474af26950c0f245008047012830d1082088f80802032088f80902102088f80a02002088f80b02b22088f80c02062088f80d0288f80e024620b8f8041288f80f02432088f8100201200f0a45f6153c08f5027288f8110288f8120288f81312c0f2470c09210d2388f81472bde8f0416047bde8f08170b50446d0f8000249f2b1360d46c0f2440668b94ff60540cff6ff707844002122460023b0470028c4f8000208bf70bd06f594718847d4f8000206f1e8022946bde87040104700bf2de9f04f83b04768002f00f0a2828368002b00f09e824ef6636e07eb030b4ff00008ccf2ff0e0025002414e044f63423c2f207031b6845f69075c0f201052b44c4f8fc31029b4b4400255b451f464ff0000480f07e82ba461af9013b03f07f06ae40002b44ea060410d404f00703012b16dc0bb3012b40f06c82abeb0a03082bc0f0678207f10903dee700bfda4580f06082182d05f107055746dcd959e200bf022b3ad0052b40f05482abeb0a03042bc0f04f827b1dc7e7da4580f04a8297f90130002b07f10203bed55b4580f0418297f90230b3f1ff3f07f10303b4dc5b4580f0378297f90330b3f1ff3f07f10403aadc5b4580f02d8297f90430b3f1ff3f07f10503a0dc5b4580f0238297f90530002b00f11e82bb1d96e7da4580f0198297f9013007f1020c002b03f07f091fd5dc4580f00e8297f90250fb1c05f07f06b5f1ff3f49eac61902dde2469c460fe05b4580f0fe8197f9036007f1040c06f07f05b6f1ff3f49ea853940f323819a46abeb0c03994500f2ec8124f00703b3f54a7fcdf808c07ff45dafb9f1060ffff459af029b1b78462b7ff454af9af80230432b7ff44faf9af80330012b7ff44aaf43f6fc76c2f20006346823466ff39603b3f1005f03d12368734500f0d180019144f6d34105464ff40c70c0f2470117468847002800f028814ff6d05301990446cff6ff7328463a46e718463387f8308287f8318287f8328287f8338287f8348287f8358287f8368287f8378287f8388287f8398287f83a8287f83b8287f83c8287f83d8287f83e8287f83f8287f8408287f8418287f8428287f8438287f8448287f8458287f8468287f8478287f8488287f8498287f84a8287f84b8287f84c8287f84d8287f84e8287f84f8287f8508287f8518287f8528287f8538287f8548287f8558287f8568287f8578287f8588287f8598287f85a8287f85b8287f85c8287f85d8287f85e8287f85f8287f8608287f8618287f8628287f8638287f8648287f8658287f8668287f8678287f8688287f8698287f86a8287f86b8287f86c8287f86d8287f86e8287f86f8287f8708287f8718287f8728287f8738287f8748287f875827ff470af4ef6636e0123ccf2ff0e84f8ce304ff0ff33c4f800e0a4f8e030a4f8e230a4f8e430a4f8e630a4f8e830a4f8ea30a4f8ec30a4f8ee30a4f8f030a4f8f230a4f8f430a4f8f630a4f8f830a4f8fa30a4f8fc30a4f8fe3034609af804309af805709af80660032b47ea062732dd052b61dc042b00f08180052b7ff458aed4f82c32002b00f0cb8044f63425c2f207052f68db1b002bd8bf84f82a82c1e0dc4580f0cc8097f904607b1d06f07f05b6f1ff3f49ea45593ff7bdae5b4580f0be8097f90550002d00f1b98007f1060c49ea0579c1e6012b3ff41eae022b7cd0032b7ff425aecde900208a467546fff7c7fb009a03460198ae465146002b3ff417ae94f80632002b3ff412ae204641f28831a4f80472fff7c5fddde90020ae46514605e6019928463a46c6f800804ef6636eccf2ff0efbe5062b49d0072b7ff4f7ad01904ef68f30c0f2490015460f4674468047034601985e1ea64639462a46012e3ff6e5ad981eb0fa80f04009fff7cdfba646394601982a46d9e5019015468a467646fff77cfb03460198b64651462a46002b3ff4ccad94f80632002b3ff4c7adb4f80432bb427ff4c2add4f8003284f80682002ba4f804823ff4b9ad49f2d9411846c0f244018847b6465146d2e7c4f82c8284f82a82aae594f80632c4f8fc81002b3ff4a4ad0546d4f800028a46174684f80682a4f8048220b149f2d941c0f24401884744f62f340120002100220023c0f24604a04728463a46514686e784f82a8244f63423c2f207031b6845f69075c0f201052b44c4f82c3278e540f22113c0f2490303b0bde8f04f184700bf7fb50646002806d1fff712fb002807d19de80f00064641f6d77cc0f24e0c60477fbd00bf092959d12de9f047a22602eb030cd65406268cf8016041f64068c0f200084ff0000ef84418f80e700ceb0e0508eb0e06ef707778b47896f8039096f804a02f716c7185f8069085f807a074790ef11b0e2c72b479bef1510f6c72f479ac72347aec72747a2c73b47a6c73f47aac73347bec73747b2c74b47b6c74f47bac74347cec74747c2c75b47c6c75f47cac75347dec75747d2c76b47d6c76f47dac76347eec76747e2c77b47e6c77bbd1502753338cf80270bde8f04745f6153cc0f2470c604700bf4df63040c2f234000078042818bf704780b582b04af26b1e4ff0000cc0f24d0e0020002100220923cdf804c0cdf800c0f04702b080bd00bff0b583b04df63043c2f234031b784ff6e704042bc0f2450420d144f2d043c2f207031b680546184616460f46a04703463946324628468bb11b68e02b0ed14af26b160027c0f24d060020002100220a2301970097b047012003b0f0bd04f1160303b0bde8f04018472de9f04f95b0002918bf002a04d115b0bde8f04f00f06cbe0f78ddf878b007f07f06082e5bdc052e00f00981072e00f09482082e5bd10746002b4ff0ff3000f042864af28973cff6fd73d61802339e42c0f0398691f801903846b9f1000f00f0788202274ff00108be1c964200f2c285cb19cf5d5b7857ea032300f0bb859f19974200f2b7858446885d09280dd9a0f18305062d4ff0ff3000f2158608fa05f515f0490f06d100f00ebe08fa00f515f4127fecd014460d46314460461a4600236646cdf800b0fff79bff002840f09285b9f10109294622463046c5d139e2092e00f0ad810a2e00f05983422e8fd0f51e18bf0125b41f18bf0124032afff487af25407ff484af00254c1ca2f1010c8df81c508df81d508df820508df824508df825508df826508df827508df828508df829508df82a508df82b508df82c508df82d508df82e508df82f508df830508df831508df832508df833508df834508df835508df836508df837508df838508df839508df83a508df83b508df848508df849508df84a508df84b508df84c508df84d508df84e508df84f508df850508df851508df852508df85350cde9074c4df26f14cff6ff747c440f944df27314cff6ff747c44032e1094119500f02084062e40f010850646002000211d4601f022f9b168002900f00685b6f84020b6f842005043b0f5163fc0f0fd8407a84ff4a0724ff4f07301f06afa002800f0f384dbf800000f280dd80bebc0010022ca800a814ff420724a814ff4f07201308a81cbf80000002d304640f08c8100f043bd43f6fc78c2f20008022a2cbf4d78ff25d8f8004020466ff39600b0f1005f07d120684ef66363ccf2ff03984200f0d0800f4644f6d341c0f247014ff40c7016468847002800f08a8304464ff6d050cff6ff70002132462318463083f8301283f8311283f8321283f8331283f8341283f8351283f8361283f8371283f8381283f8391283f83a1283f83b1283f83c1283f83d1283f83e1283f83f1283f8401283f8411283f8421283f8431283f8441283f8451283f8461283f8471283f8481283f8491283f84a1283f84b1283f84c1283f84d1283f84e1283f84f1283f8501283f8511283f8521283f8531283f8541283f8551283f8561283f8571283f8581283f8591283f85a1283f85b1283f85c1283f85d1283f85e1283f85f1283f8601283f8611283f8621283f8631283f8641283f8651283f8661283f8671283f8681283f8691283f86a1283f86b1283f86c1283f86d1283f86e1283f86f1283f8701283f8711283f8721283f8731283f8741283f875127ff470af4ef66360ccf2ff002060012084f8ce004ff0ff303946a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe00c8f8004094f8080178b1d4f8040148b149f29943c0f2440340330e46174698473a463146002084f808010123032a80f0b782c1e23f064ff0210658bf1126b242c0f0d383002f01f101050ed54af26952c0f245020f4604461e469047334601462046022918bf07f1110584462879697950ea01264ff0ff301ebfa979ea7951ea022900f01b84297b6a7b41ea02218e4240f01484a97bea7b41ea0221894540f00d842878697840ea01217018b0f5207f4ff0ff3000f20284aa78ec7842ea042209eb0204b4f5f07f00f2f8832c7a6f7a44ea072806eb0807b7f5207f00f2ee83af7aed7a47ea052509eb0507b7f5f07f00f2e483dcf80800002800f07683bcf84070bcf842406743b7f5163fc0f06d839a4643466446cde90169009500f073fddbf800000f280ad80bebc0010130a1f806800d814e81a1f80c90cbf80000baf1000f00f0ba832046594600f046fcb4e343f6fc74c2f20004236818466ff39600b0f1005f07d118684ef66367ccf2ff07b84200f0cf800e4644f6d341c0f247014ff40c70154688470346002800f0bf804ff6d050cff6ff7000211a18463082f8301282f8311282f8321282f8331282f8341282f8351282f8361282f8371282f8381282f8391282f83a1282f83b1282f83c1282f83d1282f83e1282f83f1282f8401282f8411282f8421282f8431282f8441282f8451282f8461282f8471282f8481282f8491282f84a1282f84b1282f84c1282f84d1282f84e1282f84f1282f8501282f8511282f8521282f8531282f8541282f8551282f8561282f8571282f8581282f8591282f85a1282f85b1282f85c1282f85d1282f85e1282f85f1282f8601282f8611282f8621282f8631282f8641282f8651282f8661282f8671282f8681282f8691282f86a1282f86b1282f86c1282f86d1282f86e1282f86f1282f8701282f8711282f8721282f8731282f8741282f875127ff470af4ef66360ccf2ff001860012083f8ce004ff0ff30a3f8e000a3f8e200a3f8e400a3f8e600a3f8e800a3f8ea00a3f8ec00a3f8ee00a3f8f000a3f8f200a3f8f400a3f8f600a3f8f800a3f8fa00a3f8fc00a3f8fe0031462a462360022a2cbf4978ff21002b00f0cc8202294ff0000000f0e681012900f0df81002940f0c2824ff0ff31c3f8dc00a3f8cc00c3f8c800a3f8e010a3f8e210a3f8e410a3f8e610a3f8e810a3f8ea10a3f8ec10a3f8ee10a3f8f010a3f8f210a3f8f410a3f8f610a3f8f810a3f8fa10a3f8fc10a3f8fe1083f8000115b0bde8f08f022ac0f0298243f6fc74c2f20004206802466ff39602b2f1005f07d102684ef66363ccf2ff039a4200f0cc800d4644f6d341c0f247014ff40c708847002800f097814ff6d051cff6ff7100224318463183f8302283f8312283f8322283f8332283f8342283f8352283f8362283f8372283f8382283f8392283f83a2283f83b2283f83c2283f83d2283f83e2283f83f2283f8402283f8412283f8422283f8432283f8442283f8452283f8462283f8472283f8482283f8492283f84a2283f84b2283f84c2283f84d2283f84e2283f84f2283f8502283f8512283f8522283f8532283f8542283f8552283f8562283f8572283f8582283f8592283f85a2283f85b2283f85c2283f85d2283f85e2283f85f2283f8602283f8612283f8622283f8632283f8642283f8652283f8662283f8672283f8682283f8692283f86a2283f86b2283f86c2283f86d2283f86e2283f86f2283f8702283f8712283f8722283f8732283f8742283f875227ff470af4ef66361ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe10294620604978012900f00981002940f04381002480f807424af26950c0f24500804701462046012940f09f8145f2e550c0f25400883015b0bde8f04f00470023c8f80030002439463246032a0bd355b98878082800f2888142f6c521c0f250019631884780e1052a1ad3012d18d18d78681e06284ff0000000f27781cb78032b00f273810a79002a00f06f8142f6c520c0f2500000f59a7728461946b84763e1022d40f0888042f6c520c0f2500080475ae13f0600f1d080082ac0f0ed8081464ff0070e4ff0050c01268c19a5784ff0ff30002d00f04981e778002f00f0458111f806a04fea850808eb8a06b6f5207f00f23b8164787e0006eb4407b7f5f07f00f2338101eb0c00cdf81890894611f80c104078774641ea002081b20120cde9043200f0d1fc002840f01e8106998868002800f0b180b1f84020b1f842105143b1f5163fc0f0a88009eb0701079105996a00c91b089104eb840100ebc11000eb4a0107a8334600f00bfe002800f09480dbf8001004980f290cd84fea8a0263000bebc1070131fa803b81a7f80a80be81cbf80010002806987ff42dade4e0012083f8ce00e0e083f8ce0015b0bde8f08f0020206070e0072a73d3032d71d18878cb780a7940ea03204d798e7901284ff0010498bf204644f62061884228bf084642f6c521c0f25001642a28bf642201f5e2731146984744f20450c2f207000068002800f0b18045ea062149f29942012988bf0c46c0f2440221469047a4e00121044680f807124af26950c0f245008047012840f0998045f2e550c0f254008047014600284ff0000000f08f8084f80702084615b0bde8f08f0c2a1dd3cf78ce79b74219d10f790e7ab74215d14af26954c0f245040d46164680461f46a047324605263b462946c146022808bf01264ff00b0e4ff0090c18e74ff0ff3015b0bde8f08f032a4ff000005fd32f1fb7fa87f77f093b4059d0d01e4cf6cd42ccf6cc428b78a0fb0202b3eb920f88bf9308302b184628bf3020002b4ad000eb800303f0030c03f4fe770023ce18f578e21882f80a513579043382f80b5175799f4282f80c51b67982f80d61eed1bcf1000f10d01944ca782344bcf1010f83f80a2108d00a79bcf1020f83f80b211cbf497983f80c1184f80801d4f8040149f29945c0f24405002184f8091160b94cf28f60cff6ff70a5f1e807784422460023b847c4f8040158b10121a847002015b0bde8f08f0020a4f8080115b0bde8f08f42f6c5200025c0f2500084f808518047284615b0bde8f08ff0b583b043f6fc73c2f200031f683b466ff39603b3f1005f09d13b684ef66366ccf2ff06b34204bf002387f82a32002958d0362a56d30b78422b53d14b784d2b50d10b7f4f7f43ea0723042b4ad18b7dcf7d0e7e43ea072343ea06434f7e8e7ccd7c53ea076346ea05270e7d4d7d47ea064747ea05641d4648bf5d42b0f84070002b4ff00003c8bf0123bc422ad1b0f84270bd4226d18f7ace7a91f80cc047ea06274e7b47ea0c4747ea0667974219d2621c032606eb5202866822f0030cca19cde901c30746304621462346009500f0d5fe3846314622462b4600f069ff002003b0f0bd4cf2af53c0f24d0303b0bde8f04018472de9f04182b043f6fc77c2f200073d68884629466ff39601b1f1005f064607d128684ef66361ccf2ff01884200f0cb8044f6d341c0f247014ff40c7088470546002800f0bf804ff6d050cff6ff7000212a18463082f8301282f8311282f8321282f8331282f8341282f8351282f8361282f8371282f8381282f8391282f83a1282f83b1282f83c1282f83d1282f83e1282f83f1282f8401282f8411282f8421282f8431282f8441282f8451282f8461282f8471282f8481282f8491282f84a1282f84b1282f84c1282f84d1282f84e1282f84f1282f8501282f8511282f8521282f8531282f8541282f8551282f8561282f8571282f8581282f8591282f85a1282f85b1282f85c1282f85d1282f85e1282f85f1282f8601282f8611282f8621282f8631282f8641282f8651282f8661282f8671282f8681282f8691282f86a1282f86b1282f86c1282f86d1282f86e1282f86f1282f8701282f8711282f8721282f8731282f8741282f875127ff470af4ef66360ccf2ff002860012085f8ce004ff0ff30a5f8e000a5f8e200a5f8e400a5f8e600a5f8e800a5f8ea00a5f8ec00a5f8ee00a5f8f000a5f8f200a5f8f400a5f8f600a5f8f800a5f8fa00a5f8fc00a5f8fe003d60b068002818bf002d02d102b0bde8f081b6f84010b6f842205143b1f5163ff4d3c5f8240201264ff4f07085f8286201904ff4207044f267040090c0f2470400200021002200230027a04730b185f82872c5f8247202b0bde8f08188f8046002b0bde8f08100bf2de9f04f8ab0dde914a5089243ea010242ea0a02d207864640f0c4800eeb51004ff0ff374fea5a0c0eeb53068646012207eb5a00bcf1010f88bf4fea5a02069002f003000790caf341006ff00107059007eb5a006ff00207019007eb5a00009022f00302701c544203900ef101004ff0000b09960290cdf810e004e00bf1010bab4500f0c3810898139e5f466fea0b02864288bfaf183a183744099802eb820207eb87070eeb82198b4200eb871835d9059e6246b6b10698012e19f8002008f8002002460ed00198022e19f8002008f80020024606d0009819f8002008f80020024600bf06980328c8d300bf09eb020717f8016c08eb020000f8016c17f8026c043a00f8026c17f8036c00f8036c17f8047c00f8047ce9d1b0e700bfbaf1080f02d2002223e000bf03989601ba0102440298e64600eb060a6ff0030c0aeb0c00c67802eb0c07fe7006790cf1040c3e7146797e71807904eb0c060436b871edd10cf10402dde914a5f446ddf810e0079800283ff483af079e19f80200012e08f802003ff47baf501c079e19f80070022e08f800703ff472af901c19f8002008f800206be74ff6fc7000ea0a000af0030b0990aaf1010000240490cde905be07e0079c159d0134ddf850a0ac4200f01e81089f139ee0432246be42079488bf2a18d01900eb80000eeb801c901900eb8000baf1040f0eeb80184ff00009c0f09880ddf810a0ddf850e048468b4288bf504600eb010400eb03054fea54001cf800706ff0010080ea090009f1010288bf0eeb00026ff0020089ea000609f1020088bf0eeb06006ff0030686ea090609f1030b4feac47488bf0eeb060b07f00f06002c4fea550408bf3e0918f80470ed0707f00f0507f0f007374408bf45ea061708f80470541865081cf805501a44e40705f00f064fea520408bf2e0918f80450d20705f00f0205f0f005354408bf42ea0615421808f8045054081cf804401844d20704f00f054fea500208bf250918f80240c00704f00f0004f0f0042c4408bf40ea05140beb010008f8024042081cf802200beb0304c00702f00f054fea540008bf150918f80020e40702f00f0402f0f0022a4408bf44ea051208f80020099809f104098145aaf1040a7ff46eafdde905bebbf1000f3ff444af6fea09004a468b42149f88bf3a18501845081a44c0071cf805504fea520018f8007005f00f0408bf2c0907f00f0507f0f0072744d20708bf45ea0417bbf1010f08f800703ff420af149809f10102a0eb090a8b4288bfaaf10202541865081a44e4071cf805504fea520418f8040005f00f0708bf2f0900f00f0500f0f0003844d20708bf45ea0710bbf1020f08f804003ff4faae09f102008b4288bfaaf10300421854081844d2071cf804704fea500218f8024007f00f0508bf3d0904f00f0704f0f0042c44c00708bf47ea051408f80240d9e60ab0bde8f08f00bf70b543f6fc76c2f2000632680c4611466ff39601b1f1005f054607d110684ef66361ccf2ff01884200f0cb8044f6d341c0f247014ff40c708847002800f00b8102464ff6d050cff6ff7000211318463083f8301283f8311283f8321283f8331283f8341283f8351283f8361283f8371283f8381283f8391283f83a1283f83b1283f83c1283f83d1283f83e1283f83f1283f8401283f8411283f8421283f8431283f8441283f8451283f8461283f8471283f8481283f8491283f84a1283f84b1283f84c1283f84d1283f84e1283f84f1283f8501283f8511283f8521283f8531283f8541283f8551283f8561283f8571283f8581283f8591283f85a1283f85b1283f85c1283f85d1283f85e1283f85f1283f8601283f8611283f8621283f8631283f8641283f8651283f8661283f8671283f8681283f8691283f86a1283f86b1283f86c1283f86d1283f86e1283f86f1283f8701283f8711283f8721283f8731283f8741283f875127ff470af4ef66360ccf2ff001060012082f8ce004ff0ff30a2f8e000a2f8e200a2f8e400a2f8e600a2f8e800a2f8ea00a2f8ec00a2f8ee00a2f8f000a2f8f200a2f8f400a2f8f600a2f8f800a2f8fa00a2f8fc00a2f8fe0032600120002d82f8cc0047d0104630f8e01fa1423bd0b2f8e210a14237d0b2f8e410a14233d0b2f8e610a1422fd0b2f8e810a1422bd0b2f8ea10a14227d0b2f8ec10a14223d0b2f8ee10a1421fd0b2f8f010a1421bd0b2f8f210a14217d0b2f8f410a14213d0b2f8f610a1420fd0b2f8f810a1420bd0b2f8fa10a14207d0b2f8fc10a14203d0b2f8fe10a1420ad1012082f8de0070bd0020306070bd82f8cd00002070bd92f8cd1081b9b2f8c810611a0bb2b3f1ff3f06dd89b2022924bf012182f8dd1002e0012182f8dc10b2f8ca30002182f8cd109c42a2f8c84088bfa2f8ca4092f8001120f81140481c00f00f0082f80001002070bd2de9f04fcdb04ef687249246c0f25b044df2546298460e4604f13c07c0f278020f2138230546b84718b12846a047002423e20afb08f040000b960295059001250da94ff4807004f585724ff0000b4ff0000947464ff000080023564604930a930697cdf820a00192029ce1602061204600219047e1680daa891a07910da900f0e681ddf82ce00021002400900be000bf04940c9c002101234ff0030807980134844200f0d181002940f0e0810da80c94045db8f1020febd0b8f1010f00f09280b8f1000f40f0968004f00f000a900598210900f0a6808842c0f08880401a05900a9800eb00140001039014e01cf80b000a9a00f0f00010440cf80b000bf1010b01390125b34524bf4ff0000b09f10109002900f08c81b9454ff000084ff0000338bf012380f0028109eb8900002d0eeb801cdbd0cdf82490a946a6eb0b05b5eb510f88bf4d088db3a8080ceb0b0820d0002708f10102a7eb80006ff0030600bf02eb060e043600eb060a1af104078ef803408ef804408ef805408ef80640efd1301d069f089eddf82ce015f0030204d10ce0002015f0030208d0012a08f8004004d04044022a447018bf8470a1eb4501ab4489b1b34510d21cf80b00039a00f00f001043ddf824900cf80b00013900250029a0d12be100bf00214d46ddf8249090e700bfbcb10598a04228d201214ff0000821e0ddf810a005985aea042a16d00c9c5045cdf810a080f0938001214ff00008002342e70c9c002101234ff002083ce70c9c00214ff00108012336e7002001214ff0000804900c9c00232ee7001b05900a9800eb00110001099015e000bf1af80b200a9802f0f00202430af80b200bf1010b013c0125b34524bf4ff0000b09f10109002c00f0da80b9454ff000084ff0000338bf012350d209eb8902002d0eeb821adcd0ac46a6eb0b05b5eb540f88bf650855b3ae080aeb0b0818d0002008f10102a0eb860e6ff00306901904360eeb06070437c170017141718171f5d1069fddf82ce0321d15f0030604d10de0002215f0030609d0012e08f8021005d04244022e517018bf917000bfa4eb4504ab447cb1089eb3450ed21af80b00099a00f00f0010430af80b00013c0025002cabd184e0089e002465469de70c9c0121b4e6a0eb0a0005900a9800eb00110001099015e01cf80b000a9a00f0f00010430cf80b000bf1010baaf1010a0125b34524bf4ff0000b09f10109baf1000f65d0b9454ff000084ff0000338bf01235bd20b9a09eb8900002d02eb801cdad0ce46a946a6eb0b05b5eb5a0f88bf4fea5a0545b3a8080ceb0b0817d0002408f10102a4eb80006ff003069719043684190434f97039717971b971f6d1301d069f089e0c9c15f0030204d10ce0002015f0030208d0012a08f8001004d04044022a417018bf8170aaeb450abaf1000fab4411d0b34511d21cf80b00099a00f00f0010430cf80b00aaf1010a0025f146baf1000fa6d10be04ff0000a4d46f14697e70c9c4ff00008002131e6012102e04ff000080021ddf82ce029e600980da973b1012817d04ff0000450b90798019ab0fa80f040094ff480703ff4ffad00e0002402984ef68721c0f25b01884720464db0bde8f08f059840ea0800b0fa80f04409eee72de9f04f83b00c9e0292002e019000f08e80019823f00304471c029803f0030ac4f1000c01384ff00008009005e000bf08f10108b0450f4479d00e98c14600286fea080418bf06eb0409002bf0d0042b06d24ff0000bbaf1000f2ed1e8e700bf0d98b64609fb00f400986ff003050444607800f0f00242ea10107a19d0706078043500f00f0646ea0010107114f8020f00f0f00646ea10105071207800f00f0646ea00100ceb050604369071e0d105f1040b7646baf1000fbad002980d9a4fea5b0509fb0204019814f805e008fb01050ef00f025feacb7908bf4fea1e1242ea0212baf1010f05f80b20a1d00bf1010e4fea5e00205cb9f1000f4fea101208bf00f00f0242ea0210baf1020f05f80e008ed00bf102004208a25cb9f1000f02f00f0408bf140944ea04122a5480e703b0bde8f08f2de9f04182b003fb02f68846cde9001645f20f1107466846c0f247011c461546884740f2196047f8240f788948f2816245ea0040b86045ea044057f8204c7860c0f2490220463946fe60c7f81080904740f25761c0f244012046884702b0bde8f0814556454e4346572f3820696d6735373620696d6736343020696d677a20726c652077616b656c65617365206469726563746662206662677561726420776561726e6f7469667920636f6d7061737331300000000000000000000000000000002020202020002020000000505050000000000000000000005050f85050f85050000000002070a8a07028a8702000000048a85010202854480000000020505020689090680000002020200000000000000000000010204040404020100000000040201010101020400000000000005020f82050000000000000002020f82020000000000000000000000020204000000000000000f800000000000000000000000000202000000000080810102020404000000000708898a8c88888700000000020602020202020700000000070888808102040f8000000007088083008088870000000000818284888f8080800000000f88080f00808887000000000708080f08888887000000000f808081010202020000000007088887088888870000000007088888878080870000000000000202000002020000000000000202000002020400000000008102040201008000000000000f80000f8000000000000004020100810204000000000708888102000202000000000708898a8a89880780000000070888888f888888800000000f08888f0888888f000000000708880808080887000000000e0908888888890e000000000f88080f0808080f800000000f88080f0808080800000000070888080b888887000000000888888f888888888000000007020202020202070000000003810101010909060000000008890a0c0c0a090880000000080808080808080f80000000088d8a8a888888888000000008888c8a89888888800000000708888888888887000000000f0888888f080808000000000708888888888a87008000000f0888888f0a0908800000000708880700808887000000000f8202020202020200000000088888888888888700000000088888850505020200000000088888888a8a8d88800000000888850202050888800000000888850502020202000000000f8081020408080f8000000007040404040404070000000004040202010100808000000007010101010101070000000205088000000000000000000000000000000000000f80040200000000000000000000000000000700878888878000000008080f088888888f00000000000007088808088700000000008087888888888780000000000007088f8808078000000001820702020202020000000000000788888888878087000008080f08888888888000000202000602020202070000000080800180808080808483000004040485060605048000000006020202020202070000000000000f0a8a8a8a8a8000000000000f08888888888000000000000708888888870000000000000f088888888f0808000000000788888888878080800000000b8c0808080800000000000007880700808f00000000020207020202020180000000000008888888888780000000000008888505020200000000000008888a8a8a870000000000000885020205088000000000000888888888878087000000000f810204080f800000000182020402020201800000000202020202020202000000000601010081010106000000048a8900000000000000000", + "new": "02fb01f044f6d341c0f24701084700bf084644f61751c0f24701084770b500284ed001684ef66362ccf2ff02914218bf70bd90f8081190f8095142f6c52c8d42c0f2500c2ad205eb8501014491f80d2191f80e4191f80ae191f80b3191f80c1142ea0424012c4ff0010298bf14466e1c054680f80961b9b164294eea032028bf6421012888bf024644f62060824228bf02460cf5e2731046984706e0002180f80811bde870406047e047d5f8040138b149f29942c0f244022146bde87040104770bd00bf70b54ff6fd03c0f2450314460d46984743f6fc71c2f200010e6831466ff39601b1f1005f0ad131684ef66362ccf2ff02914218bf0026412d03d070bd0026412dfbd1002cf9d04af26951c0f2450105468847002e01462846efd00129edd196f807120029e9d02168002948bf70bd47f25d02c0f2580208469047284670bd00bf2de9f04f99b043f6fc76c2f20006d6f8009048466ff39600b0f1005f40f04d81d9f800004ef66367ccf2ff07b84240f0448199f82802002800f02d81d9f82442002c00f0288140f2b870c2f20000d0f8008004a801f006f9b8f1000f00f0fb8140f2030c45f24075cff6807ca4f1600008f160026ff0bf03c0f20205016ed4182166416ec0336166816eab42a166c16ee166016f2167416f6167816fa167c16fe167d0f88010c4f88010d0f88410c4f88410d0f88810c4f88810d0f88c10c4f88c10d0f89010c4f89010d0f89410c4f89410d0f89810c4f89810d0f89c10c4f89c10d0f8a010c4f8a010d0f8a410c4f8a410d0f8a810c4f8a810d0f8ac10c4f8ac10d0f8b010c4f8b010d0f8b410c4f8b410d0f8b810c4f8b810d0f8bc10c4f8bc1050f8c01fc4f8c0104168c4f8c4108168c4f8c810c168c4f8cc100169c4f8d0104169c4f8d4108169c4f8d810c169c4f8dc10016ac4f8e010416ac4f8e410816ac4f8e810c16ac4f8ec10016bc4f8f010416bc4f8f410816bc4f8f810c16bc4f8fc10016cc4f80011416cc4f80411816cc4f80811c16cc4f80c11016dc4f81011416dc4f81411816dc4f81811c16dc4f81c117ff462afd6f800e00eea0c00b0f1005f40f08180def80000b8427cd19ef8ce00002840f050819ef8dc00002100288df8141000f0b08105aa505c002800f0838153185878002800f059819878002800f05781d878002800f055811879002800f053815879002800f051819879002800f04f81d879002800f04d81187a002800f04b81587a002800f04981987a002800f04781d87a002800f04581187b002800f04381587b002800f04181987b002800f03f81d87b002800f03d81187c002800f03b81587c002800f03981987c002800f03781d87c002800f0358114315029abd155e199f82a0270b1d9f82c0240b144f63421c2f207010968401a002800f3fb80002089f82a024cf61520c0f2460019b0bde8f04f004744f6d341c0f247014ff40c708847002800f0cc804ff6d051cff6ff7100224318463183f8302283f8312283f8322283f8332283f8342283f8352283f8362283f8372283f8382283f8392283f83a2283f83b2283f83c2283f83d2283f83e2283f83f2283f8402283f8412283f8422283f8432283f8442283f8452283f8462283f8472283f8482283f8492283f84a2283f84b2283f84c2283f84d2283f84e2283f84f2283f8502283f8512283f8522283f8532283f8542283f8552283f8562283f8572283f8582283f8592283f85a2283f85b2283f85c2283f85d2283f85e2283f85f2283f8602283f8612283f8622283f8632283f8642283f8652283f8662283f8672283f8682283f8692283f86a2283f86b2283f86c2283f86d2283f86e2283f86f2283f8702283f8712283f8722283f8732283f8742283f875227ff470af012180f8ce104ff0ff310760a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe1010e0002089f82802c9f8240289f82a02012089f829024cf61520c0f24600804714e000203060002089f82802c9f824024ff4163045f20f11069005a8c0f24701cdf814808847012089f82a0204a801f017f8c9f8d40019b0bde8f08f013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f2921d84ff0520050541dd00a4445204e29507018d04f204d29907014d052204c29d07010d044204b2910710cd045204a29507108d052204929907104d020204829d07140f08d8600208df8630001219ef8dd00002870d0002205ab985c00284fd09f18787838b3b87838b3f87838b3387938b3787938b3b87938b3f87938b3387a38b3787a38b3b87a38b3f87a38b3387b38b3787b38b3b87b38b3f87b38b3387c38b3787c38b3b87c38b3f87c38b31432502ad2d13ce0013222e0023220e003321ee004321ce005321ae0063218e0073216e0083214e0093212e00a3210e00b320ee00c320ce00d320ae00e3208e00f3206e0103204e0113202e0123200e013324f2a15d84ff05300985411d013444b204e2a58700cd049204d2a987008d050204c2ad87004d020204b2a187140f0608100208df8630001319ef8de0000286cd0002105aa505c00284fd05318587838b3987838b3d87838b3187938b3587938b3987938b3d87938b3187a38b3587a38b3987a38b3d87a38b3187b38b3587b38b3987b38b3d87b38b3187c38b3587c38b3987c38b3d87c38b314315029d2d138e0013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f2911d84ff0440050540dd00a4455204e29507008d050204d29907004d020204c29d07040f0ec8000208df8630001219ef8df0000284dd0002105aa505c002800f0bc8053185878002800f092809878002800f09080d878002800f08e801879002800f08c805879002800f08a809879002800f08880d879002800f08680187a002800f08480587a002800f08280987a002800f08080d87a00287ed0187b00287dd0587b00287cd0987b00287bd0d87b00287ad0187c002879d0587c002878d0987c002877d0d87c002876d014315029b4d1d0e0002940f0d180002105aa505c002800f0b88053185878002800f08e809878002800f08c80d878002800f08a801879002800f088805879002800f086809879002800f08480d879002800f08280187a002800f08080587a00287ed0987a00287dd0d87a00287cd0187b00287bd0587b00287ad0987b002879d0d87b002878d0187c002877d0587c002876d0987c002875d0d87c002874d014315029b6d181e0013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f295ad84ff05300505456d00a444e204e29507051d041204d2990704dd050204c29d07049d04f204b29107145d046204a29507141d02020492990713dd00020d0713de00020107113e7002058719fe6013122e0023120e003311ee004311ce005311ae0063118e0073116e0083114e0093112e00a3110e00b310ee00c310ce00d310ae00e3108e00f3106e0103104e0113102e0123100e013314f290dd84ff04f00505409d00a444b204e29507004d020204d29907040f07c8400208df8630000220df1140b1bf80200002850d00beb0203587838b3987838b3d87838b3187938b3587938b3987938b3d87938b3187a38b3587a38b3987a38b3d87a38b3187b38b3587b38b3987b38b3d87b38b3187c38b3587c38b3987c38b3d87c38b31432502ad0d12be0013222e0023220e003321ee004321ce005321ae0063218e0073216e0083214e0093212e00a3210e00b320ee00c320ce00d320ae00e3208e00f3206e0103204e0113202e0123200e013324f2a04d84ff077000bf8020003d100208df8630003e00beb020000214170def8d07000261bf80600002851d00beb0602507840b3907840b3d07840b3107940b3507940b3907940b3d07940b3107a40b3507a40b3907a40b3d07a40b3107b40b3507b40b3907b40b3d07b40b3107c40b3507c40b3907c40b3d07c40b31436502ed0d1502624e0013622e0023620e003361ee004361ce005361ae0063618e0073616e0083614e0093612e00a3610e00b360ee00c360ce00d360ae00e3608e00f3606e0103604e0113602e0123600e0133601240a2f1ed364224ff47a7342f2107504eb84004000b7fbf0f10a2911d304fb02f0b7fbf0f10a290bd304fb03f0b7fbf0f10a2905d36c43b7fbf4f00928e7d800e004463046cdf804e0cdf80c804f2e98bf4f20c0f10008009018eb060e53d0b7fbf4f00a2c00f130010bf806104cf6cd41ccf6cc41a4fb012147d31ef1010242d000fb147cc9085a46bcfbf1fb97190bf13000787048f21f50c5f2eb109246642ca4fb002033d31ef1020232d00bfb11c14009b1fbf0f244f6d35302f13005c1f26203bd70b4f57a7fa4fb033523d31ef10303d34617d002fb1010a90941f25973b0fbf1f2cdf2b713a4fb033502f13003fb7002fb110742f21070043684424fea5534a9d209e0009e07e0013605e0023602e0009e00e00336d346019900270bf806701bf80700002850d00beb0704607838b3a07838b3e07838b3207938b3607938b3a07938b3e07938b3207a38b3607a38b3a07a38b3e07a38b3207b38b3607b38b3a07b38b3e07b38b3207c38b3607c38b3a07c38b3e07c38b31437502fd0d13ae0013722e0023720e003371ee004371ce005371ae0063718e0073716e0083714e0093712e00a3710e00b370ee00c370ce00d370ae00e3708e00f3706e0103704e0113702e0123700e013374f2f13d84ff075000bf807000ed00beb070273204e2f507008d020204d2f907004d070204c2fd07040f0b98200208df86300d1f8d4604ff0000a1bf80a10002967d00beb0a04617859b3a17861b3e17869b3217971b3617979b3a17981b3e17989b3217a91b3617a99b3a17aa1b3e17aa9b3217bb1b3617bb9b3a17bc1b3e17bc9b3217cd1b3617cd9b3a17ce1b3e17ce9b30af1140abaf1500fced14ff0500a37e00af1010a34e00af1020a31e00af1030a2ee00af1040a2be00af1050a28e00af1060a25e00af1070a22e00af1080a1fe00af1090a1ce00af10a0a19e00af10b0a16e00af10c0a13e00af10d0a10e00af10e0a0de00af10f0a0ae00af1100a07e00af1110a04e00af1120a01e00af1130a01240a2e1ed364224ff47a7342f2107704eb84014900b6fbf1f50a2d11d304fb02f1b6fbf1f50a2d0bd304fb03f1b6fbf1f50a2d05d37c43b6fbf4f10929e7d800e00c46d646baf14f0f98bf4ff04f0ecef1000842f2107c18eb0a074dd0b6fbf4f14cf6cd4001f13002ccf6cc400bf80a200a2ca4fb003241d37b1c3dd001fb1461d208b1fbf2f548f21f5005f130030beb0a06c5f2eb107370642ca4fb000330d3b81c29d005fb12115a09b1fbf2f5b4f57a7f05f13000b07044f6d350c1f26200a4fb000320d3f81c16d005fb1210990941f25973b0fbf1f2cdf2b713a4fb033502f13003f37002fb11060af1040a64454fea5534afd209e0f24607e00af1010a04e00af1020a01e00af1030a039c00220bf80a20cdf808901bf80200002850d00beb0200417839b3817839b3c17839b3017939b3417939b3817939b3c17939b3017a39b3417a39b3817a39b3c17a39b3017b39b3417b39b3817b39b3c17b39b3017c39b3417c39b3817c39b3c07c38b31432502ad0d132e0013222e0023220e003321ee004321ce005321ae0063218e0073216e0083214e0093212e00a3210e00b320ee00c320ce00d320ae00e3208e00f3206e0103204e0113202e0123200e013324f2a0bd84ff075000bf8020006d00beb020073214e2a417040f0538100208df863009df81490b9f1000f10d002220beb020111f8013c63b11bf8023063b14b784bb1897804320029f1d1023a04e0002105e0013a00e0013202eb4201490041eae1718a1c04f5207c01f1010e02f0030822f0030704f5a0724ff0ff3504e001350d2d02f5a07269d005eb8501bef1030f0ceb811405d24ff0ff31b8f1000f2ed1ede70021164604e000bf8f4206f1020621d04b1cdb09042b03d8337803f0f00333708b1cdb09042b03d8737803f00f037370cb1cdb09042b03d8737803f0f00373700431cb09042bdfd84b08e05c00f00f00e054d9e70139b8f1000fbfd08e1cf009042808d87008235cce076ff00f0608bf0f2633402354b8f1010fafd0ce1cf009042809d87008235cce074ff00f0608bf6ff00f0633402354b8f1020f9ed00e1df00904289ad87008c907235c6ff00f0108bf0f211940215490e7b9f1000f00f0ab80039843f6a10cc0f2000c00f2812a02220df1140efc4440f27d2b40f27a2808e01ef8019f0632b9f1000f0af1030a00f09280a9f17f0010f15f0ff1d309eb49000ceb8000a0f5c0700027d409514605e000bf02370c2f01f52071e1d0c357042c06d8b3f1ff3f03dc0e7846f0f0060e70042cdeb206d816f0400303d00b7843f00f030b70b30605d55a4503d84b7843f0f0034b70f30606d5b2f51f7f03d84b7843f00f034b7033074fea920305d59e2b03d88d7845f0f0058d70750705d5424503d88d7845f00f058d70c51995f90160042c08d8b6f1ff3f05dc91f8405145f0f00581f84051042cf6b208d816f0400505d091f8405145f00f0581f84051b50607d55a4505d891f8415145f0f00581f84151f50608d5b2f51f7f05d891f8415145f00f0581f84151350707d59e2b05d891f8423143f0f00381f8423173077ff588af42453ff685af91f8423143f00f0381f842317de7dde90298fff719b900218170ace60020107146e50020d070fff783bb00201072fff772b9f0b581b041f204054cf65561cef20005ccf2ac51c5f8ac1f4ef6fc51cef200010a6843f6fc7642f080720a6055f8041cc2f2000641f0010145f8041c316807460a466ff39602b2f1005f07d108684ef66362ccf2ff02904200f0cb8044f6d341c0f247014ff40c708847002800f0f98001464ff6d050cff6ff7000220b18463083f8302283f8312283f8322283f8332283f8342283f8352283f8362283f8372283f8382283f8392283f83a2283f83b2283f83c2283f83d2283f83e2283f83f2283f8402283f8412283f8422283f8432283f8442283f8452283f8462283f8472283f8482283f8492283f84a2283f84b2283f84c2283f84d2283f84e2283f84f2283f8502283f8512283f8522283f8532283f8542283f8552283f8562283f8572283f8582283f8592283f85a2283f85b2283f85c2283f85d2283f85e2283f85f2283f8602283f8612283f8622283f8632283f8642283f8652283f8662283f8672283f8682283f8692283f86a2283f86b2283f86c2283f86d2283f86e2283f86f2283f8702283f8712283f8722283f8732283f8742283f875227ff470af4ef66360ccf2ff000860012081f8ce004ff0ff30a1f8e000a1f8e200a1f8e400a1f8e600a1f8e800a1f8ea00a1f8ec00a1f8ee00a1f8f000a1f8f200a1f8f400a1f8f600a1f8f800a1f8fa00a1f8fc00a1f8fe003160d1f8d800b0bb44f6342245f6e464c2f20702cff6f8741368204616689e420ed116689e420bd116689e4208d116689e4203d1002800f10400efd19e421ad02b6816681068b0420ed11068b0420bd11068b04208d11068b04203d1002c04f10404efd1b04206d02868c01ac1f8d80001e0002030602868386001b0f0bd00bf2de9f04141f2040843f6fc77cef20008c2f200070146d8f8004038680d6801466ff39601b1f1005f07d101684ef66362ccf2ff02914200f0ca8044f6d341c0f247014ff40c708847002800f0d0804ff6d051cff6ff7100224318463183f8302283f8312283f8322283f8332283f8342283f8352283f8362283f8372283f8382283f8392283f83a2283f83b2283f83c2283f83d2283f83e2283f83f2283f8402283f8412283f8422283f8432283f8442283f8452283f8462283f8472283f8482283f8492283f84a2283f84b2283f84c2283f84d2283f84e2283f84f2283f8502283f8512283f8522283f8532283f8542283f8552283f8562283f8572283f8582283f8592283f85a2283f85b2283f85c2283f85d2283f85e2283f85f2283f8602283f8612283f8622283f8632283f8642283f8652283f8662283f8672283f8682283f8692283f86a2283f86b2283f86c2283f86d2283f86e2283f86f2283f8702283f8712283f8722283f8732283f8742283f875227ff470af4ef66361ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe103860d0f8d81081b144f6d350c1f26200a1fb0001880901284ff0010088bf88094ce000203860fa2048e044f6342245f6e466c2f20702cff6f8761368314600bf17689f420ed117689f420bd117689f4208d117689f4203d1002901f10401efd19f422ad0d8f80030176800bf1168b9420ed11168b9420bd11168b94208d11168b94203d1002e06f10406efd1b94214d0d8f8001044f6d357ca1ac1f26207a2fb0776c0f8d820b00901284ff0010088bfb009994208bffa2000e0fa20611bb1fbf0f0bde8f08100bf2de9f04f85b0044618b1a069002840f0e28043f6fc75c2f20005286844f6d34701466ff39601b1f1005fc0f2470707d101684ef66362ccf2ff02914200f0c7804ff40c70b847002800f0c0804ff6d051cff6ff71002200bf4318463183f8302283f8312283f8322283f8332283f8342283f8352283f8362283f8372283f8382283f8392283f83a2283f83b2283f83c2283f83d2283f83e2283f83f2283f8402283f8412283f8422283f8432283f8442283f8452283f8462283f8472283f8482283f8492283f84a2283f84b2283f84c2283f84d2283f84e2283f84f2283f8502283f8512283f8522283f8532283f8542283f8552283f8562283f8572283f8582283f8592283f85a2283f85b2283f85c2283f85d2283f85e2283f85f2283f8602283f8612283f8622283f8632283f8642283f8652283f8662283f8672283f8682283f8692283f86a2283f86b2283f86c2283f86d2283f86e2283f86f2283f8702283f8712283f8722283f8732283f8742283f875227ff470af4ef66361ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe102860002c18bf002807d14af26950c0f2450005b0bde8f04f0047d4f80cb0bbf1000ff2d0d4f82080b8f1000fedd082465af8041f002900f087804169002900f08680416a002900f08580416b002900f08480416c002900f08380416d002900f08280416e002900f08180416f002900f08080d0f8841000297ed0d0f8941000297dd0d0f8a41000297cd0d0f8b41000297bd0d0f8b01002690491d0f8a010d0f820900391d0f8901000250291d0f88010066f0191016bd0f860e0d0f850c0036c914538bf4a4638bf012591423cbf0a46022593423cbf1a46032594453cbf6246042596453cbf7246052596423cbf324606250199814691423cbf0a460725029991423cbf0a460825039991423cbf0a4609250499914238bf0a46d0f8c01038bf0a25914238bf0b250aeb0511496807f1440208462e01904700204af8060001204e4689f8df0022e0064600251fe0064601251ce00646022519e00646032516e00646042513e00646052510e0064606250de0064607250ae00646082507e00646092504e006460a2501e006460b254046b84700283ff439afb44608f0030e5fea98074ff000031cd00495a3eb8703461c0bf101056ff00307e919ca7806eb070989f803200a79043789f804204a7989f805208979da19043289f80610ecd1049d3b1dbef1000f10d01bf80370bef1010fc7540ad05f1c1bf80760bef1020fc65503d09a1c1bf8023083540aeb05125060dcf8c4002b014af80340431cc2f80880ccf8c430d060f0e638464146fff702be2de9f04f81b0044650b1a06940b14cf2af53c0f24d03204601b0bde8f04f184743f6fc79c2f20009d9f8005044f6d34828466ff39600b0f1005fc0f2470807d128684ef66363ccf2ff03984200f0ca804ff40c700f461646c0470546002800f01e814ff6d050cff6ff7000212a18463082f8301282f8311282f8321282f8331282f8341282f8351282f8361282f8371282f8381282f8391282f83a1282f83b1282f83c1282f83d1282f83e1282f83f1282f8401282f8411282f8421282f8431282f8441282f8451282f8461282f8471282f8481282f8491282f84a1282f84b1282f84c1282f84d1282f84e1282f84f1282f8501282f8511282f8521282f8531282f8541282f8551282f8561282f8571282f8581282f8591282f85a1282f85b1282f85c1282f85d1282f85e1282f85f1282f8601282f8611282f8621282f8631282f8641282f8651282f8661282f8671282f8681282f8691282f86a1282f86b1282f86c1282f86d1282f86e1282f86f1282f8701282f8711282f8721282f8731282f8741282f875127ff470af4ef66360ccf2ff002860012085f8ce004ff0ff30a5f8e000a5f8e200a5f8e400a5f8e600a5f8e800a5f8ea00a5f8ec00a5f8ee00a5f8f000a5f8f200a5f8f400a5f8f600a5f8f800a5f8fa00a5f8fc00a5f8fe00c9f8005005f1040b4ff0000a4ff000094ff0ff30002200234ff0ff3105e000bf6032c02a03f1060332d0af187e68a64204d13e6986423cbf194630467e69a64204d13e6a86423cbf591c30467e6aa64204d13e6b86423cbf991c30467e6ba64204d13e6c86423cbfd91c30467e6ca64204d13e6d86423cbf191d30467e6da642ced13f6e87423cbf591d3846c8e700bf002910d40beb01104768090182684bf801a02046394600f013f8814608f1440138468847ace7484601b0bde8f08f204639463246c9f8005001b0bde8f04fffe72de9f047a4b0804640f6bb4043f6fc77c0f24e0091468a46c2f2000780473c68002021466ff39601b1f1005f02908df80c0007d120684ef66361ccf2ff01884200f0cb8044f6d341c0f247014ff40c7088470446002800f0bf804ff6d050cff6ff7000212218463082f8301282f8311282f8321282f8331282f8341282f8351282f8361282f8371282f8381282f8391282f83a1282f83b1282f83c1282f83d1282f83e1282f83f1282f8401282f8411282f8421282f8431282f8441282f8451282f8461282f8471282f8481282f8491282f84a1282f84b1282f84c1282f84d1282f84e1282f84f1282f8501282f8511282f8521282f8531282f8541282f8551282f8561282f8571282f8581282f8591282f85a1282f85b1282f85c1282f85d1282f85e1282f85f1282f8601282f8611282f8621282f8631282f8641282f8651282f8661282f8671282f8681282f8691282f86a1282f86b1282f86c1282f86d1282f86e1282f86f1282f8701282f8711282f8721282f8731282f8741282f875127ff470af4ef66360ccf2ff002060012084f8ce004ff0ff30a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe003c60baf1000f4ff0010618bfb9f1000f20d101af3846fff72ff902ad404651464a460123009500f01dfe05463846fff75bfa002e064608d19df80c0028b943f61f00c0f247004c308047002c18bfc4f8d06022e09af8000008280ed9a0f18301052905d8012202fa01f111f0290f09d100f07f000928ccd104e00121814011f4a47febd03cb143f61f00c0f24700804794f8280228b14ff0ff35284624b0bde8f0870026b5e700bf43f6fc70c2f20000016808466ff39600b0f1005f16d108684ef66362ccf2ff0290420fd1d1f8fc0160b144f63422c2f207021268801a0028cebf01200020c1f8fc0170470020704743f6fc70c2f20000016808466ff39600b0f1005f18d108684ef66362ccf2ff02904211d1d1f82c0270b144f63422c2f207021268801a0028cfbf01200020c1f82c0281f82a02704700207047f0b101684ef66362ccf2ff02914218bf704790f8061299b110b544f62f344ff0000cc0f24604864680f806c20120002100220023aef804c2a446bde810406047704700bf70b543f6fc76c2f200063468054621466ff39601b1f1005f07d120684ef66361ccf2ff01884200f0cc8044f6d341c0f247014ff40c708847002800f0ea8004464ff6d050cff6ff70002100bf2218463082f8301282f8311282f8321282f8331282f8341282f8351282f8361282f8371282f8381282f8391282f83a1282f83b1282f83c1282f83d1282f83e1282f83f1282f8401282f8411282f8421282f8431282f8441282f8451282f8461282f8471282f8481282f8491282f84a1282f84b1282f84c1282f84d1282f84e1282f84f1282f8501282f8511282f8521282f8531282f8541282f8551282f8561282f8571282f8581282f8591282f85a1282f85b1282f85c1282f85d1282f85e1282f85f1282f8601282f8611282f8621282f8631282f8641282f8651282f8661282f8671282f8681282f8691282f86a1282f86b1282f86c1282f86d1282f86e1282f86f1282f8701282f8711282f8721282f8731282f8741282f875127ff470af4ef66360ccf2ff002060012084f8ce004ff0ff30a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe00346000230820032184f81b322a2384f8180284f81912102184f81c32042384f81e02012045f61b4c04f5067284f81a1284f81d3284f81f0284f82012002d18bf0125c0f2470c0a2384f82152bde8704060470020306070bd2de9f04143f6fc77c2f200073f684ff000083c466ff39604b4f1005f07d13e684ef66365ccf2ff05ae4208bfb84601280fd11c4615460f460646fff769fe2346044639462a463046002c18bfb8f1000f06d144f62f3cc0f2460cbde8f041604798f8060270b1d8f800020021002888f80612a8f804123ed049f2d941c0f24401884738e0b8f804020121013080b2012898bf0846a8f80402d8f8000249f2d944c0f2440488f8061268b94ff6eb40cff6ff70a4f594777844002142460023b847c8f8000240b1a047d8f80002a4f140024ff4c8719047c8b198f80602002808bfbde8f081d8f80002002188f80612a8f8041200b1a04744f62f3cc0f2460c0120002100220023bde8f04160474af26950c0f245008047012830d1082088f80802032088f80902102088f80a02002088f80b02b22088f80c02062088f80d0288f80e024620b8f8041288f80f02432088f8100201200f0a45f6153c08f5027288f8110288f8120288f81312c0f2470c09210d2388f81472bde8f0416047bde8f08170b50446d0f8000249f2b1360d46c0f2440668b94ff60540cff6ff707844002122460023b0470028c4f8000208bf70bd06f594718847d4f8000206f1e8022946bde87040104700bf2de9f04f83b04768002f00f0a2828368002b00f09e824ef6636e07eb030b4ff00008ccf2ff0e0025002414e044f63423c2f207031b6845f69075c0f201052b44c4f8fc31029b4b4400255b451f464ff0000480f07e82ba461af9013b03f07f06ae40002b44ea060410d404f00703012b16dc0bb3012b40f06c82abeb0a03082bc0f0678207f10903dee700bfda4580f06082182d05f107055746dcd959e200bf022b3ad0052b40f05482abeb0a03042bc0f04f827b1dc7e7da4580f04a8297f90130002b07f10203bed55b4580f0418297f90230b3f1ff3f07f10303b4dc5b4580f0378297f90330b3f1ff3f07f10403aadc5b4580f02d8297f90430b3f1ff3f07f10503a0dc5b4580f0238297f90530002b00f11e82bb1d96e7da4580f0198297f9013007f1020c002b03f07f091fd5dc4580f00e8297f90250fb1c05f07f06b5f1ff3f49eac61902dde2469c460fe05b4580f0fe8197f9036007f1040c06f07f05b6f1ff3f49ea853940f323819a46abeb0c03994500f2ec8124f00703b3f54a7fcdf808c07ff45dafb9f1060ffff459af029b1b78462b7ff454af9af80230432b7ff44faf9af80330012b7ff44aaf43f6fc76c2f20006346823466ff39603b3f1005f03d12368734500f0d180019144f6d34105464ff40c70c0f2470117468847002800f028814ff6d05301990446cff6ff7328463a46e718463387f8308287f8318287f8328287f8338287f8348287f8358287f8368287f8378287f8388287f8398287f83a8287f83b8287f83c8287f83d8287f83e8287f83f8287f8408287f8418287f8428287f8438287f8448287f8458287f8468287f8478287f8488287f8498287f84a8287f84b8287f84c8287f84d8287f84e8287f84f8287f8508287f8518287f8528287f8538287f8548287f8558287f8568287f8578287f8588287f8598287f85a8287f85b8287f85c8287f85d8287f85e8287f85f8287f8608287f8618287f8628287f8638287f8648287f8658287f8668287f8678287f8688287f8698287f86a8287f86b8287f86c8287f86d8287f86e8287f86f8287f8708287f8718287f8728287f8738287f8748287f875827ff470af4ef6636e0123ccf2ff0e84f8ce304ff0ff33c4f800e0a4f8e030a4f8e230a4f8e430a4f8e630a4f8e830a4f8ea30a4f8ec30a4f8ee30a4f8f030a4f8f230a4f8f430a4f8f630a4f8f830a4f8fa30a4f8fc30a4f8fe3034609af804309af805709af80660032b47ea062732dd052b61dc042b00f08180052b7ff458aed4f82c32002b00f0cb8044f63425c2f207052f68db1b002bd8bf84f82a82c1e0dc4580f0cc8097f904607b1d06f07f05b6f1ff3f49ea45593ff7bdae5b4580f0be8097f90550002d00f1b98007f1060c49ea0579c1e6012b3ff41eae022b7cd0032b7ff425aecde900208a467546fff7a1fb009a03460198ae465146002b3ff417ae94f80632002b3ff412ae204641f28831a4f80472fff7c5fddde90020ae46514605e6019928463a46c6f800804ef6636eccf2ff0efbe5062b49d0072b7ff4f7ad01904ef68f30c0f2490015460f4674468047034601985e1ea64639462a46012e3ff6e5ad981eb0fa80f04009fff7cdfba646394601982a46d9e5019015468a467646fff756fb03460198b64651462a46002b3ff4ccad94f80632002b3ff4c7adb4f80432bb427ff4c2add4f8003284f80682002ba4f804823ff4b9ad49f2d9411846c0f244018847b6465146d2e7c4f82c8284f82a82aae594f80632c4f8fc81002b3ff4a4ad0546d4f800028a46174684f80682a4f8048220b149f2d941c0f24401884744f62f340120002100220023c0f24604a04728463a46514686e784f82a8244f63423c2f207031b6845f69075c0f201052b44c4f82c3278e540f22113c0f2490303b0bde8f04f184700bf7fb50646002806d1fff7ecfa002807d19de80f00064641f6d77cc0f24e0c60477fbd00bf092959d12de9f047a22602eb030cd65406268cf8016041f65868c0f200084ff0000ef84418f80e700ceb0e0508eb0e06ef707778b47896f8039096f804a02f716c7185f8069085f807a074790ef11b0e2c72b479bef1510f6c72f479ac72347aec72747a2c73b47a6c73f47aac73347bec73747b2c74b47b6c74f47bac74347cec74747c2c75b47c6c75f47cac75347dec75747d2c76b47d6c76f47dac76347eec76747e2c77b47e6c77bbd1502753338cf80270bde8f04745f6153cc0f2470c604700bfb0b582b00c460546fff79cfaa0b14df63040c2f23400007804280bd14af26b140025c0f24d04002000210022092301950095a04702b0b0bd4af69d62c0f246022846214602b0bde8b0401047f0b583b04ff6e70714460d460646c0f24507fff771faf8b14df63040c2f234000078042818d144f2d040c2f207000068b84788b10068e0280ed14af26b160027c0f24d060020002100220a2301970097b047012003b0f0bd07f1160330462946224603b0bde8f040184700bf2de9f04f95b0002918bf002a04d115b0bde8f04f00f06cbe0f78ddf878b007f07f06082e5bdc052e00f00981072e00f09482082e5bd10746002b4ff0ff3000f042864af28973cff6fd73d61802339e42c0f0398691f801903846b9f1000f00f0788202274ff00108be1c964200f2c285cb19cf5d5b7857ea032300f0bb859f19974200f2b7858446885d09280dd9a0f18305062d4ff0ff3000f2158608fa05f515f0490f06d100f00ebe08fa00f515f4127fecd014460d46314460461a4600236646cdf800b0fff79bff002840f09285b9f10109294622463046c5d139e2092e00f0ad810a2e00f05983422e8fd0f51e18bf0125b41f18bf0124032afff487af25407ff484af00254c1ca2f1010c8df81c508df81d508df820508df824508df825508df826508df827508df828508df829508df82a508df82b508df82c508df82d508df82e508df82f508df830508df831508df832508df833508df834508df835508df836508df837508df838508df839508df83a508df83b508df848508df849508df84a508df84b508df84c508df84d508df84e508df84f508df850508df851508df852508df85350cde9074c4df2b304cff6ff747c440f944df2b704cff6ff747c44032e1094119500f02084062e40f010850646002000211d4601f022f9b168002900f00685b6f84020b6f842005043b0f5163fc0f0fd8407a84ff4a0724ff4f07301f06afa002800f0f384dbf800000f280dd80bebc0010022ca800a814ff420724a814ff4f07201308a81cbf80000002d304640f08c8100f043bd43f6fc78c2f20008022a2cbf4d78ff25d8f8004020466ff39600b0f1005f07d120684ef66363ccf2ff03984200f0d0800f4644f6d341c0f247014ff40c7016468847002800f08a8304464ff6d050cff6ff70002132462318463083f8301283f8311283f8321283f8331283f8341283f8351283f8361283f8371283f8381283f8391283f83a1283f83b1283f83c1283f83d1283f83e1283f83f1283f8401283f8411283f8421283f8431283f8441283f8451283f8461283f8471283f8481283f8491283f84a1283f84b1283f84c1283f84d1283f84e1283f84f1283f8501283f8511283f8521283f8531283f8541283f8551283f8561283f8571283f8581283f8591283f85a1283f85b1283f85c1283f85d1283f85e1283f85f1283f8601283f8611283f8621283f8631283f8641283f8651283f8661283f8671283f8681283f8691283f86a1283f86b1283f86c1283f86d1283f86e1283f86f1283f8701283f8711283f8721283f8731283f8741283f875127ff470af4ef66360ccf2ff002060012084f8ce004ff0ff303946a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe00c8f8004094f8080178b1d4f8040148b149f29943c0f2440340330e46174698473a463146002084f808010123032a80f0b782c1e23f064ff0210658bf1126b242c0f0d383002f01f101050ed54af26952c0f245020f4604461e469047334601462046022918bf07f1110584462879697950ea01264ff0ff301ebfa979ea7951ea022900f01b84297b6a7b41ea02218e4240f01484a97bea7b41ea0221894540f00d842878697840ea01217018b0f5207f4ff0ff3000f20284aa78ec7842ea042209eb0204b4f5f07f00f2f8832c7a6f7a44ea072806eb0807b7f5207f00f2ee83af7aed7a47ea052509eb0507b7f5f07f00f2e483dcf80800002800f07683bcf84070bcf842406743b7f5163fc0f06d839a4643466446cde90169009500f073fddbf800000f280ad80bebc0010130a1f806800d814e81a1f80c90cbf80000baf1000f00f0ba832046594600f046fcb4e343f6fc74c2f20004236818466ff39600b0f1005f07d118684ef66367ccf2ff07b84200f0cf800e4644f6d341c0f247014ff40c70154688470346002800f0bf804ff6d050cff6ff7000211a18463082f8301282f8311282f8321282f8331282f8341282f8351282f8361282f8371282f8381282f8391282f83a1282f83b1282f83c1282f83d1282f83e1282f83f1282f8401282f8411282f8421282f8431282f8441282f8451282f8461282f8471282f8481282f8491282f84a1282f84b1282f84c1282f84d1282f84e1282f84f1282f8501282f8511282f8521282f8531282f8541282f8551282f8561282f8571282f8581282f8591282f85a1282f85b1282f85c1282f85d1282f85e1282f85f1282f8601282f8611282f8621282f8631282f8641282f8651282f8661282f8671282f8681282f8691282f86a1282f86b1282f86c1282f86d1282f86e1282f86f1282f8701282f8711282f8721282f8731282f8741282f875127ff470af4ef66360ccf2ff001860012083f8ce004ff0ff30a3f8e000a3f8e200a3f8e400a3f8e600a3f8e800a3f8ea00a3f8ec00a3f8ee00a3f8f000a3f8f200a3f8f400a3f8f600a3f8f800a3f8fa00a3f8fc00a3f8fe0031462a462360022a2cbf4978ff21002b00f0cc8202294ff0000000f0e681012900f0df81002940f0c2824ff0ff31c3f8dc00a3f8cc00c3f8c800a3f8e010a3f8e210a3f8e410a3f8e610a3f8e810a3f8ea10a3f8ec10a3f8ee10a3f8f010a3f8f210a3f8f410a3f8f610a3f8f810a3f8fa10a3f8fc10a3f8fe1083f8000115b0bde8f08f022ac0f0298243f6fc74c2f20004206802466ff39602b2f1005f07d102684ef66363ccf2ff039a4200f0cc800d4644f6d341c0f247014ff40c708847002800f097814ff6d051cff6ff7100224318463183f8302283f8312283f8322283f8332283f8342283f8352283f8362283f8372283f8382283f8392283f83a2283f83b2283f83c2283f83d2283f83e2283f83f2283f8402283f8412283f8422283f8432283f8442283f8452283f8462283f8472283f8482283f8492283f84a2283f84b2283f84c2283f84d2283f84e2283f84f2283f8502283f8512283f8522283f8532283f8542283f8552283f8562283f8572283f8582283f8592283f85a2283f85b2283f85c2283f85d2283f85e2283f85f2283f8602283f8612283f8622283f8632283f8642283f8652283f8662283f8672283f8682283f8692283f86a2283f86b2283f86c2283f86d2283f86e2283f86f2283f8702283f8712283f8722283f8732283f8742283f875227ff470af4ef66361ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe10294620604978012900f00981002940f04381002480f807424af26950c0f24500804701462046012940f09f8145f2e550c0f25400883015b0bde8f04f00470023c8f80030002439463246032a0bd355b98878082800f2888142f6c521c0f250019631884780e1052a1ad3012d18d18d78681e06284ff0000000f27781cb78032b00f273810a79002a00f06f8142f6c520c0f2500000f59a7728461946b84763e1022d40f0888042f6c520c0f2500080475ae13f0600f1d080082ac0f0ed8081464ff0070e4ff0050c01268c19a5784ff0ff30002d00f04981e778002f00f0458111f806a04fea850808eb8a06b6f5207f00f23b8164787e0006eb4407b7f5f07f00f2338101eb0c00cdf81890894611f80c104078774641ea002081b20120cde9043200f0d1fc002840f01e8106998868002800f0b180b1f84020b1f842105143b1f5163fc0f0a88009eb0701079105996a00c91b089104eb840100ebc11000eb4a0107a8334600f00bfe002800f09480dbf8001004980f290cd84fea8a0263000bebc1070131fa803b81a7f80a80be81cbf80010002806987ff42dade4e0012083f8ce00e0e083f8ce0015b0bde8f08f0020206070e0072a73d3032d71d18878cb780a7940ea03204d798e7901284ff0010498bf204644f62061884228bf084642f6c521c0f25001642a28bf642201f5e2731146984744f20450c2f207000068002800f0b18045ea062149f29942012988bf0c46c0f2440221469047a4e00121044680f807124af26950c0f245008047012840f0998045f2e550c0f254008047014600284ff0000000f08f8084f80702084615b0bde8f08f0c2a1dd3cf78ce79b74219d10f790e7ab74215d14af26954c0f245040d46164680461f46a047324605263b462946c146022808bf01264ff00b0e4ff0090c18e74ff0ff3015b0bde8f08f032a4ff000005fd32f1fb7fa87f77f093b4059d0d01e4cf6cd42ccf6cc428b78a0fb0202b3eb920f88bf9308302b184628bf3020002b4ad000eb800303f0030c03f4fe770023ce18f578e21882f80a513579043382f80b5175799f4282f80c51b67982f80d61eed1bcf1000f10d01944ca782344bcf1010f83f80a2108d00a79bcf1020f83f80b211cbf497983f80c1184f80801d4f8040149f29945c0f24405002184f8091160b94cf2d350cff6ff70a5f1e807784422460023b847c4f8040158b10121a847002015b0bde8f08f0020a4f8080115b0bde8f08f42f6c5200025c0f2500084f808518047284615b0bde8f08ff0b583b043f6fc73c2f200031f683b466ff39603b3f1005f09d13b684ef66366ccf2ff06b34204bf002387f82a32002958d0362a56d30b78422b53d14b784d2b50d10b7f4f7f43ea0723042b4ad18b7dcf7d0e7e43ea072343ea06434f7e8e7ccd7c53ea076346ea05270e7d4d7d47ea064747ea05641d4648bf5d42b0f84070002b4ff00003c8bf0123bc422ad1b0f84270bd4226d18f7ace7a91f80cc047ea06274e7b47ea0c4747ea0667974219d2621c032606eb5202866822f0030cca19cde901c30746304621462346009500f0d5fe3846314622462b4600f069ff002003b0f0bd4cf2af53c0f24d0303b0bde8f04018472de9f04182b043f6fc77c2f200073d68884629466ff39601b1f1005f064607d128684ef66361ccf2ff01884200f0cb8044f6d341c0f247014ff40c7088470546002800f0bf804ff6d050cff6ff7000212a18463082f8301282f8311282f8321282f8331282f8341282f8351282f8361282f8371282f8381282f8391282f83a1282f83b1282f83c1282f83d1282f83e1282f83f1282f8401282f8411282f8421282f8431282f8441282f8451282f8461282f8471282f8481282f8491282f84a1282f84b1282f84c1282f84d1282f84e1282f84f1282f8501282f8511282f8521282f8531282f8541282f8551282f8561282f8571282f8581282f8591282f85a1282f85b1282f85c1282f85d1282f85e1282f85f1282f8601282f8611282f8621282f8631282f8641282f8651282f8661282f8671282f8681282f8691282f86a1282f86b1282f86c1282f86d1282f86e1282f86f1282f8701282f8711282f8721282f8731282f8741282f875127ff470af4ef66360ccf2ff002860012085f8ce004ff0ff30a5f8e000a5f8e200a5f8e400a5f8e600a5f8e800a5f8ea00a5f8ec00a5f8ee00a5f8f000a5f8f200a5f8f400a5f8f600a5f8f800a5f8fa00a5f8fc00a5f8fe003d60b068002818bf002d02d102b0bde8f081b6f84010b6f842205143b1f5163ff4d3c5f8240201264ff4f07085f8286201904ff4207044f267040090c0f2470400200021002200230027a04730b185f82872c5f8247202b0bde8f08188f8046002b0bde8f08100bf2de9f04f8ab0dde914a5089243ea010242ea0a02d207864640f0c4800eeb51004ff0ff374fea5a0c0eeb53068646012207eb5a00bcf1010f88bf4fea5a02069002f003000790caf341006ff00107059007eb5a006ff00207019007eb5a00009022f00302701c544203900ef101004ff0000b09960290cdf810e004e00bf1010bab4500f0c3810898139e5f466fea0b02864288bfaf183a183744099802eb820207eb87070eeb82198b4200eb871835d9059e6246b6b10698012e19f8002008f8002002460ed00198022e19f8002008f80020024606d0009819f8002008f80020024600bf06980328c8d300bf09eb020717f8016c08eb020000f8016c17f8026c043a00f8026c17f8036c00f8036c17f8047c00f8047ce9d1b0e700bfbaf1080f02d2002223e000bf03989601ba0102440298e64600eb060a6ff0030c0aeb0c00c67802eb0c07fe7006790cf1040c3e7146797e71807904eb0c060436b871edd10cf10402dde914a5f446ddf810e0079800283ff483af079e19f80200012e08f802003ff47baf501c079e19f80070022e08f800703ff472af901c19f8002008f800206be74ff6fc7000ea0a000af0030b0990aaf1010000240490cde905be07e0079c159d0134ddf850a0ac4200f01e81089f139ee0432246be42079488bf2a18d01900eb80000eeb801c901900eb8000baf1040f0eeb80184ff00009c0f09880ddf810a0ddf850e048468b4288bf504600eb010400eb03054fea54001cf800706ff0010080ea090009f1010288bf0eeb00026ff0020089ea000609f1020088bf0eeb06006ff0030686ea090609f1030b4feac47488bf0eeb060b07f00f06002c4fea550408bf3e0918f80470ed0707f00f0507f0f007374408bf45ea061708f80470541865081cf805501a44e40705f00f064fea520408bf2e0918f80450d20705f00f0205f0f005354408bf42ea0615421808f8045054081cf804401844d20704f00f054fea500208bf250918f80240c00704f00f0004f0f0042c4408bf40ea05140beb010008f8024042081cf802200beb0304c00702f00f054fea540008bf150918f80020e40702f00f0402f0f0022a4408bf44ea051208f80020099809f104098145aaf1040a7ff46eafdde905bebbf1000f3ff444af6fea09004a468b42149f88bf3a18501845081a44c0071cf805504fea520018f8007005f00f0408bf2c0907f00f0507f0f0072744d20708bf45ea0417bbf1010f08f800703ff420af149809f10102a0eb090a8b4288bfaaf10202541865081a44e4071cf805504fea520418f8040005f00f0708bf2f0900f00f0500f0f0003844d20708bf45ea0710bbf1020f08f804003ff4faae09f102008b4288bfaaf10300421854081844d2071cf804704fea500218f8024007f00f0508bf3d0904f00f0704f0f0042c44c00708bf47ea051408f80240d9e60ab0bde8f08f00bf70b543f6fc76c2f2000632680c4611466ff39601b1f1005f054607d110684ef66361ccf2ff01884200f0cb8044f6d341c0f247014ff40c708847002800f00b8102464ff6d050cff6ff7000211318463083f8301283f8311283f8321283f8331283f8341283f8351283f8361283f8371283f8381283f8391283f83a1283f83b1283f83c1283f83d1283f83e1283f83f1283f8401283f8411283f8421283f8431283f8441283f8451283f8461283f8471283f8481283f8491283f84a1283f84b1283f84c1283f84d1283f84e1283f84f1283f8501283f8511283f8521283f8531283f8541283f8551283f8561283f8571283f8581283f8591283f85a1283f85b1283f85c1283f85d1283f85e1283f85f1283f8601283f8611283f8621283f8631283f8641283f8651283f8661283f8671283f8681283f8691283f86a1283f86b1283f86c1283f86d1283f86e1283f86f1283f8701283f8711283f8721283f8731283f8741283f875127ff470af4ef66360ccf2ff001060012082f8ce004ff0ff30a2f8e000a2f8e200a2f8e400a2f8e600a2f8e800a2f8ea00a2f8ec00a2f8ee00a2f8f000a2f8f200a2f8f400a2f8f600a2f8f800a2f8fa00a2f8fc00a2f8fe0032600120002d82f8cc0047d0104630f8e01fa1423bd0b2f8e210a14237d0b2f8e410a14233d0b2f8e610a1422fd0b2f8e810a1422bd0b2f8ea10a14227d0b2f8ec10a14223d0b2f8ee10a1421fd0b2f8f010a1421bd0b2f8f210a14217d0b2f8f410a14213d0b2f8f610a1420fd0b2f8f810a1420bd0b2f8fa10a14207d0b2f8fc10a14203d0b2f8fe10a1420ad1012082f8de0070bd0020306070bd82f8cd00002070bd92f8cd1081b9b2f8c810611a0bb2b3f1ff3f06dd89b2022924bf012182f8dd1002e0012182f8dc10b2f8ca30002182f8cd109c42a2f8c84088bfa2f8ca4092f8001120f81140481c00f00f0082f80001002070bd2de9f04fcdb04ef687249246c0f25b044df2546298460e4604f13c07c0f278020f2138230546b84718b12846a047002423e20afb08f040000b960295059001250da94ff4807004f585724ff0000b4ff0000947464ff000080023564604930a930697cdf820a00192029ce1602061204600219047e1680daa891a07910da900f0e681ddf82ce00021002400900be000bf04940c9c002101234ff0030807980134844200f0d181002940f0e0810da80c94045db8f1020febd0b8f1010f00f09280b8f1000f40f0968004f00f000a900598210900f0a6808842c0f08880401a05900a9800eb00140001039014e01cf80b000a9a00f0f00010440cf80b000bf1010b01390125b34524bf4ff0000b09f10109002900f08c81b9454ff000084ff0000338bf012380f0028109eb8900002d0eeb801cdbd0cdf82490a946a6eb0b05b5eb510f88bf4d088db3a8080ceb0b0820d0002708f10102a7eb80006ff0030600bf02eb060e043600eb060a1af104078ef803408ef804408ef805408ef80640efd1301d069f089eddf82ce015f0030204d10ce0002015f0030208d0012a08f8004004d04044022a447018bf8470a1eb4501ab4489b1b34510d21cf80b00039a00f00f001043ddf824900cf80b00013900250029a0d12be100bf00214d46ddf8249090e700bfbcb10598a04228d201214ff0000821e0ddf810a005985aea042a16d00c9c5045cdf810a080f0938001214ff00008002342e70c9c002101234ff002083ce70c9c00214ff00108012336e7002001214ff0000804900c9c00232ee7001b05900a9800eb00110001099015e000bf1af80b200a9802f0f00202430af80b200bf1010b013c0125b34524bf4ff0000b09f10109002c00f0da80b9454ff000084ff0000338bf012350d209eb8902002d0eeb821adcd0ac46a6eb0b05b5eb540f88bf650855b3ae080aeb0b0818d0002008f10102a0eb860e6ff00306901904360eeb06070437c170017141718171f5d1069fddf82ce0321d15f0030604d10de0002215f0030609d0012e08f8021005d04244022e517018bf917000bfa4eb4504ab447cb1089eb3450ed21af80b00099a00f00f0010430af80b00013c0025002cabd184e0089e002465469de70c9c0121b4e6a0eb0a0005900a9800eb00110001099015e01cf80b000a9a00f0f00010430cf80b000bf1010baaf1010a0125b34524bf4ff0000b09f10109baf1000f65d0b9454ff000084ff0000338bf01235bd20b9a09eb8900002d02eb801cdad0ce46a946a6eb0b05b5eb5a0f88bf4fea5a0545b3a8080ceb0b0817d0002408f10102a4eb80006ff003069719043684190434f97039717971b971f6d1301d069f089e0c9c15f0030204d10ce0002015f0030208d0012a08f8001004d04044022a417018bf8170aaeb450abaf1000fab4411d0b34511d21cf80b00099a00f00f0010430cf80b00aaf1010a0025f146baf1000fa6d10be04ff0000a4d46f14697e70c9c4ff00008002131e6012102e04ff000080021ddf82ce029e600980da973b1012817d04ff0000450b90798019ab0fa80f040094ff480703ff4ffad00e0002402984ef68721c0f25b01884720464db0bde8f08f059840ea0800b0fa80f04409eee72de9f04f83b00c9e0292002e019000f08e80019823f00304471c029803f0030ac4f1000c01384ff00008009005e000bf08f10108b0450f4479d00e98c14600286fea080418bf06eb0409002bf0d0042b06d24ff0000bbaf1000f2ed1e8e700bf0d98b64609fb00f400986ff003050444607800f0f00242ea10107a19d0706078043500f00f0646ea0010107114f8020f00f0f00646ea10105071207800f00f0646ea00100ceb050604369071e0d105f1040b7646baf1000fbad002980d9a4fea5b0509fb0204019814f805e008fb01050ef00f025feacb7908bf4fea1e1242ea0212baf1010f05f80b20a1d00bf1010e4fea5e00205cb9f1000f4fea101208bf00f00f0242ea0210baf1020f05f80e008ed00bf102004208a25cb9f1000f02f00f0408bf140944ea04122a5480e703b0bde8f08f2de9f04182b003fb02f68846cde9001645f20f1107466846c0f247011c461546884740f2196047f8240f788948f2816245ea0040b86045ea044057f8204c7860c0f2490220463946fe60c7f81080904740f25761c0f244012046884702b0bde8f0814556454e4346572f3820696d6735373620696d6736343020696d677a20726c652077616b656c65617365206469726563746662206662677561726420776561726e6f7469667920636f6d7061737331300000000000000000000000000000002020202020002020000000505050000000000000000000005050f85050f85050000000002070a8a07028a8702000000048a85010202854480000000020505020689090680000002020200000000000000000000010204040404020100000000040201010101020400000000000005020f82050000000000000002020f82020000000000000000000000020204000000000000000f800000000000000000000000000202000000000080810102020404000000000708898a8c88888700000000020602020202020700000000070888808102040f8000000007088083008088870000000000818284888f8080800000000f88080f00808887000000000708080f08888887000000000f808081010202020000000007088887088888870000000007088888878080870000000000000202000002020000000000000202000002020400000000008102040201008000000000000f80000f8000000000000004020100810204000000000708888102000202000000000708898a8a89880780000000070888888f888888800000000f08888f0888888f000000000708880808080887000000000e0908888888890e000000000f88080f0808080f800000000f88080f0808080800000000070888080b888887000000000888888f888888888000000007020202020202070000000003810101010909060000000008890a0c0c0a090880000000080808080808080f80000000088d8a8a888888888000000008888c8a89888888800000000708888888888887000000000f0888888f080808000000000708888888888a87008000000f0888888f0a0908800000000708880700808887000000000f8202020202020200000000088888888888888700000000088888850505020200000000088888888a8a8d88800000000888850202050888800000000888850502020202000000000f8081020408080f8000000007040404040404070000000004040202010100808000000007010101010101070000000205088000000000000000000000000000000000000f80040200000000000000000000000000000700878888878000000008080f088888888f00000000000007088808088700000000008087888888888780000000000007088f8808078000000001820702020202020000000000000788888888878087000008080f08888888888000000202000602020202070000000080800180808080808483000004040485060605048000000006020202020202070000000000000f0a8a8a8a8a8000000000000f08888888888000000000000708888888870000000000000f088888888f0808000000000788888888878080800000000b8c0808080800000000000007880700808f00000000020207020202020180000000000008888888888780000000000008888505020200000000000008888a8a8a870000000000000885020205088000000000000888888888878087000000000f810204080f800000000182020402020201800000000202020202020202000000000601010081010106000000048a8900000000000000000", "desc": "append injected blobs to main-app payload" }, { "offset": 777711, "old": "44c33500", - "new": "e3113600", + "new": "9f123600", "desc": "main-app subheader payload size (ps)" }, { "offset": 152, "old": "c4c33500", - "new": "63123600", + "new": "1f133600", "desc": "main-app TOC entry size (ps + 128)" }, { "offset": 777831, "old": "44c33504", - "new": "e3113604", + "new": "9f123604", "desc": "main-app preamble length (low 24 bits)" }, { "offset": 777835, "old": "df8110c9", - "new": "4c88426b", + "new": "bf1e07ba", "desc": "[5] ota/s200_firmware_ota.bin preamble crc32" }, { "offset": 156, "old": "c1be0fb1", - "new": "79b1f28b", + "new": "49a16905", "desc": "[5] ota/s200_firmware_ota.bin component crc32c (TOC)" }, { "offset": 777715, "old": "c1be0fb1", - "new": "79b1f28b", + "new": "49a16905", "desc": "[5] ota/s200_firmware_ota.bin component crc32c (subheader)" } ] diff --git a/app/graphics/icons.ts b/app/graphics/icons.ts index 11922394..ea2f77f6 100644 --- a/app/graphics/icons.ts +++ b/app/graphics/icons.ts @@ -52,6 +52,8 @@ export const ICON_SVGS = { '', music: '', + package: + '', activity: '', bell: diff --git a/app/native/file-access.ts b/app/native/file-access.ts index 4f0dfd0f..b79f3d5f 100644 --- a/app/native/file-access.ts +++ b/app/native/file-access.ts @@ -118,6 +118,77 @@ export function writeTextToDownloads(filename: string, text: string): string | n } } +/** Read a whole file as bytes; null when unreadable. */ +export function readBinaryFile(path: string): Uint8Array | null { + try { + const file = new java.io.File(path); + if (!file.isFile()) return null; + const bytes = java.nio.file.Files.readAllBytes(file.toPath()); + try { + // The V8 runtime can wrap a ByteBuffer's memory directly; copy out of it + // so the result outlives the Java array. + const arrayBuffer = (ArrayBuffer as any).from(java.nio.ByteBuffer.wrap(bytes)); + return new Uint8Array(arrayBuffer).slice(); + } catch { + const out = new Uint8Array(bytes.length); + for (let i = 0; i < bytes.length; i++) { + out[i] = bytes[i] & 0xff; + } + return out; + } + } catch (error) { + console.warn(`readBinaryFile failed for ${path}: ${error}`); + return null; + } +} + +/** Write bytes to a file, creating parent directories; false on failure. */ +export function writeBinaryFile(path: string, bytes: Uint8Array): boolean { + try { + const file = new java.io.File(path); + const parent = file.getParentFile(); + if (parent) parent.mkdirs(); + const stream = new java.io.FileOutputStream(file); + try { + // An ArrayBuffer marshals to java.nio.ByteBuffer (the same conversion + // submitSurfaceFrame relies on), so write through the channel. + const buffer = bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength); + stream.getChannel().write(buffer); + } finally { + stream.close(); + } + return true; + } catch (error) { + console.warn(`writeBinaryFile failed for ${path}: ${error}`); + return false; + } +} + +/** Recursively delete a file or directory tree (best effort). */ +export function deletePathRecursively(path: string): void { + try { + const root = new java.io.File(path); + if (!root.exists()) return; + if (root.isDirectory()) { + const children = root.listFiles(); + if (children) { + for (let i = 0; i < children.length; i++) { + deletePathRecursively(String(children[i].getAbsolutePath())); + } + } + } + root.delete(); + } catch (error) { + console.warn(`deletePathRecursively failed for ${path}: ${error}`); + } +} + +/** The app-private files directory (no permissions needed). */ +export function appFilesDirPath(): string { + const context = Utils.android.getApplicationContext(); + return String(context.getFilesDir().getAbsolutePath()); +} + /** Read a UTF-8 text file (size-capped); null when unreadable or too large. */ export function readTextFile(path: string): string | null { try { diff --git a/app/phone-ui/evenhub-page.ts b/app/phone-ui/evenhub-page.ts new file mode 100644 index 00000000..9182efd4 --- /dev/null +++ b/app/phone-ui/evenhub-page.ts @@ -0,0 +1,115 @@ +/** + * Phone-side host page for a running EvenHub app: a fullscreen native + * WebView showing the app's web UI. The WebView is also the app's runtime — + * navigating back closes the app (webview, glasses window, session). + * + * The WebView is a raw android.webkit.WebView (via Placeholder) rather than + * the NativeScript WebView component, so we fully own the WebViewClient + * (offline asset serving + bridge-shim injection) without fighting the + * component's own client. + */ +import { Application, CreateViewEventData, Frame, NavigatedData, Page, Utils } from "@nativescript/core"; +import { getActiveEvenHubSession } from "../apps/evenhub"; +import { EVENHUB_BRIDGE_INJECT_SCRIPT, EvenHubSession } from "../apps/evenhub/session"; + +declare const android: any; +declare const com: any; + +let currentPage: Page | null = null; +let currentWebView: any = null; +let currentSession: EvenHubSession | null = null; + +export function navigatingTo(args: NavigatedData): void { + const page = args.object as Page; + const session = getActiveEvenHubSession(); + page.bindingContext = { title: session?.manifest.name ?? "EvenHub" }; + currentPage = page; +} + +export function creatingWebView(args: CreateViewEventData): void { + const session = getActiveEvenHubSession(); + if (!session || session.isClosed()) { + setTimeout(() => Frame.topmost()?.goBack(), 0); + return; + } + currentSession = session; + + const context = Application.android?.foregroundActivity ?? Utils.android.getApplicationContext(); + const webView = new android.webkit.WebView(context); + const settings = webView.getSettings(); + settings.setJavaScriptEnabled(true); + settings.setDomStorageEnabled(true); + settings.setAllowFileAccess(false); + settings.setMediaPlaybackRequiresUserGesture(false); + + const listener = new com.faceclaw.app.FaceclawEvenHubListener({ + onEvenAppMessage: (handlerName: string, argsJson: string, callId: number) => { + session.handleBridgeCall(String(handlerName), String(argsJson), Number(callId)); + }, + onPageFinished: () => { + session.pageFinished(); + }, + }); + + const host = evenHubOriginHost(session); + webView.setWebViewClient( + new com.faceclaw.app.FaceclawEvenHubWebViewClient(session.distDir, host, EVENHUB_BRIDGE_INJECT_SCRIPT, listener), + ); + webView.addJavascriptInterface(new com.faceclaw.app.FaceclawEvenHubJsBridge(listener), "__faceclawEvenHub"); + + // Surface the app's console in logcat (tag FaceclawEvenHubConsole). + const ChromeClient = (android.webkit.WebChromeClient as any).extend({ + onConsoleMessage: (message: any): boolean => { + android.util.Log.i( + "FaceclawEvenHubConsole", + `${message.message()} (${message.sourceId()}:${message.lineNumber()})`, + ); + return true; + }, + }); + webView.setWebChromeClient(new ChromeClient()); + + const page = currentPage; + session.attachPage({ + evaluateJs: (js: string) => { + try { + webView.evaluateJavascript(js, null); + } catch (error) { + console.warn(`evenhub evaluateJs failed: ${error}`); + } + }, + closePage: () => { + const frame = Frame.topmost(); + if (frame && page && frame.currentPage === page) { + frame.goBack(); + } + }, + }); + + currentWebView = webView; + webView.loadUrl(`https://${host}/${session.manifest.entrypoint}`); + args.view = webView; +} + +export function navigatedFrom(args: NavigatedData): void { + if (!args.isBackNavigation) return; + const session = currentSession; + const webView = currentWebView; + currentSession = null; + currentWebView = null; + currentPage = null; + session?.pageGone(); + if (webView) { + try { + webView.destroy(); + } catch (error) { + console.warn(`evenhub webview destroy failed: ${error}`); + } + } +} + +/** A distinct (fake, intercepted) https origin per app isolates web storage. */ +function evenHubOriginHost(session: EvenHubSession): string { + const safe = session.manifest.packageId.toLowerCase().replace(/[^a-z0-9.-]/g, "-"); + return `${safe}.evenhub.invalid`; +} diff --git a/app/phone-ui/evenhub-page.xml b/app/phone-ui/evenhub-page.xml new file mode 100644 index 00000000..fa9a16fb --- /dev/null +++ b/app/phone-ui/evenhub-page.xml @@ -0,0 +1,7 @@ + + + + diff --git a/package-lock.json b/package-lock.json index f99a0212..5c4bd8ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "@nativescript/core": "~9.0.0", "@nativescript/theme": "^3.1.0", "@xterm/headless": "^6.0.0", + "fzstd": "^0.1.1", "lodash": "^4.18.1", "lz4js": "^0.2.0", "pako": "^2.1.0", @@ -2506,6 +2507,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/fzstd": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/fzstd/-/fzstd-0.1.1.tgz", + "integrity": "sha512-dkuVSOKKwh3eas5VkJy1AW1vFpet8TA/fGmVA5krThl8YcOVE/8ZIoEA1+U1vEn5ckxxhLirSdY837azmbaNHA==", + "license": "MIT" + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", diff --git a/package.json b/package.json index eef1abe8..67528064 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "@nativescript/core": "~9.0.0", "@nativescript/theme": "^3.1.0", "@xterm/headless": "^6.0.0", + "fzstd": "^0.1.1", "lodash": "^4.18.1", "lz4js": "^0.2.0", "pako": "^2.1.0",