diff --git a/lib/app-image/constants.ts b/lib/app-image/constants.ts index f85cabe..95126a1 100644 --- a/lib/app-image/constants.ts +++ b/lib/app-image/constants.ts @@ -16,12 +16,6 @@ export const APP_DESC_MAGIC = 0xABCD5432; /** Size of esp_app_desc_t structure */ export const APP_DESC_SIZE = 256; -/** Offset of custom app desc within first segment data (immediately after esp_app_desc_t) */ -export const CUSTOM_DESC_OFFSET_IN_SEGMENT = APP_DESC_SIZE; // 256 - -/** How many raw bytes to extract for the custom app desc dump */ -export const CUSTOM_DESC_DUMP_SIZE = 64; - /** Chip ID to human-readable name */ export const CHIP_ID_NAMES: Record = { 0x0000: 'ESP32', diff --git a/lib/app-image/parser.ts b/lib/app-image/parser.ts index 8604822..a401740 100644 --- a/lib/app-image/parser.ts +++ b/lib/app-image/parser.ts @@ -5,7 +5,6 @@ import type { import { IMAGE_MAGIC, IMAGE_HEADER_SIZE, EXTENDED_HEADER_SIZE, SEGMENT_HEADER_SIZE, APP_DESC_MAGIC, APP_DESC_SIZE, CHIP_ID_NAMES, - CUSTOM_DESC_OFFSET_IN_SEGMENT, CUSTOM_DESC_DUMP_SIZE, } from './constants'; /** @@ -94,21 +93,11 @@ export function parseAppImage(data: Uint8Array): AppImageInfo { } } - // ── Custom App Description — fixed offset in first segment ── - let customDescRawBytes: Uint8Array | null = null; - if (segDataOffsets.length > 0) { - const customOff = segDataOffsets[0] + CUSTOM_DESC_OFFSET_IN_SEGMENT; - if (customOff + CUSTOM_DESC_DUMP_SIZE <= data.length) { - customDescRawBytes = new Uint8Array(data.subarray(customOff, customOff + CUSTOM_DESC_DUMP_SIZE)); - } - } - return { header, extendedHeader, segments, appDescription, - customDescRawBytes, valid: segments.length === segmentCount, // false if image was truncated mid-segment chipName: CHIP_ID_NAMES[chipId] ?? `Unknown (0x${chipId.toString(16)})`, }; diff --git a/lib/app-image/types.ts b/lib/app-image/types.ts index 4367269..274cc9d 100644 --- a/lib/app-image/types.ts +++ b/lib/app-image/types.ts @@ -63,8 +63,6 @@ export interface AppImageInfo { extendedHeader: ExtendedHeader; segments: SegmentHeader[]; appDescription: AppDescription | null; - /** Raw bytes at the custom app desc location (null if first segment too short) */ - customDescRawBytes: Uint8Array | null; valid: boolean; chipName: string; }