"""The build must fail before using corrupt, wrong-platform or partial SDK bytes.""" import hashlib import importlib.util import json import struct from pathlib import Path import pytest ROOT = Path(__file__).resolve().parents[1] SPEC = importlib.util.spec_from_file_location( "x4_sdk_source", ROOT / "plugins/insta360-x4/packaging/fetch_sdk.py" ) sdk = importlib.util.module_from_spec(SPEC) SPEC.loader.exec_module(sdk) def elf(machine=62): strings = b"\0libc.so.6\0" table_end = 64 + 3 * 64 data = bytearray(table_end) data[:7] = b"\x7fELF\x02\x01\x01" struct.pack_into("