mirror of
https://github.com/morluto/rea.git
synced 2026-11-21 14:05:49 +00:00
Inventory Android boot and vendor_boot images through shared artifact workflows. Preserve parser failure kinds and bounded stored-component extraction. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning) Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
12 lines
582 B
TypeScript
12 lines
582 B
TypeScript
/** Android boot image magic values; the header parser lives with its reader. */
|
|
export const ANDROID_BOOT_MAGIC = "ANDROID!";
|
|
export const VENDOR_BOOT_MAGIC = "VNDRBOOT";
|
|
const ANDROID_BOOT_MAGIC_BYTES = Buffer.from(ANDROID_BOOT_MAGIC);
|
|
const VENDOR_BOOT_MAGIC_BYTES = Buffer.from(VENDOR_BOOT_MAGIC);
|
|
|
|
/** True when the first eight bytes are ANDROID! or VNDRBOOT. */
|
|
export const hasAndroidBootImageMagic = (prefix: Buffer): boolean =>
|
|
prefix.length >= 8 &&
|
|
(prefix.subarray(0, 8).equals(ANDROID_BOOT_MAGIC_BYTES) ||
|
|
prefix.subarray(0, 8).equals(VENDOR_BOOT_MAGIC_BYTES));
|