@onekeyfe/hd-core 1.2.0-alpha.141 → 1.2.0-alpha.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/device-lifecycle-events.test.ts +23 -1
- package/__tests__/protocol-v2-resources.test.ts +35 -89
- package/__tests__/protocol-v2.test.ts +56 -196
- package/dist/api/FirmwareUpdateV4.d.ts +0 -1
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/index.d.ts +1 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +121 -282
- package/dist/protocols/protocol-v2/resources.d.ts +11 -7
- package/dist/protocols/protocol-v2/resources.d.ts.map +1 -1
- package/dist/types/settings.d.ts +0 -13
- package/dist/types/settings.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/FirmwareUpdateV4.ts +66 -275
- package/src/core/index.ts +5 -2
- package/src/index.ts +0 -4
- package/src/protocols/protocol-v2/resources.ts +92 -102
- package/src/types/settings.ts +0 -15
package/dist/index.js
CHANGED
|
@@ -40675,18 +40675,16 @@ const findLatestRelease = (releases) => {
|
|
|
40675
40675
|
return leastRelease;
|
|
40676
40676
|
};
|
|
40677
40677
|
|
|
40678
|
-
const PROTOCOL_V2_BOOT_RESOURCE_PACKAGE_PATH
|
|
40679
|
-
const
|
|
40680
|
-
|
|
40681
|
-
|
|
40682
|
-
|
|
40683
|
-
|
|
40684
|
-
|
|
40685
|
-
|
|
40686
|
-
|
|
40687
|
-
|
|
40688
|
-
return normalized;
|
|
40689
|
-
}
|
|
40678
|
+
const PROTOCOL_V2_BOOT_RESOURCE_PACKAGE_PATH = 'vol0:/loaders/bootloader/boot_resource.okpkg';
|
|
40679
|
+
const PROTOCOL_V2_BOOT_RESOURCE_PACKAGE_STAGING_PATH = `${PROTOCOL_V2_BOOT_RESOURCE_PACKAGE_PATH}.staging`;
|
|
40680
|
+
const PROTOCOL_V2_RESOURCE_PACKAGE_HEADER_SIZE = 0x5f90;
|
|
40681
|
+
const PROTOCOL_V2_RESOURCE_PACKAGE_HEADER_VERSION = 1;
|
|
40682
|
+
const PROTOCOL_V2_RESOURCE_PACKAGE_FLEXIBLE_OFFSET = 0x6c;
|
|
40683
|
+
const PROTOCOL_V2_RESOURCE_PACKAGE_FLEXIBLE_SIZE = 64;
|
|
40684
|
+
const PROTOCOL_V2_RESOURCE_PACKAGE_PAYLOAD_HASH_OFFSET = 0x200;
|
|
40685
|
+
const PROTOCOL_V2_RESOURCE_PACKAGE_HEADER_HASH_OFFSET = 0x240;
|
|
40686
|
+
const PROTOCOL_V2_RESOURCE_PACKAGE_HASH_SIZE = 64;
|
|
40687
|
+
const PROTOCOL_V2_RESOURCE_PACKAGE_TYPE = 'RESC';
|
|
40690
40688
|
function parseProtocolV2Resources(value) {
|
|
40691
40689
|
if (value === undefined)
|
|
40692
40690
|
return undefined;
|
|
@@ -40715,86 +40713,75 @@ function parseProtocolV2Resources(value) {
|
|
|
40715
40713
|
},
|
|
40716
40714
|
};
|
|
40717
40715
|
}
|
|
40718
|
-
const
|
|
40719
|
-
|
|
40720
|
-
'
|
|
40721
|
-
];
|
|
40722
|
-
function isAllowedManifestDevicePath(path) {
|
|
40723
|
-
if (!path.endsWith('.okpkg') ||
|
|
40724
|
-
path.includes('\\') ||
|
|
40716
|
+
const PROTOCOL_V2_RESOURCE_DEVICE_ROOTS = ['vol0:/bundles/', 'vol0:/loaders/rom/'];
|
|
40717
|
+
function isAllowedResourceDevicePath(path) {
|
|
40718
|
+
if (path.includes('\\') ||
|
|
40725
40719
|
path.includes('//') ||
|
|
40720
|
+
[...path].some(char => {
|
|
40721
|
+
const code = char.charCodeAt(0);
|
|
40722
|
+
return code <= 0x1f || code === 0x7f;
|
|
40723
|
+
}) ||
|
|
40726
40724
|
path.split('/').some(part => part === '.' || part === '..')) {
|
|
40727
40725
|
return false;
|
|
40728
40726
|
}
|
|
40729
|
-
if (path ===
|
|
40727
|
+
if (path === PROTOCOL_V2_BOOT_RESOURCE_PACKAGE_STAGING_PATH) {
|
|
40730
40728
|
return true;
|
|
40731
40729
|
}
|
|
40732
|
-
return
|
|
40730
|
+
return (path.endsWith('.okpkg') && PROTOCOL_V2_RESOURCE_DEVICE_ROOTS.some(root => path.startsWith(root)));
|
|
40733
40731
|
}
|
|
40734
|
-
function
|
|
40735
|
-
|
|
40736
|
-
|
|
40737
|
-
|
|
40738
|
-
return value;
|
|
40732
|
+
function readAscii(bytes, offset, length) {
|
|
40733
|
+
return Array.from(bytes.slice(offset, offset + length))
|
|
40734
|
+
.map(byte => String.fromCharCode(byte))
|
|
40735
|
+
.join('');
|
|
40739
40736
|
}
|
|
40740
|
-
function
|
|
40741
|
-
const
|
|
40742
|
-
|
|
40743
|
-
|
|
40744
|
-
|
|
40745
|
-
|
|
40746
|
-
|
|
40737
|
+
function readResourceDevicePath(bytes) {
|
|
40738
|
+
const metadata = bytes.slice(PROTOCOL_V2_RESOURCE_PACKAGE_FLEXIBLE_OFFSET, PROTOCOL_V2_RESOURCE_PACKAGE_FLEXIBLE_OFFSET + PROTOCOL_V2_RESOURCE_PACKAGE_FLEXIBLE_SIZE);
|
|
40739
|
+
const terminator = metadata.indexOf(0);
|
|
40740
|
+
const pathBytes = terminator === -1 ? metadata : metadata.slice(0, terminator);
|
|
40741
|
+
const padding = terminator === -1 ? new Uint8Array(0) : metadata.slice(terminator);
|
|
40742
|
+
if (pathBytes.byteLength === 0 ||
|
|
40743
|
+
Array.from(pathBytes).some(byte => byte < 0x20 || byte > 0x7e) ||
|
|
40744
|
+
Array.from(padding).some(byte => byte !== 0)) {
|
|
40745
|
+
throw new Error('Invalid Pro2 RESOURCE package device path metadata');
|
|
40746
|
+
}
|
|
40747
|
+
const path = readAscii(pathBytes, 0, pathBytes.byteLength);
|
|
40748
|
+
if (!isAllowedResourceDevicePath(path)) {
|
|
40749
|
+
throw new Error(`Invalid Pro2 RESOURCE package device path: ${path}`);
|
|
40747
40750
|
}
|
|
40748
40751
|
return path;
|
|
40749
40752
|
}
|
|
40750
|
-
function
|
|
40751
|
-
|
|
40752
|
-
|
|
40753
|
-
throw new Error(`Invalid Pro2 resource manifest files[${index}]`);
|
|
40754
|
-
}
|
|
40755
|
-
const file = value;
|
|
40756
|
-
const archivePath = assertManifestRelativePath(file.archive_path, `files[${index}].archive_path`);
|
|
40757
|
-
const originalName = file.original_name === undefined
|
|
40758
|
-
? (_a = archivePath.split('/').pop()) !== null && _a !== void 0 ? _a : archivePath
|
|
40759
|
-
: assertManifestRelativePath(file.original_name, `files[${index}].original_name`);
|
|
40760
|
-
if (originalName.includes('/')) {
|
|
40761
|
-
throw new Error(`Invalid Pro2 resource manifest files[${index}].original_name`);
|
|
40762
|
-
}
|
|
40763
|
-
const devicePath = assertManifestString(file.device_path, `files[${index}].device_path`);
|
|
40764
|
-
if (!isAllowedManifestDevicePath(devicePath)) {
|
|
40765
|
-
throw new Error(`Invalid Pro2 resource manifest files[${index}].device_path`);
|
|
40766
|
-
}
|
|
40767
|
-
if (!Number.isSafeInteger(file.size) || Number(file.size) <= 0) {
|
|
40768
|
-
throw new Error(`Invalid Pro2 resource manifest files[${index}].size`);
|
|
40769
|
-
}
|
|
40770
|
-
const digest = normalizeHex$1(file.sha256, SHA256_HEX_LENGTH, `files[${index}].sha256`);
|
|
40771
|
-
if (!archivePath.endsWith('.okpkg') || !originalName.endsWith('.okpkg')) {
|
|
40772
|
-
throw new Error(`Invalid Pro2 resource manifest files[${index}] package extension`);
|
|
40773
|
-
}
|
|
40774
|
-
return Object.assign(Object.assign(Object.assign({ archive_path: archivePath, original_name: originalName, device_path: devicePath, size: Number(file.size), sha256: digest }, (file.signed === undefined ? {} : { signed: file.signed })), (file.sig_algo === undefined ? {} : { sig_algo: file.sig_algo })), (file.payload_version === undefined ? {} : { payload_version: file.payload_version }));
|
|
40775
|
-
}
|
|
40776
|
-
function parseProtocolV2ResourceManifest(value) {
|
|
40777
|
-
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
40778
|
-
throw new Error('Invalid Pro2 resource manifest');
|
|
40779
|
-
}
|
|
40780
|
-
const manifest = value;
|
|
40781
|
-
if (!Array.isArray(manifest.files)) {
|
|
40782
|
-
throw new Error('Invalid Pro2 resource manifest files');
|
|
40753
|
+
function parseProtocolV2ResourcePackageHeader(bytes, packageSize) {
|
|
40754
|
+
if (bytes.byteLength < PROTOCOL_V2_RESOURCE_PACKAGE_HEADER_SIZE) {
|
|
40755
|
+
throw new Error('Pro2 RESOURCE package is shorter than its header');
|
|
40783
40756
|
}
|
|
40784
|
-
const
|
|
40785
|
-
const
|
|
40786
|
-
const
|
|
40787
|
-
|
|
40788
|
-
|
|
40789
|
-
|
|
40790
|
-
|
|
40757
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
40758
|
+
const headerVersion = view.getUint32(0x04, true);
|
|
40759
|
+
const headerLength = view.getUint32(0x0c, true);
|
|
40760
|
+
const payloadLength = view.getUint32(0x14, true);
|
|
40761
|
+
if (readAscii(bytes, 0, 4) !== 'OKPP' ||
|
|
40762
|
+
readAscii(bytes, 0x08, 4) !== PROTOCOL_V2_RESOURCE_PACKAGE_TYPE ||
|
|
40763
|
+
headerVersion !== PROTOCOL_V2_RESOURCE_PACKAGE_HEADER_VERSION ||
|
|
40764
|
+
headerLength !== PROTOCOL_V2_RESOURCE_PACKAGE_HEADER_SIZE ||
|
|
40765
|
+
payloadLength <= 0 ||
|
|
40766
|
+
headerLength + payloadLength !== packageSize) {
|
|
40767
|
+
throw new Error('Invalid Pro2 RESOURCE package header');
|
|
40791
40768
|
}
|
|
40769
|
+
const packedVersion = view.getUint32(0x10, true);
|
|
40792
40770
|
return {
|
|
40793
|
-
|
|
40771
|
+
version: [
|
|
40772
|
+
Math.floor(packedVersion / 0x10000) % 0x100,
|
|
40773
|
+
Math.floor(packedVersion / 0x100) % 0x100,
|
|
40774
|
+
packedVersion % 0x100,
|
|
40775
|
+
],
|
|
40776
|
+
payloadLength,
|
|
40777
|
+
devicePath: readResourceDevicePath(bytes),
|
|
40778
|
+
payloadHash: utils.bytesToHex(bytes.slice(PROTOCOL_V2_RESOURCE_PACKAGE_PAYLOAD_HASH_OFFSET, PROTOCOL_V2_RESOURCE_PACKAGE_PAYLOAD_HASH_OFFSET + PROTOCOL_V2_RESOURCE_PACKAGE_HASH_SIZE)),
|
|
40779
|
+
headerHash: utils.bytesToHex(bytes.slice(PROTOCOL_V2_RESOURCE_PACKAGE_HEADER_HASH_OFFSET, PROTOCOL_V2_RESOURCE_PACKAGE_HEADER_HASH_OFFSET + PROTOCOL_V2_RESOURCE_PACKAGE_HASH_SIZE)),
|
|
40794
40780
|
};
|
|
40795
40781
|
}
|
|
40796
|
-
function
|
|
40797
|
-
|
|
40782
|
+
function parseProtocolV2ResourcePackage(binary) {
|
|
40783
|
+
const bytes = binary instanceof Uint8Array ? binary : new Uint8Array(binary);
|
|
40784
|
+
return parseProtocolV2ResourcePackageHeader(bytes, bytes.byteLength);
|
|
40798
40785
|
}
|
|
40799
40786
|
|
|
40800
40787
|
var _a$1;
|
|
@@ -51771,17 +51758,8 @@ const PROTOCOL_V2_TRANSFER_PROGRESS_HEARTBEAT_MS = 1000;
|
|
|
51771
51758
|
const PROTOCOL_V2_INSTALL_STATUS_CONFLICT_CODE = 'FirmwareInstallStatusConflict';
|
|
51772
51759
|
const PROTOCOL_V2_INSTALL_FAILED_CODE = 'FirmwareInstallFailed';
|
|
51773
51760
|
const PROTOCOL_V2_INSTALL_TIMEOUT_CODE = 'FirmwareInstallTimeout';
|
|
51774
|
-
const PROTOCOL_V2_OKPP_HEADER_SIZE = 0x52a0;
|
|
51775
|
-
const PROTOCOL_V2_OKPP_PAYLOAD_HASH_OFFSET = 0x200;
|
|
51776
|
-
const PROTOCOL_V2_OKPP_HEADER_HASH_OFFSET = 0x240;
|
|
51777
|
-
const PROTOCOL_V2_OKPP_HASH_SIZE = 64;
|
|
51778
|
-
const PROTOCOL_V2_RESOURCE_MANIFEST_MAX_BYTES = 1024 * 1024;
|
|
51779
51761
|
const PROTOCOL_V2_RESOURCE_FILE_MAX_COUNT = 512;
|
|
51780
51762
|
const PROTOCOL_V2_RESOURCE_TOTAL_MAX_BYTES = 256 * 1024 * 1024;
|
|
51781
|
-
const getProtocolV2LocalResourceArchivePath = (entryName) => {
|
|
51782
|
-
const match = entryName.match(/(?:^|\/)((?:bundles\/|loaders\/(?:bootloader|rom)\/).+\.okpkg)$/iu);
|
|
51783
|
-
return match === null || match === void 0 ? void 0 : match[1];
|
|
51784
|
-
};
|
|
51785
51763
|
const PROTOCOL_V2_NEO_UNSUPPORTED_TARGETS = new Set(['se03', 'se04']);
|
|
51786
51764
|
const getProtocolV2ZipEntrySizes = (entry) => {
|
|
51787
51765
|
var _a;
|
|
@@ -51875,14 +51853,8 @@ const PROTOCOL_V2_REMOTE_COMPONENT_TARGETS = {
|
|
|
51875
51853
|
},
|
|
51876
51854
|
};
|
|
51877
51855
|
const PROTOCOL_V2_FIRMWARE_STAGING_PATHS = new Set(Object.values(PROTOCOL_V2_REMOTE_COMPONENT_TARGETS).map(target => `${PROTOCOL_V2_FIRMWARE_STAGING_VOLUME}${target.fileName}`));
|
|
51878
|
-
const PROTOCOL_V2_BOOT_RESOURCE_PACKAGE_PATH = 'vol0:/loaders/bootloader/boot_resource.okpkg';
|
|
51879
|
-
const PROTOCOL_V2_BOOT_RESOURCE_PACKAGE_STAGING_PATH = `${PROTOCOL_V2_BOOT_RESOURCE_PACKAGE_PATH}.staging`;
|
|
51880
51856
|
const isProtocolV2BootResourcePackagePath = (devicePath) => typeof devicePath === 'string' &&
|
|
51881
|
-
devicePath.
|
|
51882
|
-
PROTOCOL_V2_BOOT_RESOURCE_PACKAGE_PATH;
|
|
51883
|
-
const resolveProtocolV2ResourceWritePath = (devicePath) => isProtocolV2BootResourcePackagePath(devicePath)
|
|
51884
|
-
? PROTOCOL_V2_BOOT_RESOURCE_PACKAGE_STAGING_PATH
|
|
51885
|
-
: devicePath;
|
|
51857
|
+
devicePath.toLowerCase() === PROTOCOL_V2_BOOT_RESOURCE_PACKAGE_STAGING_PATH;
|
|
51886
51858
|
const PROTOCOL_V2_UPDATE_TARGET_BY_TARGET_ID = new Map([
|
|
51887
51859
|
[ProtocolV2FirmwareTargetType.FW_MGMT_TARGET_BOOTLOADER, 'boot'],
|
|
51888
51860
|
[ProtocolV2FirmwareTargetType.FW_MGMT_TARGET_APPLICATION_P1, 'app_v1'],
|
|
@@ -52008,30 +51980,6 @@ const toProtocolV2FiniteNumber = (value) => {
|
|
|
52008
51980
|
}
|
|
52009
51981
|
return undefined;
|
|
52010
51982
|
};
|
|
52011
|
-
const readProtocolV2Ascii = (bytes, offset, length) => Array.from(bytes.slice(offset, offset + length))
|
|
52012
|
-
.map(byte => String.fromCharCode(byte))
|
|
52013
|
-
.join('');
|
|
52014
|
-
const parseProtocolV2OkppHeader = (bytes) => {
|
|
52015
|
-
if (bytes.byteLength < PROTOCOL_V2_OKPP_HEADER_SIZE)
|
|
52016
|
-
return null;
|
|
52017
|
-
if (readProtocolV2Ascii(bytes, 0, 4) !== 'OKPP')
|
|
52018
|
-
return null;
|
|
52019
|
-
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
52020
|
-
const headerLen = view.getUint32(0x0c, true);
|
|
52021
|
-
if (headerLen !== PROTOCOL_V2_OKPP_HEADER_SIZE)
|
|
52022
|
-
return null;
|
|
52023
|
-
const packedVersion = view.getUint32(0x10, true);
|
|
52024
|
-
return {
|
|
52025
|
-
type: readProtocolV2Ascii(bytes, 0x08, 4),
|
|
52026
|
-
version: [
|
|
52027
|
-
Math.floor(packedVersion / 0x10000) % 0x100,
|
|
52028
|
-
Math.floor(packedVersion / 0x100) % 0x100,
|
|
52029
|
-
packedVersion % 0x100,
|
|
52030
|
-
],
|
|
52031
|
-
payloadHash: bytesToHex(bytes.slice(PROTOCOL_V2_OKPP_PAYLOAD_HASH_OFFSET, PROTOCOL_V2_OKPP_PAYLOAD_HASH_OFFSET + PROTOCOL_V2_OKPP_HASH_SIZE)),
|
|
52032
|
-
headerHash: bytesToHex(bytes.slice(PROTOCOL_V2_OKPP_HEADER_HASH_OFFSET, PROTOCOL_V2_OKPP_HEADER_HASH_OFFSET + PROTOCOL_V2_OKPP_HASH_SIZE)),
|
|
52033
|
-
};
|
|
52034
|
-
};
|
|
52035
51983
|
const isProtocolV2FirmwareFingerprintValid = (binary, fingerprint) => {
|
|
52036
51984
|
const expectedFingerprint = normalizeProtocolV2Hex(fingerprint);
|
|
52037
51985
|
if (!expectedFingerprint)
|
|
@@ -52539,7 +52487,6 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52539
52487
|
});
|
|
52540
52488
|
}
|
|
52541
52489
|
prepareProtocolV2LocalResourceArchive(binary) {
|
|
52542
|
-
var _a;
|
|
52543
52490
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52544
52491
|
if (binary.byteLength <= 0 || binary.byteLength > PROTOCOL_V2_RESOURCE_TOTAL_MAX_BYTES) {
|
|
52545
52492
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 local resource ZIP archive size is invalid', { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
@@ -52548,91 +52495,47 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52548
52495
|
try {
|
|
52549
52496
|
zip = yield JSZip__default["default"].loadAsync(binary);
|
|
52550
52497
|
}
|
|
52551
|
-
catch (
|
|
52498
|
+
catch (_a) {
|
|
52552
52499
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 resource ZIP cannot be parsed', { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52553
52500
|
}
|
|
52554
52501
|
const zipEntries = Object.values(zip.files);
|
|
52555
|
-
|
|
52556
|
-
|
|
52557
|
-
|
|
52558
|
-
|
|
52559
|
-
if (entries.length === 0) {
|
|
52560
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 local resource ZIP entry set is invalid', { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52561
|
-
}
|
|
52562
|
-
const manifestEntry = entries.find(entry => entry.name.split('/').pop() === 'manifest.json');
|
|
52563
|
-
let manifestBinary;
|
|
52564
|
-
let manifestDirectory = '';
|
|
52565
|
-
let selectedFiles;
|
|
52566
|
-
if (manifestEntry) {
|
|
52567
|
-
if (getProtocolV2ZipEntrySizes(manifestEntry).uncompressedSize >
|
|
52568
|
-
PROTOCOL_V2_RESOURCE_MANIFEST_MAX_BYTES) {
|
|
52569
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 local resource manifest size is invalid', { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52570
|
-
}
|
|
52571
|
-
manifestBinary = yield manifestEntry.async('arraybuffer');
|
|
52572
|
-
if (manifestBinary.byteLength <= 0 ||
|
|
52573
|
-
manifestBinary.byteLength > PROTOCOL_V2_RESOURCE_MANIFEST_MAX_BYTES) {
|
|
52574
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 local resource manifest size is invalid', { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52575
|
-
}
|
|
52576
|
-
let manifestValue;
|
|
52577
|
-
try {
|
|
52578
|
-
manifestValue = JSON.parse(new TextDecoder().decode(manifestBinary));
|
|
52579
|
-
}
|
|
52580
|
-
catch (error) {
|
|
52581
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `Protocol V2 local resource manifest is invalid: ${String(error)}`, { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52582
|
-
}
|
|
52583
|
-
selectedFiles = selectProtocolV2ResourceManifestFiles({
|
|
52584
|
-
manifest: parseProtocolV2ResourceManifest(manifestValue),
|
|
52585
|
-
targetsToUpdate: (_a = this.params.targetsToUpdate) !== null && _a !== void 0 ? _a : [],
|
|
52586
|
-
});
|
|
52587
|
-
manifestDirectory = manifestEntry.name.slice(0, -'manifest.json'.length);
|
|
52588
|
-
}
|
|
52589
|
-
else {
|
|
52590
|
-
selectedFiles = entries.flatMap(entry => {
|
|
52591
|
-
var _a;
|
|
52592
|
-
const archivePath = getProtocolV2LocalResourceArchivePath(entry.name);
|
|
52593
|
-
if (!archivePath)
|
|
52594
|
-
return [];
|
|
52595
|
-
return [
|
|
52596
|
-
{
|
|
52597
|
-
archive_path: archivePath,
|
|
52598
|
-
original_name: (_a = archivePath.split('/').pop()) !== null && _a !== void 0 ? _a : archivePath,
|
|
52599
|
-
device_path: `vol0:/${archivePath}`,
|
|
52600
|
-
size: getProtocolV2ZipEntrySizes(entry).uncompressedSize,
|
|
52601
|
-
sha256: '',
|
|
52602
|
-
},
|
|
52603
|
-
];
|
|
52604
|
-
});
|
|
52605
|
-
}
|
|
52606
|
-
if (selectedFiles.length === 0 || selectedFiles.length > PROTOCOL_V2_RESOURCE_FILE_MAX_COUNT) {
|
|
52607
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 local resource ZIP has no resource packages', { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52502
|
+
const resourceEntries = zipEntries.filter(entry => !entry.dir && entry.name.toLowerCase().endsWith('.okpkg'));
|
|
52503
|
+
if (resourceEntries.length === 0 ||
|
|
52504
|
+
resourceEntries.length > PROTOCOL_V2_RESOURCE_FILE_MAX_COUNT) {
|
|
52505
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 resource ZIP has no valid resource package set', { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52608
52506
|
}
|
|
52609
52507
|
let totalSize = 0;
|
|
52610
52508
|
const materializedEntries = [];
|
|
52611
|
-
const
|
|
52612
|
-
|
|
52613
|
-
|
|
52614
|
-
|
|
52615
|
-
: entries.find(candidate => getProtocolV2LocalResourceArchivePath(candidate.name) === file.archive_path);
|
|
52616
|
-
if (!entry) {
|
|
52617
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `Protocol V2 local resource ZIP is missing ${file.archive_path}`, { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52618
|
-
}
|
|
52619
|
-
const { uncompressedSize } = getProtocolV2ZipEntrySizes(entry);
|
|
52509
|
+
const resources = [];
|
|
52510
|
+
const devicePaths = new Set();
|
|
52511
|
+
for (const entry of resourceEntries) {
|
|
52512
|
+
const { compressedSize, uncompressedSize } = getProtocolV2ZipEntrySizes(entry);
|
|
52620
52513
|
totalSize += uncompressedSize;
|
|
52621
|
-
if (
|
|
52622
|
-
|
|
52514
|
+
if (compressedSize > binary.byteLength ||
|
|
52515
|
+
uncompressedSize > PROTOCOL_V2_RESOURCE_TOTAL_MAX_BYTES ||
|
|
52516
|
+
totalSize > PROTOCOL_V2_RESOURCE_TOTAL_MAX_BYTES) {
|
|
52517
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `Protocol V2 resource package size is invalid: ${entry.name}`, { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52623
52518
|
}
|
|
52624
52519
|
const fileBinary = yield entry.async('arraybuffer');
|
|
52625
|
-
|
|
52626
|
-
|
|
52627
|
-
|
|
52628
|
-
|
|
52520
|
+
if (fileBinary.byteLength !== uncompressedSize) {
|
|
52521
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `Protocol V2 resource package is incomplete: ${entry.name}`, { firmwareUpdateCode: 'FirmwareArtifactReceiptMismatch' });
|
|
52522
|
+
}
|
|
52523
|
+
let header;
|
|
52524
|
+
try {
|
|
52525
|
+
header = parseProtocolV2ResourcePackage(fileBinary);
|
|
52526
|
+
}
|
|
52527
|
+
catch (error) {
|
|
52528
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `Protocol V2 resource package is invalid: ${entry.name}: ${String(error)}`, { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52629
52529
|
}
|
|
52630
|
-
|
|
52631
|
-
|
|
52530
|
+
const canonicalDevicePath = header.devicePath.toLowerCase();
|
|
52531
|
+
if (devicePaths.has(canonicalDevicePath)) {
|
|
52532
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `Protocol V2 resource ZIP contains duplicate device path: ${header.devicePath}`, { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52533
|
+
}
|
|
52534
|
+
devicePaths.add(canonicalDevicePath);
|
|
52535
|
+
materializedEntries.push({ entryName: entry.name, binary: fileBinary });
|
|
52536
|
+
resources.push({ entryName: entry.name, binary: fileBinary, header });
|
|
52632
52537
|
}
|
|
52633
|
-
|
|
52634
|
-
materializedEntries.unshift({ entryName: 'manifest.json', binary: manifestBinary });
|
|
52635
|
-
return { binary, materializedEntries };
|
|
52538
|
+
return { binary, materializedEntries, resources };
|
|
52636
52539
|
});
|
|
52637
52540
|
}
|
|
52638
52541
|
prepareProtocolV2ResourceSources() {
|
|
@@ -52678,48 +52581,17 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52678
52581
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 prepared resource archive does not match its approved receipt', { firmwareUpdateCode: 'FirmwareArtifactReceiptMismatch' });
|
|
52679
52582
|
}
|
|
52680
52583
|
const verifiedArchive = yield this.prepareProtocolV2LocalResourceArchive(archiveBinary);
|
|
52681
|
-
const verifiedEntriesByName = new Map(verifiedArchive.materializedEntries.map(entry => [entry.entryName, entry.binary]));
|
|
52682
|
-
const manifestBinary = verifiedEntriesByName.get('manifest.json');
|
|
52683
|
-
if (!manifestBinary) {
|
|
52684
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 prepared resource archive has no valid manifest.json', { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52685
|
-
}
|
|
52686
|
-
let manifestValue;
|
|
52687
|
-
try {
|
|
52688
|
-
manifestValue = JSON.parse(new TextDecoder().decode(manifestBinary));
|
|
52689
|
-
}
|
|
52690
|
-
catch (error) {
|
|
52691
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `Protocol V2 prepared resource manifest is invalid: ${String(error)}`, { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52692
|
-
}
|
|
52693
|
-
const manifest = parseProtocolV2ResourceManifest(manifestValue);
|
|
52694
|
-
const selectedFiles = selectProtocolV2ResourceManifestFiles({
|
|
52695
|
-
manifest,
|
|
52696
|
-
targetsToUpdate: (_c = this.params.targetsToUpdate) !== null && _c !== void 0 ? _c : [],
|
|
52697
|
-
});
|
|
52698
|
-
if (selectedFiles.length > PROTOCOL_V2_RESOURCE_FILE_MAX_COUNT) {
|
|
52699
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 prepared resource archive contains too many files', { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52700
|
-
}
|
|
52701
|
-
let totalSize = 0;
|
|
52702
52584
|
const sources = [];
|
|
52703
|
-
for (const
|
|
52704
|
-
const
|
|
52705
|
-
|
|
52706
|
-
|
|
52707
|
-
|
|
52708
|
-
|
|
52709
|
-
|
|
52710
|
-
|
|
52711
|
-
|
|
52712
|
-
|
|
52713
|
-
const header = source.size >= PROTOCOL_V2_OKPP_HEADER_SIZE
|
|
52714
|
-
? parseProtocolV2OkppHeader(new Uint8Array(yield source.readAt(0, PROTOCOL_V2_OKPP_HEADER_SIZE)))
|
|
52715
|
-
: null;
|
|
52716
|
-
sources.push(Object.assign({ name: file.original_name || `resource-${index}`, source, devicePath: file.device_path }, (header
|
|
52717
|
-
? {
|
|
52718
|
-
version: header.version,
|
|
52719
|
-
payloadHash: header.payloadHash,
|
|
52720
|
-
headerHash: header.headerHash,
|
|
52721
|
-
}
|
|
52722
|
-
: {})));
|
|
52585
|
+
for (const resource of verifiedArchive.resources) {
|
|
52586
|
+
const source = yield this.openProtocolV2MemorySource(resource.binary);
|
|
52587
|
+
sources.push({
|
|
52588
|
+
name: (_c = resource.entryName.split('/').pop()) !== null && _c !== void 0 ? _c : resource.entryName,
|
|
52589
|
+
source,
|
|
52590
|
+
devicePath: resource.header.devicePath,
|
|
52591
|
+
version: resource.header.version,
|
|
52592
|
+
payloadHash: resource.header.payloadHash,
|
|
52593
|
+
headerHash: resource.header.headerHash,
|
|
52594
|
+
});
|
|
52723
52595
|
}
|
|
52724
52596
|
return sources;
|
|
52725
52597
|
});
|
|
@@ -52784,11 +52656,11 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52784
52656
|
return;
|
|
52785
52657
|
const features = this.protocolV2LatestFinalFeatures;
|
|
52786
52658
|
const deviceInfo = this.protocolV2LatestFinalDeviceInfo;
|
|
52787
|
-
const requestedTargets = this.getProtocolV2RequestedTargets();
|
|
52788
|
-
const applicationTargets = requestedTargets.filter(target => target === 'app_v1' || target === 'app_v2');
|
|
52789
52659
|
const visibleVersions = {
|
|
52790
52660
|
boot: features ? getDeviceBootloaderVersion(features).join('.') : undefined,
|
|
52791
|
-
app_v1:
|
|
52661
|
+
app_v1: features
|
|
52662
|
+
? getDeviceFirmwareVersion(features).join('.')
|
|
52663
|
+
: (_c = (_b = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.main_mcu) === null || _b === void 0 ? void 0 : _b.application) === null || _c === void 0 ? void 0 : _c.version,
|
|
52792
52664
|
app_v2: (_e = (_d = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.main_mcu) === null || _d === void 0 ? void 0 : _d.application_data) === null || _e === void 0 ? void 0 : _e.version,
|
|
52793
52665
|
coprocessor: features ? getDeviceBLEFirmwareVersion(features).join('.') : undefined,
|
|
52794
52666
|
se01: (_f = features === null || features === void 0 ? void 0 : features.se01Version) !== null && _f !== void 0 ? _f : undefined,
|
|
@@ -52796,9 +52668,6 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52796
52668
|
se03: (_h = features === null || features === void 0 ? void 0 : features.se03Version) !== null && _h !== void 0 ? _h : undefined,
|
|
52797
52669
|
se04: (_j = features === null || features === void 0 ? void 0 : features.se04Version) !== null && _j !== void 0 ? _j : undefined,
|
|
52798
52670
|
};
|
|
52799
|
-
if (features && applicationTargets.length === 1 && !visibleVersions[applicationTargets[0]]) {
|
|
52800
|
-
visibleVersions[applicationTargets[0]] = getDeviceFirmwareVersion(features).join('.');
|
|
52801
|
-
}
|
|
52802
52671
|
const expectedEntries = Object.entries(expected).filter(([target]) => !targets || targets.includes(target));
|
|
52803
52672
|
for (const [target, expectedVersion] of expectedEntries) {
|
|
52804
52673
|
const targetId = (_k = Array.from(PROTOCOL_V2_UPDATE_TARGET_BY_TARGET_ID.entries()).find(([, mappedTarget]) => mappedTarget === target)) === null || _k === void 0 ? void 0 : _k[0];
|
|
@@ -52807,14 +52676,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52807
52676
|
? visibleVersions[target]
|
|
52808
52677
|
: `${Math.floor(statusVersion / 0x10000) % 0x100}.${Math.floor(statusVersion / 0x100) % 0x100}.${statusVersion % 0x100}`;
|
|
52809
52678
|
if (!observedVersion) {
|
|
52810
|
-
const
|
|
52811
|
-
if (requestedTarget === 'resource' || requestedTarget === 'boot_resources')
|
|
52812
|
-
return [];
|
|
52813
|
-
const installTarget = PROTOCOL_V2_INSTALL_TARGET_BY_UPDATE_TARGET.get(requestedTarget);
|
|
52814
|
-
return installTarget ? [installTarget.targetId] : [];
|
|
52815
|
-
});
|
|
52816
|
-
const hasCompleteTargetEvidence = requestedTargetIds.length > 0 &&
|
|
52817
|
-
requestedTargetIds.every(targetId => this.protocolV2CompletedTargetIds.has(targetId));
|
|
52679
|
+
const hasCompleteTargetEvidence = targetId !== undefined && this.protocolV2CompletedTargetIds.has(targetId);
|
|
52818
52680
|
if (hasCompleteTargetEvidence) {
|
|
52819
52681
|
Log$7.warn(`Protocol V2 target ${target} has no observable final version; install completion is authoritative`);
|
|
52820
52682
|
}
|
|
@@ -52827,34 +52689,6 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52827
52689
|
}
|
|
52828
52690
|
}
|
|
52829
52691
|
}
|
|
52830
|
-
getProtocolV2RequestedTargets() {
|
|
52831
|
-
var _a, _b, _c;
|
|
52832
|
-
if ((_a = this.params.targetsToUpdate) === null || _a === void 0 ? void 0 : _a.length) {
|
|
52833
|
-
return [...new Set(this.params.targetsToUpdate)];
|
|
52834
|
-
}
|
|
52835
|
-
if ((_b = this.params.preparedPlan) === null || _b === void 0 ? void 0 : _b.targetsToUpdate.length) {
|
|
52836
|
-
return [...new Set(this.params.preparedPlan.targetsToUpdate)];
|
|
52837
|
-
}
|
|
52838
|
-
const targets = new Set();
|
|
52839
|
-
Object.keys((_c = this.params.componentArtifacts) !== null && _c !== void 0 ? _c : {}).forEach(target => targets.add(target));
|
|
52840
|
-
if (this.params.bootloaderBinary)
|
|
52841
|
-
targets.add('boot');
|
|
52842
|
-
if (this.params.applicationP1Binary)
|
|
52843
|
-
targets.add('app_v1');
|
|
52844
|
-
if (this.params.applicationP2Binary)
|
|
52845
|
-
targets.add('app_v2');
|
|
52846
|
-
if (this.params.coprocessorBinary)
|
|
52847
|
-
targets.add('coprocessor');
|
|
52848
|
-
if (this.params.se01Binary)
|
|
52849
|
-
targets.add('se01');
|
|
52850
|
-
if (this.params.se02Binary)
|
|
52851
|
-
targets.add('se02');
|
|
52852
|
-
if (this.params.se03Binary)
|
|
52853
|
-
targets.add('se03');
|
|
52854
|
-
if (this.params.se04Binary)
|
|
52855
|
-
targets.add('se04');
|
|
52856
|
-
return Array.from(targets);
|
|
52857
|
-
}
|
|
52858
52692
|
getProtocolV2DeviceFeatures() {
|
|
52859
52693
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52860
52694
|
let { features } = this.device;
|
|
@@ -53139,15 +52973,15 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53139
52973
|
if (!((_b = pathInfoRes.message) === null || _b === void 0 ? void 0 : _b.exist) ||
|
|
53140
52974
|
((_c = pathInfoRes.message) === null || _c === void 0 ? void 0 : _c.directory) ||
|
|
53141
52975
|
fileSize === undefined ||
|
|
53142
|
-
fileSize <
|
|
52976
|
+
fileSize < PROTOCOL_V2_RESOURCE_PACKAGE_HEADER_SIZE ||
|
|
53143
52977
|
(expectedSize !== undefined && fileSize !== expectedSize)) {
|
|
53144
52978
|
return null;
|
|
53145
52979
|
}
|
|
53146
52980
|
const chunkSize = this.getProtocolV2FirmwareChunkSize('read');
|
|
53147
52981
|
const chunks = [];
|
|
53148
52982
|
let offset = 0;
|
|
53149
|
-
while (offset <
|
|
53150
|
-
const readLen = Math.min(chunkSize,
|
|
52983
|
+
while (offset < PROTOCOL_V2_RESOURCE_PACKAGE_HEADER_SIZE) {
|
|
52984
|
+
const readLen = Math.min(chunkSize, PROTOCOL_V2_RESOURCE_PACKAGE_HEADER_SIZE - offset);
|
|
53151
52985
|
const res = yield typedCall('FilesystemFileRead', 'FilesystemFile', {
|
|
53152
52986
|
file: {
|
|
53153
52987
|
path: filePath,
|
|
@@ -53169,7 +53003,12 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53169
53003
|
headerBytes.set(chunk, cursor);
|
|
53170
53004
|
cursor += chunk.byteLength;
|
|
53171
53005
|
});
|
|
53172
|
-
|
|
53006
|
+
try {
|
|
53007
|
+
return parseProtocolV2ResourcePackageHeader(headerBytes, fileSize);
|
|
53008
|
+
}
|
|
53009
|
+
catch (_e) {
|
|
53010
|
+
return null;
|
|
53011
|
+
}
|
|
53173
53012
|
});
|
|
53174
53013
|
}
|
|
53175
53014
|
isProtocolV2ResourceBundleUpToDate(bundle) {
|
|
@@ -53395,7 +53234,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53395
53234
|
this.protocolV2LastTransferProgressAt = 0;
|
|
53396
53235
|
let processedSize = 0;
|
|
53397
53236
|
for (const resource of resourcesToSync) {
|
|
53398
|
-
const writePath =
|
|
53237
|
+
const writePath = resource.devicePath;
|
|
53399
53238
|
processedSize = yield this.protocolV2SourceUpdateProcess({
|
|
53400
53239
|
source: resource.source,
|
|
53401
53240
|
filePath: writePath,
|
|
@@ -65669,8 +65508,10 @@ function canSkipInitialize(method, device) {
|
|
|
65669
65508
|
return true;
|
|
65670
65509
|
}
|
|
65671
65510
|
function isRetryableBleProtocolV2ProbeError(method, error) {
|
|
65672
|
-
const
|
|
65511
|
+
const typedError = error;
|
|
65512
|
+
const message = typeof (typedError === null || typedError === void 0 ? void 0 : typedError.message) === 'string' ? typedError.message : String(error !== null && error !== void 0 ? error : '');
|
|
65673
65513
|
return (method.payload.connectProtocol === 'V2' &&
|
|
65514
|
+
(typedError === null || typedError === void 0 ? void 0 : typedError.errorCode) === hdShared.HardwareErrorCode.RuntimeError &&
|
|
65674
65515
|
message.includes('Device protocol mismatch') &&
|
|
65675
65516
|
message.includes('expected V2') &&
|
|
65676
65517
|
message.includes('did not respond to expected protocol'));
|
|
@@ -66409,14 +66250,12 @@ exports.normalizeSafetyCheckLevel = normalizeSafetyCheckLevel;
|
|
|
66409
66250
|
exports.normalizeVersionArray = normalizeVersionArray;
|
|
66410
66251
|
exports.parseConnectSettings = parseConnectSettings;
|
|
66411
66252
|
exports.parseMessage = parseMessage;
|
|
66412
|
-
exports.parseProtocolV2ResourceManifest = parseProtocolV2ResourceManifest;
|
|
66413
66253
|
exports.patchFeatures = patchFeatures;
|
|
66414
66254
|
exports.preloadSessionCache = preloadSessionCache;
|
|
66415
66255
|
exports.prepareFirmwareUpdateV4MemoryHost = prepareFirmwareUpdateV4MemoryHost;
|
|
66416
66256
|
exports.projectDeviceStateFeatures = projectFeatures;
|
|
66417
66257
|
exports.registerFirmwareUpdateHostBinding = registerFirmwareUpdateHostBinding;
|
|
66418
66258
|
exports.safeThrowError = safeThrowError;
|
|
66419
|
-
exports.selectProtocolV2ResourceManifestFiles = selectProtocolV2ResourceManifestFiles;
|
|
66420
66259
|
exports.setLoggerPostMessage = setLoggerPostMessage;
|
|
66421
66260
|
exports.supportInputPinOnSoftware = supportInputPinOnSoftware;
|
|
66422
66261
|
exports.switchTransport = switchTransport;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { FirmwareUpdateV4Target } from '../../types/api/firmwareUpdate';
|
|
1
|
+
import type { IProtocolV2Resources, IVersionArray } from '../../types';
|
|
3
2
|
export declare const PROTOCOL_V2_BOOT_RESOURCE_PACKAGE_PATH = "vol0:/loaders/bootloader/boot_resource.okpkg";
|
|
4
3
|
export declare const PROTOCOL_V2_BOOT_RESOURCE_PACKAGE_STAGING_PATH: string;
|
|
5
4
|
export declare const PROTOCOL_V2_ROM_PARAMS_PACKAGE_PATH = "vol0:/loaders/rom/params.okpkg";
|
|
5
|
+
export declare const PROTOCOL_V2_RESOURCE_PACKAGE_HEADER_SIZE = 24464;
|
|
6
6
|
export declare function parseProtocolV2Resources(value: unknown): IProtocolV2Resources | undefined;
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export type ProtocolV2ResourcePackageHeader = {
|
|
8
|
+
version: IVersionArray;
|
|
9
|
+
payloadLength: number;
|
|
10
|
+
devicePath: string;
|
|
11
|
+
payloadHash: string;
|
|
12
|
+
headerHash: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function parseProtocolV2ResourcePackageHeader(bytes: Uint8Array, packageSize: number): ProtocolV2ResourcePackageHeader;
|
|
15
|
+
export declare function parseProtocolV2ResourcePackage(binary: ArrayBuffer | Uint8Array): ProtocolV2ResourcePackageHeader;
|
|
12
16
|
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../src/protocols/protocol-v2/resources.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../src/protocols/protocol-v2/resources.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEvE,eAAO,MAAM,sCAAsC,iDACH,CAAC;AACjD,eAAO,MAAM,8CAA8C,QAAsD,CAAC;AAClH,eAAO,MAAM,mCAAmC,mCAAmC,CAAC;AACpF,eAAO,MAAM,wCAAwC,QAAS,CAAC;AAW/D,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,oBAAoB,GAAG,SAAS,CA8BzF;AAoDD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,OAAO,EAAE,aAAa,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE,MAAM,GAClB,+BAA+B,CAyCjC;AAED,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,WAAW,GAAG,UAAU,GAC/B,+BAA+B,CAGjC"}
|
package/dist/types/settings.d.ts
CHANGED
|
@@ -43,19 +43,6 @@ export type IProtocolV2ResourceSource = {
|
|
|
43
43
|
export type IProtocolV2Resources = {
|
|
44
44
|
source: IProtocolV2ResourceSource;
|
|
45
45
|
};
|
|
46
|
-
export type IProtocolV2ResourceManifestFile = {
|
|
47
|
-
archive_path: string;
|
|
48
|
-
original_name?: string;
|
|
49
|
-
device_path: string;
|
|
50
|
-
size: number;
|
|
51
|
-
sha256: string;
|
|
52
|
-
signed?: boolean;
|
|
53
|
-
sig_algo?: string;
|
|
54
|
-
payload_version?: string | null;
|
|
55
|
-
};
|
|
56
|
-
export type IProtocolV2ResourceManifest = {
|
|
57
|
-
files: IProtocolV2ResourceManifestFile[];
|
|
58
|
-
};
|
|
59
46
|
export type IFirmwareReleaseInfo = {
|
|
60
47
|
required: boolean;
|
|
61
48
|
url: string;
|