@onekeyfe/hd-core 1.2.0-alpha.91 → 1.2.0-alpha.92
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__/protocol-v2.test.ts +77 -28
- package/dist/api/FirmwareUpdateV4.d.ts +3 -0
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/api/firmware/getBinary.d.ts +1 -0
- package/dist/api/firmware/getBinary.d.ts.map +1 -1
- package/dist/index.d.ts +26 -1
- package/dist/index.js +136 -26
- package/dist/types/api/firmwareUpdate.d.ts +10 -0
- package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
- package/dist/types/settings.d.ts +11 -0
- package/dist/types/settings.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/FirmwareUpdateV4.ts +179 -15
- package/src/types/api/firmwareUpdate.ts +12 -0
- package/src/types/settings.ts +14 -0
|
@@ -6783,39 +6783,86 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
6783
6783
|
expect((method as any).params.targetsToUpdate).toEqual(['resource']);
|
|
6784
6784
|
});
|
|
6785
6785
|
|
|
6786
|
-
test
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
artifact: {
|
|
6800
|
-
artifactRef: 'legacy-resource',
|
|
6801
|
-
size: 1,
|
|
6802
|
-
sha256: '1'.repeat(64),
|
|
6786
|
+
test('keeps the deprecated resourceFiles path as a validated local compatibility flow', () => {
|
|
6787
|
+
const binary = new Uint8Array([1]).buffer;
|
|
6788
|
+
const method = new FirmwareUpdateV4({
|
|
6789
|
+
id: 1,
|
|
6790
|
+
payload: {
|
|
6791
|
+
method: 'firmwareUpdateV4',
|
|
6792
|
+
platform: 'web',
|
|
6793
|
+
resourceFiles: [
|
|
6794
|
+
{
|
|
6795
|
+
binary,
|
|
6796
|
+
devicePath: 'vol0:/bundles/images/images.okpkg',
|
|
6797
|
+
size: binary.byteLength,
|
|
6798
|
+
fileHash: bytesToHex(sha256(new Uint8Array(binary))),
|
|
6803
6799
|
},
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
}
|
|
6807
|
-
|
|
6800
|
+
],
|
|
6801
|
+
},
|
|
6802
|
+
});
|
|
6803
|
+
|
|
6804
|
+
expect(() => method.init()).not.toThrow();
|
|
6805
|
+
expect((method as any).params.targetsToUpdate).toEqual(['resource']);
|
|
6806
|
+
expect((method as any).prepareLegacyProtocolV2ResourceFiles()).toEqual([
|
|
6807
|
+
{
|
|
6808
|
+
name: 'images.okpkg',
|
|
6809
|
+
binary,
|
|
6810
|
+
devicePath: 'vol0:/bundles/images/images.okpkg',
|
|
6811
|
+
},
|
|
6812
|
+
]);
|
|
6813
|
+
});
|
|
6814
|
+
|
|
6815
|
+
test('keeps resourceBundleArtifacts for genuinely non-prepared legacy calls', async () => {
|
|
6816
|
+
const artifact = {
|
|
6817
|
+
artifactRef: 'legacy-resource',
|
|
6818
|
+
size: 1,
|
|
6819
|
+
sha256: '1'.repeat(64),
|
|
6820
|
+
};
|
|
6808
6821
|
const method = new FirmwareUpdateV4({
|
|
6809
6822
|
id: 1,
|
|
6810
6823
|
payload: {
|
|
6811
6824
|
method: 'firmwareUpdateV4',
|
|
6812
6825
|
platform: 'web',
|
|
6813
|
-
|
|
6814
|
-
|
|
6826
|
+
resourceBundleArtifacts: [
|
|
6827
|
+
{
|
|
6828
|
+
name: 'images',
|
|
6829
|
+
artifact,
|
|
6830
|
+
},
|
|
6831
|
+
],
|
|
6815
6832
|
},
|
|
6816
6833
|
});
|
|
6834
|
+
method.init();
|
|
6835
|
+
const source = { size: 1 };
|
|
6836
|
+
(method as any).openProtocolV2PreparedSource = jest.fn().mockResolvedValue(source);
|
|
6837
|
+
const releaseSpy = jest.spyOn(DataManager, 'getFirmwareLatestRelease').mockReturnValue({
|
|
6838
|
+
resourceBundles: [
|
|
6839
|
+
{
|
|
6840
|
+
name: 'images',
|
|
6841
|
+
devicePath: 'vol0:/bundles/images/images.okpkg',
|
|
6842
|
+
version: '1.0.0',
|
|
6843
|
+
payloadHash: '2'.repeat(128),
|
|
6844
|
+
headerHash: '3'.repeat(128),
|
|
6845
|
+
},
|
|
6846
|
+
],
|
|
6847
|
+
} as any);
|
|
6817
6848
|
|
|
6818
|
-
|
|
6849
|
+
try {
|
|
6850
|
+
await expect(
|
|
6851
|
+
(method as any).prepareLegacyProtocolV2ResourceBundleSources(
|
|
6852
|
+
EFirmwareType.Universal,
|
|
6853
|
+
{} as Features
|
|
6854
|
+
)
|
|
6855
|
+
).resolves.toEqual([
|
|
6856
|
+
expect.objectContaining({
|
|
6857
|
+
name: 'images',
|
|
6858
|
+
source,
|
|
6859
|
+
devicePath: 'vol0:/bundles/images/images.okpkg',
|
|
6860
|
+
}),
|
|
6861
|
+
]);
|
|
6862
|
+
expect((method as any).params.targetsToUpdate).toEqual(['resource']);
|
|
6863
|
+
} finally {
|
|
6864
|
+
releaseSpy.mockRestore();
|
|
6865
|
+
}
|
|
6819
6866
|
});
|
|
6820
6867
|
|
|
6821
6868
|
test('keeps the legacy componentArtifacts and artifactReader path without a prepared Plan', async () => {
|
|
@@ -7769,7 +7816,7 @@ describe('Protocol V2 firmware reconnect identity', () => {
|
|
|
7769
7816
|
);
|
|
7770
7817
|
});
|
|
7771
7818
|
|
|
7772
|
-
test('
|
|
7819
|
+
test('uses the connection route when DeviceInfo has no physical serial', async () => {
|
|
7773
7820
|
const method = new FirmwareUpdateV4({
|
|
7774
7821
|
id: 1,
|
|
7775
7822
|
payload: { method: 'firmwareUpdateV4' },
|
|
@@ -7779,12 +7826,14 @@ describe('Protocol V2 firmware reconnect identity', () => {
|
|
|
7779
7826
|
message: { protocol_version: 1, hw: {} },
|
|
7780
7827
|
});
|
|
7781
7828
|
(method as any).device = stubDevice({
|
|
7829
|
+
originalDescriptor: { path: '' },
|
|
7830
|
+
getConnectId: () => '000000000000',
|
|
7782
7831
|
getCommands: () => ({ typedCall }),
|
|
7783
7832
|
});
|
|
7784
7833
|
|
|
7785
|
-
await expect((method as any).captureProtocolV2PhysicalIdentity()).
|
|
7786
|
-
|
|
7787
|
-
|
|
7834
|
+
await expect((method as any).captureProtocolV2PhysicalIdentity()).resolves.toBeUndefined();
|
|
7835
|
+
expect((method as any).protocolV2ExpectedSerialNumber).toBeUndefined();
|
|
7836
|
+
expect((method as any).protocolV2ExpectedPath).toBe('000000000000');
|
|
7788
7837
|
});
|
|
7789
7838
|
|
|
7790
7839
|
test('uses the BLE read limit when reading an existing firmware bundle header', async () => {
|
|
@@ -28,6 +28,8 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
28
28
|
private prepareProtocolV2LocalMemoryHost;
|
|
29
29
|
private prepareProtocolV2LocalResourceArchive;
|
|
30
30
|
private prepareProtocolV2ResourceSources;
|
|
31
|
+
private prepareLegacyProtocolV2ResourceBundleSources;
|
|
32
|
+
private prepareLegacyProtocolV2ResourceFiles;
|
|
31
33
|
private prepareProtocolV2ResourceArchiveSources;
|
|
32
34
|
private runProtocolV2PreparedArtifacts;
|
|
33
35
|
private validateExpectedTargetVersions;
|
|
@@ -36,6 +38,7 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
36
38
|
private getProtocolV2RequestedTargets;
|
|
37
39
|
private getProtocolV2DeviceFeatures;
|
|
38
40
|
private getProtocolV2SerialNumber;
|
|
41
|
+
private getProtocolV2ConnectionRoute;
|
|
39
42
|
private assertProtocolV2DeviceInfoIdentity;
|
|
40
43
|
private getProtocolV2DeviceInfoTimeout;
|
|
41
44
|
private requestProtocolV2PhysicalIdentity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirmwareUpdateV4.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV4.ts"],"names":[],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upgradeType?: string | undefined;
|
|
36
36
|
components?: Record<string, import("../../types").IProtocolV2FirmwareComponent> | undefined;
|
|
37
37
|
installOrder?: string[] | undefined;
|
|
38
|
+
resourceBundles?: import("../../types").IProtocolV2ResourceBundle[] | undefined;
|
|
38
39
|
bootloaderChangelog?: {
|
|
39
40
|
"zh-CN": string;
|
|
40
41
|
"en-US": string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBinary.d.ts","sourceRoot":"","sources":["../../../src/api/firmware/getBinary.ts"],"names":[],"mappings":";AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,MAAM,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC;IAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,aAAa,CAAC;CAC7B;AAED,UAAU,cAAe,SAAQ,YAAY;IAC3C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACrC;AAED,eAAO,MAAM,SAAS,yFAOnB,cAAc
|
|
1
|
+
{"version":3,"file":"getBinary.d.ts","sourceRoot":"","sources":["../../../src/api/firmware/getBinary.ts"],"names":[],"mappings":";AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,MAAM,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC;IAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,aAAa,CAAC;CAC7B;AAED,UAAU,cAAe,SAAQ,YAAY;IAC3C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACrC;AAED,eAAO,MAAM,SAAS,yFAOnB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsChB,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAe,MAAM;;EAWrD,CAAC;AAEF,eAAO,MAAM,OAAO,0DAA2D,YAAY,kEAe1F,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -219,6 +219,17 @@ type IProtocolV2ResourceSource = {
|
|
|
219
219
|
type IProtocolV2Resources = {
|
|
220
220
|
source: IProtocolV2ResourceSource;
|
|
221
221
|
};
|
|
222
|
+
/** @deprecated Legacy per-bundle resource descriptor retained for published V4 callers. */
|
|
223
|
+
type IProtocolV2ResourceBundle = {
|
|
224
|
+
name: string;
|
|
225
|
+
url: string;
|
|
226
|
+
fingerprint?: string;
|
|
227
|
+
expectedSize?: number;
|
|
228
|
+
devicePath: string;
|
|
229
|
+
version?: IVersionArray;
|
|
230
|
+
payloadHash?: string;
|
|
231
|
+
headerHash?: string;
|
|
232
|
+
};
|
|
222
233
|
type IProtocolV2ResourceManifestFile = {
|
|
223
234
|
archive_path: string;
|
|
224
235
|
original_name: string;
|
|
@@ -274,6 +285,8 @@ type IFirmwareReleaseInfo = {
|
|
|
274
285
|
upgradeType?: 'payload-package-set' | string;
|
|
275
286
|
components?: Record<string, IProtocolV2FirmwareComponent>;
|
|
276
287
|
installOrder?: string[];
|
|
288
|
+
/** @deprecated New Protocol V2 releases use the independent signed resource ZIP. */
|
|
289
|
+
resourceBundles?: IProtocolV2ResourceBundle[];
|
|
277
290
|
bootloaderChangelog?: {
|
|
278
291
|
[k in ILocale]: string;
|
|
279
292
|
};
|
|
@@ -1437,9 +1450,21 @@ interface FirmwareUpdateV4Params {
|
|
|
1437
1450
|
se04Binary?: ArrayBuffer;
|
|
1438
1451
|
/** Complete Protocol V2 resource ZIP for local development; Core converts it to a local PreparedPlan. */
|
|
1439
1452
|
resourceArchiveBinary?: ArrayBuffer;
|
|
1453
|
+
/** @deprecated Package the complete signed resource set as a ZIP and use resourceArchiveBinary. */
|
|
1454
|
+
resourceFiles?: Array<{
|
|
1455
|
+
binary: ArrayBuffer;
|
|
1456
|
+
devicePath: string;
|
|
1457
|
+
size?: number;
|
|
1458
|
+
fileHash?: string;
|
|
1459
|
+
}>;
|
|
1440
1460
|
forcedUpdateRes?: boolean;
|
|
1441
1461
|
artifactReader?: FirmwareArtifactReader;
|
|
1442
1462
|
componentArtifacts?: Partial<Record<Exclude<FirmwareUpdateV4Target, 'resource' | 'boot_resources'>, FirmwareArtifactReference>>;
|
|
1463
|
+
/** @deprecated Use a ZIP artifact in preparedPlan instead. */
|
|
1464
|
+
resourceBundleArtifacts?: Array<{
|
|
1465
|
+
name: string;
|
|
1466
|
+
artifact: FirmwareArtifactReference;
|
|
1467
|
+
}>;
|
|
1443
1468
|
}
|
|
1444
1469
|
declare function registerFirmwareUpdateHostBinding$1(binding: FirmwareUpdateHostBinding): number;
|
|
1445
1470
|
declare function unregisterFirmwareUpdateHostBinding$1(generation?: number): boolean;
|
|
@@ -4903,4 +4928,4 @@ declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, can
|
|
|
4903
4928
|
declare const HardwareSDKLowLevel: ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel, updateSettings, switchTransport, }: LowLevelInjectApi) => LowLevelCoreApi;
|
|
4904
4929
|
declare const HardwareTopLevelSdk: () => CoreApi;
|
|
4905
4930
|
|
|
4906
|
-
export { AccountAddress, AccountAddresses, AlephiumAddress, AlephiumGetAddressParams, AlephiumSignMessageParams, AlephiumSignTransactionParams, AlephiumSignedTx, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AllFirmwareRelease, AllNetworkAddressParams, AllNetworkGetAddressParams, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignInMessageParams, AptosSignInMessageSignature, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BenfenAddress, BenfenGetAddressParams, BenfenGetPublicKeyParams, BenfenPublicKey, BenfenSignMessageParams, BenfenSignTransactionParams, BenfenSignedTx, BleReleaseInfoEvent, BleReleaseInfoPayload, BridgeReleaseCheckResult, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignMessageMethodParams, CardanoSignMessageParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, ClearSessionCacheParams, ClearSessionCachePayload, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DEVICE_SETTINGS_SHARED_FIELDS, DEVICE_SETTINGS_V1_ONLY_FIELDS, DEVICE_SETTINGS_V2_ONLY_FIELDS, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceConnnectRequest, DeviceDisconnnectRequest, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesMode, DeviceFeaturesPayload, DeviceFeaturesProtocol, DeviceFeaturesRaw, DeviceFeaturesRawPatch, DeviceFeaturesVerify, DeviceFirmwareRange, DeviceFlagsParams, DeviceModelToTypes, DeviceProgress, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSendState, DeviceSendSupportFeatures, DeviceSettingsCapabilities, DeviceSettingsDurationOption, DeviceSettingsField, DeviceSettingsParams, DeviceSettingsProtocol, DeviceSettingsValueOption, DeviceState, DeviceStateEvent, DeviceStateIdentity, DeviceStateMode, DeviceStatePatch, DeviceStateProtocol, DeviceStateScope, DeviceStateSection, DeviceStateSecurityElement, DeviceStateSecurityElements, DeviceStateSecurityElementsPatch, DeviceStateSettings, DeviceStateStatus, DeviceStateUpdateSource, DeviceStateVersions, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceTypeToModels, DeviceUnlockParams, DeviceUploadResourceParams, DeviceUploadResourceResponse, DeviceVerifyParams, DeviceVerifySignature, DnxAddress, DnxGetAddressParams, DnxSignTransactionParams, DnxSignature, DnxTxKey, EOneKeyDeviceMode, EVMAccessList, EVMAddress, EVMAuthorization, EVMAuthorizationSignature, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMTransactionEIP7702, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FilecoinAddress, FilecoinGetAddressParams, FilecoinSignTransactionParams, FilecoinSignedTx, FirmwareArtifactReader, FirmwareArtifactReference, FirmwareEvent, FirmwareMemoryArtifact, FirmwareMemoryArtifactEntry, FirmwareMessage, FirmwareProcessing, FirmwareProgress, FirmwareRange, FirmwareRelease, FirmwareReleaseCheckResult, FirmwareTip, FirmwareUpdateArtifactParams, FirmwareUpdateBinaryParams, FirmwareUpdateCapabilities, FirmwareUpdateHostBinding, FirmwareUpdateParams, FirmwareUpdatePlan, FirmwareUpdatePlanArtifact, FirmwareUpdatePlanArtifactRole, FirmwareUpdatePlanForceTarget, FirmwareUpdatePlanTarget, FirmwareUpdatePreparedArtifact, FirmwareUpdatePreparedArtifactInput, FirmwareUpdatePreparedEntry, FirmwareUpdatePreparedPlan, FirmwareUpdateTipMessage, FirmwareUpdateV3Params, FirmwareUpdateV4MemoryHost, FirmwareUpdateV4Params, FirmwareUpdateV4Target, GetDeviceStateParams, GetPassphraseStateParams, HardwareSDKLowLevel, HardwareTopLevelSdk, HardwareUiInteractionMeta, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareField, IFirmwareReleaseInfo, IFirmwareUpdateProgressType, IFirmwareUpdateTipMessage, IFrameBridge, IFrameCallMessage, IFrameCallback, IFrameCallbackMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, IFrameSwitchTransport, IFrameSwitchTransportMessage, ILocale, IProtocolV2FirmwareComponent, IProtocolV2FirmwareComponentTarget, IProtocolV2ResourceManifest, IProtocolV2ResourceManifestFile, IProtocolV2ResourceSource, IProtocolV2Resources, ITransportStatus, IVersionArray, IVersionRange, KaspaAddress, KaspaGetAddressParams, KaspaSignInputParams, KaspaSignOutputParams, KaspaSignTransactionParams, KaspaSignature, KaspaStreamingSignInputParams, KaspaStreamingSignOutputParams, KnownDevice, LOG, LOG_EVENT, LogBlockEvent, LogEvent, LogEventMessage, LogOutput, LoggerNames, LowLevelCoreApi, LowLevelInjectApi, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, NearAddress, NearGetAddressParams, NearSignTransactionParams, NervosAddress, NervosGetAddressParams, NervosSignTransactionParams, NervosSignedTx, NexaAddress, NexaGetAddressParams, NexaSignInputParams, NexaSignOutputParams, NexaSignTransactionParams, NexaSignature, NormalizedFeatures, OnekeyFeatures, OpenWalletSessionMode, OpenWalletSessionModeValue, OpenWalletSessionParams, OpenWalletSessionPayload, PRO2_WALLPAPER_HEIGHT, PRO2_WALLPAPER_WIDTH, PROTOCOL_V2_NEVER_TIMEOUT_MS, Params, PassphraseRequestPayload, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, Pro2WallpaperColorFormat, ProtocolV2ComponentReleaseInfo, ProtocolV2FirmwareComponentRelease, ProtocolV2FirmwareComponentReleaseStatus, ProtocolV2FirmwareReleaseStatus, ProtocolV2UiCompletion, ProtocolV2UiEventMetadata, ProtocolV2UiEventSource, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, RequestContext, Response, ScdoAddress, ScdoGetAddressParams, ScdoSignMessageParams, ScdoSignTransactionParams, ScdoSignedTx, SdkTracingContext, SearchDevice, SignedTransaction, SolSignMessageParams, SolSignMessageResponse, SolSignOffchainMessageParams, SolSignOffchainMessageResponse, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, SuiAddress, SuiGetAddressParams, SuiGetPublicKeyParams, SuiPublicKey, SuiSignMessageParams, SuiSignTransactionParams, SuiSignedTx, SupportFeatureType, SupportFeatures, TestProtocolV2PingParams, TonAddress, TonGetAddressParams, TonSignDataParams, TonSignMessageParams, TonSignProofParams, TopLevelInjectApi, TransactionOptions, TransportReleaseStatus, TronAddress, TronDelegateResourceContract, TronFreezeBalanceV2Contract, TronGetAddressParams, TronSignMessageParams, TronSignTransactionParams, TronTransaction, TronTransactionContract, TronTransferContract, TronTriggerSmartContract, TronUnDelegateResourceContract, TronUnfreezeBalanceV2Contract, TronWithdrawBalanceContract, TronWithdrawExpireUnfreezeContract, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestFirmwareProgressing, UiRequestPassphrase, UiRequestPassphraseOnDevice, UiRequestSelectDeviceForSwitchFirmwareWebDevice, UiRequestSelectDeviceInBootloaderForWebDevice, UiRequestWindowClose, UiRequestWithoutPayload, UiResponseCorrelation, UiResponseCorrelationFields, UiResponseEvent, UiResponseMessage, UiResponsePassphrase, UiResponsePin, UiResponseSelectDeviceForSwitchFirmwareWebDevice, UiResponseSelectDeviceInBootloaderForWebDevice, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, checkNeedUpdateBootForClassicAndMini, checkNeedUpdateBootForTouch, cleanupCallback, cleanupSdkInstance, completeRequestContext, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createRequestContext, createResponseMessage, createSdkTracingContext, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, encodePro2Wallpaper, executeCallback, formatLogMethodLabel, formatRequestContext, generateInstanceId, generateSdkInstanceId, getActiveRequestsByDeviceInstance, getAutoLockOptions, getAutoShutDownOptions, getDeviceBLEFirmwareVersion, getDeviceBleName, getDeviceBoardloaderVersion, getDeviceBootloaderVersion, getDeviceFirmwareVersion, getDeviceLabel, getDeviceSerialNo, getDeviceSettingsCapabilities, getDeviceType, getDeviceTypeByBleName, getDeviceUUID, getEnv, getFirmwareType, getFirmwareUpdateField, getFirmwareUpdateFieldArray, getFirmwareUpdateHostBindingGeneration, getHDPath, getHomeScreenDefaultList, getHomeScreenHex, getHomeScreenSize, getLanguageConfig, getLog, getLogBlockLabel, getLogger, getMethodSupportedProtocols, getMethodVersionRange, getNftSize, getOutputScriptType, getSDKVersion, getSafeLogPayload, getScriptType, getTimeStamp, httpRequest, init$1 as initCore, isBleConnect, isValidVersionArray, isValidVersionString, normalizeSafetyCheckLevel, normalizeVersionArray, parseConnectSettings, parseMessage, parseProtocolV2ResourceManifest, patchFeatures, preloadSessionCache, prepareFirmwareUpdateV4MemoryHost, projectFeatures as projectDeviceStateFeatures, registerFirmwareUpdateHostBinding, safeThrowError, selectProtocolV2ResourceManifestFiles, setLoggerPostMessage, supportInputPinOnSoftware, switchTransport, transportEnv, unregisterFirmwareUpdateHostBinding, updateRequestContext, versionCompare, versionSplit, wait, whitelist, whitelistExtension };
|
|
4931
|
+
export { AccountAddress, AccountAddresses, AlephiumAddress, AlephiumGetAddressParams, AlephiumSignMessageParams, AlephiumSignTransactionParams, AlephiumSignedTx, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AllFirmwareRelease, AllNetworkAddressParams, AllNetworkGetAddressParams, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignInMessageParams, AptosSignInMessageSignature, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BenfenAddress, BenfenGetAddressParams, BenfenGetPublicKeyParams, BenfenPublicKey, BenfenSignMessageParams, BenfenSignTransactionParams, BenfenSignedTx, BleReleaseInfoEvent, BleReleaseInfoPayload, BridgeReleaseCheckResult, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignMessageMethodParams, CardanoSignMessageParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, ClearSessionCacheParams, ClearSessionCachePayload, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DEVICE_SETTINGS_SHARED_FIELDS, DEVICE_SETTINGS_V1_ONLY_FIELDS, DEVICE_SETTINGS_V2_ONLY_FIELDS, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceConnnectRequest, DeviceDisconnnectRequest, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesMode, DeviceFeaturesPayload, DeviceFeaturesProtocol, DeviceFeaturesRaw, DeviceFeaturesRawPatch, DeviceFeaturesVerify, DeviceFirmwareRange, DeviceFlagsParams, DeviceModelToTypes, DeviceProgress, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSendState, DeviceSendSupportFeatures, DeviceSettingsCapabilities, DeviceSettingsDurationOption, DeviceSettingsField, DeviceSettingsParams, DeviceSettingsProtocol, DeviceSettingsValueOption, DeviceState, DeviceStateEvent, DeviceStateIdentity, DeviceStateMode, DeviceStatePatch, DeviceStateProtocol, DeviceStateScope, DeviceStateSection, DeviceStateSecurityElement, DeviceStateSecurityElements, DeviceStateSecurityElementsPatch, DeviceStateSettings, DeviceStateStatus, DeviceStateUpdateSource, DeviceStateVersions, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceTypeToModels, DeviceUnlockParams, DeviceUploadResourceParams, DeviceUploadResourceResponse, DeviceVerifyParams, DeviceVerifySignature, DnxAddress, DnxGetAddressParams, DnxSignTransactionParams, DnxSignature, DnxTxKey, EOneKeyDeviceMode, EVMAccessList, EVMAddress, EVMAuthorization, EVMAuthorizationSignature, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMTransactionEIP7702, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FilecoinAddress, FilecoinGetAddressParams, FilecoinSignTransactionParams, FilecoinSignedTx, FirmwareArtifactReader, FirmwareArtifactReference, FirmwareEvent, FirmwareMemoryArtifact, FirmwareMemoryArtifactEntry, FirmwareMessage, FirmwareProcessing, FirmwareProgress, FirmwareRange, FirmwareRelease, FirmwareReleaseCheckResult, FirmwareTip, FirmwareUpdateArtifactParams, FirmwareUpdateBinaryParams, FirmwareUpdateCapabilities, FirmwareUpdateHostBinding, FirmwareUpdateParams, FirmwareUpdatePlan, FirmwareUpdatePlanArtifact, FirmwareUpdatePlanArtifactRole, FirmwareUpdatePlanForceTarget, FirmwareUpdatePlanTarget, FirmwareUpdatePreparedArtifact, FirmwareUpdatePreparedArtifactInput, FirmwareUpdatePreparedEntry, FirmwareUpdatePreparedPlan, FirmwareUpdateTipMessage, FirmwareUpdateV3Params, FirmwareUpdateV4MemoryHost, FirmwareUpdateV4Params, FirmwareUpdateV4Target, GetDeviceStateParams, GetPassphraseStateParams, HardwareSDKLowLevel, HardwareTopLevelSdk, HardwareUiInteractionMeta, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareField, IFirmwareReleaseInfo, IFirmwareUpdateProgressType, IFirmwareUpdateTipMessage, IFrameBridge, IFrameCallMessage, IFrameCallback, IFrameCallbackMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, IFrameSwitchTransport, IFrameSwitchTransportMessage, ILocale, IProtocolV2FirmwareComponent, IProtocolV2FirmwareComponentTarget, IProtocolV2ResourceBundle, IProtocolV2ResourceManifest, IProtocolV2ResourceManifestFile, IProtocolV2ResourceSource, IProtocolV2Resources, ITransportStatus, IVersionArray, IVersionRange, KaspaAddress, KaspaGetAddressParams, KaspaSignInputParams, KaspaSignOutputParams, KaspaSignTransactionParams, KaspaSignature, KaspaStreamingSignInputParams, KaspaStreamingSignOutputParams, KnownDevice, LOG, LOG_EVENT, LogBlockEvent, LogEvent, LogEventMessage, LogOutput, LoggerNames, LowLevelCoreApi, LowLevelInjectApi, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, NearAddress, NearGetAddressParams, NearSignTransactionParams, NervosAddress, NervosGetAddressParams, NervosSignTransactionParams, NervosSignedTx, NexaAddress, NexaGetAddressParams, NexaSignInputParams, NexaSignOutputParams, NexaSignTransactionParams, NexaSignature, NormalizedFeatures, OnekeyFeatures, OpenWalletSessionMode, OpenWalletSessionModeValue, OpenWalletSessionParams, OpenWalletSessionPayload, PRO2_WALLPAPER_HEIGHT, PRO2_WALLPAPER_WIDTH, PROTOCOL_V2_NEVER_TIMEOUT_MS, Params, PassphraseRequestPayload, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, Pro2WallpaperColorFormat, ProtocolV2ComponentReleaseInfo, ProtocolV2FirmwareComponentRelease, ProtocolV2FirmwareComponentReleaseStatus, ProtocolV2FirmwareReleaseStatus, ProtocolV2UiCompletion, ProtocolV2UiEventMetadata, ProtocolV2UiEventSource, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, RequestContext, Response, ScdoAddress, ScdoGetAddressParams, ScdoSignMessageParams, ScdoSignTransactionParams, ScdoSignedTx, SdkTracingContext, SearchDevice, SignedTransaction, SolSignMessageParams, SolSignMessageResponse, SolSignOffchainMessageParams, SolSignOffchainMessageResponse, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, SuiAddress, SuiGetAddressParams, SuiGetPublicKeyParams, SuiPublicKey, SuiSignMessageParams, SuiSignTransactionParams, SuiSignedTx, SupportFeatureType, SupportFeatures, TestProtocolV2PingParams, TonAddress, TonGetAddressParams, TonSignDataParams, TonSignMessageParams, TonSignProofParams, TopLevelInjectApi, TransactionOptions, TransportReleaseStatus, TronAddress, TronDelegateResourceContract, TronFreezeBalanceV2Contract, TronGetAddressParams, TronSignMessageParams, TronSignTransactionParams, TronTransaction, TronTransactionContract, TronTransferContract, TronTriggerSmartContract, TronUnDelegateResourceContract, TronUnfreezeBalanceV2Contract, TronWithdrawBalanceContract, TronWithdrawExpireUnfreezeContract, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestFirmwareProgressing, UiRequestPassphrase, UiRequestPassphraseOnDevice, UiRequestSelectDeviceForSwitchFirmwareWebDevice, UiRequestSelectDeviceInBootloaderForWebDevice, UiRequestWindowClose, UiRequestWithoutPayload, UiResponseCorrelation, UiResponseCorrelationFields, UiResponseEvent, UiResponseMessage, UiResponsePassphrase, UiResponsePin, UiResponseSelectDeviceForSwitchFirmwareWebDevice, UiResponseSelectDeviceInBootloaderForWebDevice, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, checkNeedUpdateBootForClassicAndMini, checkNeedUpdateBootForTouch, cleanupCallback, cleanupSdkInstance, completeRequestContext, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createRequestContext, createResponseMessage, createSdkTracingContext, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, encodePro2Wallpaper, executeCallback, formatLogMethodLabel, formatRequestContext, generateInstanceId, generateSdkInstanceId, getActiveRequestsByDeviceInstance, getAutoLockOptions, getAutoShutDownOptions, getDeviceBLEFirmwareVersion, getDeviceBleName, getDeviceBoardloaderVersion, getDeviceBootloaderVersion, getDeviceFirmwareVersion, getDeviceLabel, getDeviceSerialNo, getDeviceSettingsCapabilities, getDeviceType, getDeviceTypeByBleName, getDeviceUUID, getEnv, getFirmwareType, getFirmwareUpdateField, getFirmwareUpdateFieldArray, getFirmwareUpdateHostBindingGeneration, getHDPath, getHomeScreenDefaultList, getHomeScreenHex, getHomeScreenSize, getLanguageConfig, getLog, getLogBlockLabel, getLogger, getMethodSupportedProtocols, getMethodVersionRange, getNftSize, getOutputScriptType, getSDKVersion, getSafeLogPayload, getScriptType, getTimeStamp, httpRequest, init$1 as initCore, isBleConnect, isValidVersionArray, isValidVersionString, normalizeSafetyCheckLevel, normalizeVersionArray, parseConnectSettings, parseMessage, parseProtocolV2ResourceManifest, patchFeatures, preloadSessionCache, prepareFirmwareUpdateV4MemoryHost, projectFeatures as projectDeviceStateFeatures, registerFirmwareUpdateHostBinding, safeThrowError, selectProtocolV2ResourceManifestFiles, setLoggerPostMessage, supportInputPinOnSoftware, switchTransport, transportEnv, unregisterFirmwareUpdateHostBinding, updateRequestContext, versionCompare, versionSplit, wait, whitelist, whitelistExtension };
|
package/dist/index.js
CHANGED
|
@@ -51637,7 +51637,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51637
51637
|
return ['V2'];
|
|
51638
51638
|
}
|
|
51639
51639
|
init() {
|
|
51640
|
-
var _a, _b, _c, _d, _e;
|
|
51640
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
51641
51641
|
this.allowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.NOT_INITIALIZE];
|
|
51642
51642
|
this.requireDeviceMode = [];
|
|
51643
51643
|
this.unlockPolicy = 'unlock-before-run';
|
|
@@ -51680,9 +51680,6 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51680
51680
|
(payload.expectedDeviceId.length === 0 || payload.expectedDeviceId.length > 160)) {
|
|
51681
51681
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, 'Protocol V2 expected device identity is invalid');
|
|
51682
51682
|
}
|
|
51683
|
-
if (((_a = payload.resourceFiles) === null || _a === void 0 ? void 0 : _a.length) || ((_b = payload.resourceBundleArtifacts) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
51684
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, 'Protocol V2 resourceFiles and resourceBundleArtifacts are deprecated; provide a complete signed resource ZIP through resourceArchiveBinary or preparedPlan');
|
|
51685
|
-
}
|
|
51686
51683
|
const preparedPlan = payload.preparedPlan
|
|
51687
51684
|
? validateFirmwareUpdatePreparedPlan(payload.preparedPlan)
|
|
51688
51685
|
: undefined;
|
|
@@ -51697,9 +51694,10 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51697
51694
|
payload.se03Binary,
|
|
51698
51695
|
payload.se04Binary,
|
|
51699
51696
|
payload.resourceArchiveBinary,
|
|
51697
|
+
(_a = payload.resourceFiles) === null || _a === void 0 ? void 0 : _a.length,
|
|
51700
51698
|
].some(Boolean);
|
|
51701
|
-
if (preparedPlan && hasLocalArtifacts) {
|
|
51702
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, 'Prepared firmware plans cannot be combined with local firmware
|
|
51699
|
+
if (preparedPlan && (hasLocalArtifacts || ((_b = payload.resourceBundleArtifacts) === null || _b === void 0 ? void 0 : _b.length))) {
|
|
51700
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, 'Prepared firmware plans cannot be combined with legacy or local firmware inputs');
|
|
51703
51701
|
}
|
|
51704
51702
|
const hostBinding = payload.hostBindingGeneration !== undefined
|
|
51705
51703
|
? resolveFirmwareUpdateHostBinding(payload.hostBindingGeneration, preparedPlan === null || preparedPlan === void 0 ? void 0 : preparedPlan.preparedPlanDigest)
|
|
@@ -51740,12 +51738,18 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51740
51738
|
return result;
|
|
51741
51739
|
}, {});
|
|
51742
51740
|
const localTargetsToUpdate = (_c = payload.targetsToUpdate) === null || _c === void 0 ? void 0 : _c.map((target) => target === 'boot_resources' ? 'resource' : target);
|
|
51743
|
-
if (payload.resourceArchiveBinary
|
|
51741
|
+
if ((payload.resourceArchiveBinary ||
|
|
51742
|
+
((_d = payload.resourceFiles) === null || _d === void 0 ? void 0 : _d.length) ||
|
|
51743
|
+
((_e = payload.resourceBundleArtifacts) === null || _e === void 0 ? void 0 : _e.length)) &&
|
|
51744
51744
|
localTargetsToUpdate &&
|
|
51745
51745
|
!localTargetsToUpdate.includes('resource')) {
|
|
51746
51746
|
localTargetsToUpdate.push('resource');
|
|
51747
51747
|
}
|
|
51748
|
-
const resolvedLocalTargetsToUpdate = localTargetsToUpdate !== null && localTargetsToUpdate !== void 0 ? localTargetsToUpdate : (payload.resourceArchiveBinary
|
|
51748
|
+
const resolvedLocalTargetsToUpdate = localTargetsToUpdate !== null && localTargetsToUpdate !== void 0 ? localTargetsToUpdate : (payload.resourceArchiveBinary ||
|
|
51749
|
+
((_f = payload.resourceFiles) === null || _f === void 0 ? void 0 : _f.length) ||
|
|
51750
|
+
((_g = payload.resourceBundleArtifacts) === null || _g === void 0 ? void 0 : _g.length)
|
|
51751
|
+
? ['resource']
|
|
51752
|
+
: undefined);
|
|
51749
51753
|
this.params = {
|
|
51750
51754
|
preparedPlan,
|
|
51751
51755
|
chunkSize: payload.chunkSize,
|
|
@@ -51760,7 +51764,8 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51760
51764
|
se03Binary: payload.se03Binary,
|
|
51761
51765
|
se04Binary: payload.se04Binary,
|
|
51762
51766
|
resourceArchiveBinary: payload.resourceArchiveBinary,
|
|
51763
|
-
|
|
51767
|
+
resourceFiles: payload.resourceFiles,
|
|
51768
|
+
firmwareType: (_h = preparedPlan === null || preparedPlan === void 0 ? void 0 : preparedPlan.firmwareType) !== null && _h !== void 0 ? _h : payload.firmwareType,
|
|
51764
51769
|
targetsToUpdate: preparedPlan
|
|
51765
51770
|
? [...preparedPlan.targetsToUpdate]
|
|
51766
51771
|
: resolvedLocalTargetsToUpdate,
|
|
@@ -51769,8 +51774,9 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51769
51774
|
: payload.expectedTargetVersions,
|
|
51770
51775
|
platform: payload.platform,
|
|
51771
51776
|
expectedDeviceId: payload.expectedDeviceId,
|
|
51772
|
-
artifactReader: (
|
|
51777
|
+
artifactReader: (_j = hostBinding === null || hostBinding === void 0 ? void 0 : hostBinding.artifactReader) !== null && _j !== void 0 ? _j : payload.artifactReader,
|
|
51773
51778
|
componentArtifacts: preparedPlan ? undefined : payload.componentArtifacts,
|
|
51779
|
+
resourceBundleArtifacts: preparedPlan ? undefined : payload.resourceBundleArtifacts,
|
|
51774
51780
|
};
|
|
51775
51781
|
}
|
|
51776
51782
|
getProtocolV2FirmwareChunkSize(direction, filePath) {
|
|
@@ -51801,7 +51807,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51801
51807
|
});
|
|
51802
51808
|
}
|
|
51803
51809
|
runProtocolV2() {
|
|
51804
|
-
var _a, _b, _c, _d, _e, _f;
|
|
51810
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
51805
51811
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51806
51812
|
yield this.captureProtocolV2PhysicalIdentity();
|
|
51807
51813
|
const deviceFeatures = yield this.getProtocolV2DeviceFeatures();
|
|
@@ -51813,9 +51819,29 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51813
51819
|
const deviceFirmwareType = getFirmwareType(deviceFeatures);
|
|
51814
51820
|
const firmwareType = (_a = this.params.firmwareType) !== null && _a !== void 0 ? _a : deviceFirmwareType;
|
|
51815
51821
|
this.validateExpectedTargetVersions();
|
|
51822
|
+
if (!this.params.preparedPlan && ((_b = this.params.resourceFiles) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
51823
|
+
if (this.params.resourceArchiveBinary || ((_c = this.params.resourceBundleArtifacts) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
51824
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, 'Legacy resourceFiles cannot be combined with another Protocol V2 resource input');
|
|
51825
|
+
}
|
|
51826
|
+
this.postTipMessage(exports.FirmwareUpdateTipMessage.StartDownloadFirmware);
|
|
51827
|
+
const installItems = this.buildProtocolV2InstallItems({
|
|
51828
|
+
bootloaderBinary: this.prepareBootloaderBinary(),
|
|
51829
|
+
fwBinaryMap: this.collectExplicitTargetBinaries(),
|
|
51830
|
+
});
|
|
51831
|
+
const missingFirmwareTarget = this.getMissingProtocolV2FirmwareTargets(installItems)[0];
|
|
51832
|
+
if (missingFirmwareTarget) {
|
|
51833
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `Protocol V2 legacy local update has no binary for requested target ${missingFirmwareTarget}`, {
|
|
51834
|
+
firmwareUpdateCode: 'FirmwareArtifactsNotPrepared',
|
|
51835
|
+
artifactName: missingFirmwareTarget,
|
|
51836
|
+
});
|
|
51837
|
+
}
|
|
51838
|
+
const resourceBundles = this.prepareLegacyProtocolV2ResourceFiles();
|
|
51839
|
+
this.postTipMessage(exports.FirmwareUpdateTipMessage.FinishDownloadFirmware);
|
|
51840
|
+
return this.executeProtocolV2Update({ installItems, resourceBundles });
|
|
51841
|
+
}
|
|
51816
51842
|
if (!this.params.preparedPlan &&
|
|
51817
51843
|
this.params.resourceArchiveBinary &&
|
|
51818
|
-
((
|
|
51844
|
+
((_d = this.params.targetsToUpdate) === null || _d === void 0 ? void 0 : _d.includes('resource'))) {
|
|
51819
51845
|
const localMemoryHost = yield this.prepareProtocolV2LocalMemoryHost({
|
|
51820
51846
|
features: deviceFeatures,
|
|
51821
51847
|
firmwareType,
|
|
@@ -51827,11 +51853,13 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51827
51853
|
localMemoryHost.release();
|
|
51828
51854
|
}
|
|
51829
51855
|
}
|
|
51830
|
-
const hasPreparedComponentArtifacts = Object.values((
|
|
51831
|
-
if (this.params.preparedPlan ||
|
|
51856
|
+
const hasPreparedComponentArtifacts = Object.values((_e = this.params.componentArtifacts) !== null && _e !== void 0 ? _e : {}).some(Boolean);
|
|
51857
|
+
if (this.params.preparedPlan ||
|
|
51858
|
+
hasPreparedComponentArtifacts ||
|
|
51859
|
+
((_f = this.params.resourceBundleArtifacts) === null || _f === void 0 ? void 0 : _f.length)) {
|
|
51832
51860
|
return this.runProtocolV2PreparedArtifacts(deviceFeatures, firmwareType);
|
|
51833
51861
|
}
|
|
51834
|
-
const wantsResources = !!((
|
|
51862
|
+
const wantsResources = !!((_g = this.params.targetsToUpdate) === null || _g === void 0 ? void 0 : _g.includes('resource'));
|
|
51835
51863
|
let fwBinaryMap = [];
|
|
51836
51864
|
let bootloaderBinary = null;
|
|
51837
51865
|
let installItems;
|
|
@@ -51844,7 +51872,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51844
51872
|
fwBinaryMap,
|
|
51845
51873
|
});
|
|
51846
51874
|
const missingFirmwareTargets = this.getMissingProtocolV2FirmwareTargets(explicitInstallItems);
|
|
51847
|
-
const needsRemoteFirmware = ((
|
|
51875
|
+
const needsRemoteFirmware = ((_h = this.params.targetsToUpdate) === null || _h === void 0 ? void 0 : _h.length)
|
|
51848
51876
|
? missingFirmwareTargets.length > 0
|
|
51849
51877
|
: explicitInstallItems.length === 0;
|
|
51850
51878
|
if (wantsResources) {
|
|
@@ -51874,7 +51902,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51874
51902
|
if (typeof err === 'object' &&
|
|
51875
51903
|
err !== null &&
|
|
51876
51904
|
'params' in err &&
|
|
51877
|
-
((
|
|
51905
|
+
((_j = err.params) === null || _j === void 0 ? void 0 : _j.firmwareUpdateCode) === 'FirmwareArtifactsNotPrepared') {
|
|
51878
51906
|
throw err;
|
|
51879
51907
|
}
|
|
51880
51908
|
if (err instanceof hdShared.HardwareError && err.errorCode === hdShared.HardwareErrorCode.NetworkError) {
|
|
@@ -52155,8 +52183,8 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52155
52183
|
return { binary, materializedEntries };
|
|
52156
52184
|
});
|
|
52157
52185
|
}
|
|
52158
|
-
prepareProtocolV2ResourceSources() {
|
|
52159
|
-
var _a, _b;
|
|
52186
|
+
prepareProtocolV2ResourceSources(firmwareType, features) {
|
|
52187
|
+
var _a, _b, _c;
|
|
52160
52188
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52161
52189
|
const resourceRequested = (_b = (_a = this.params.targetsToUpdate) === null || _a === void 0 ? void 0 : _a.includes('resource')) !== null && _b !== void 0 ? _b : false;
|
|
52162
52190
|
if (!resourceRequested) {
|
|
@@ -52166,9 +52194,83 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52166
52194
|
if (archiveSources) {
|
|
52167
52195
|
return archiveSources;
|
|
52168
52196
|
}
|
|
52197
|
+
if (!this.params.preparedPlan && ((_c = this.params.resourceBundleArtifacts) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
52198
|
+
return this.prepareLegacyProtocolV2ResourceBundleSources(firmwareType, features);
|
|
52199
|
+
}
|
|
52169
52200
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 resource archive is not prepared', { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52170
52201
|
});
|
|
52171
52202
|
}
|
|
52203
|
+
prepareLegacyProtocolV2ResourceBundleSources(firmwareType, features) {
|
|
52204
|
+
var _a, _b;
|
|
52205
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52206
|
+
const artifacts = (_a = this.params.resourceBundleArtifacts) !== null && _a !== void 0 ? _a : [];
|
|
52207
|
+
if (artifacts.length > PROTOCOL_V2_RESOURCE_FILE_MAX_COUNT) {
|
|
52208
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 legacy resource artifact count exceeds the allowed limit', { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52209
|
+
}
|
|
52210
|
+
const names = new Set();
|
|
52211
|
+
const release = DataManager.getFirmwareLatestRelease(features, firmwareType);
|
|
52212
|
+
const descriptors = new Map(((_b = release === null || release === void 0 ? void 0 : release.resourceBundles) !== null && _b !== void 0 ? _b : []).map(descriptor => [descriptor.name, descriptor]));
|
|
52213
|
+
const sources = [];
|
|
52214
|
+
let totalSize = 0;
|
|
52215
|
+
for (const [index, item] of artifacts.entries()) {
|
|
52216
|
+
if (!item.name || names.has(item.name)) {
|
|
52217
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `Protocol V2 legacy resource artifact name is invalid: ${item.name || index}`, { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52218
|
+
}
|
|
52219
|
+
names.add(item.name);
|
|
52220
|
+
const descriptor = descriptors.get(item.name);
|
|
52221
|
+
if (!descriptor) {
|
|
52222
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `Protocol V2 release does not contain legacy resource bundle ${item.name}`, { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared', artifactName: item.name });
|
|
52223
|
+
}
|
|
52224
|
+
const source = yield this.openProtocolV2PreparedSource(item.artifact);
|
|
52225
|
+
totalSize += source.size;
|
|
52226
|
+
if (source.size <= 0 || totalSize > PROTOCOL_V2_RESOURCE_TOTAL_MAX_BYTES) {
|
|
52227
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 legacy resource artifacts exceed the allowed size limit', { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52228
|
+
}
|
|
52229
|
+
const devicePath = validateProtocolV2FilesystemPath(descriptor.devicePath, `resourceBundleArtifacts[${index}].devicePath`);
|
|
52230
|
+
sources.push({
|
|
52231
|
+
name: descriptor.name,
|
|
52232
|
+
source,
|
|
52233
|
+
devicePath,
|
|
52234
|
+
version: descriptor.version,
|
|
52235
|
+
payloadHash: descriptor.payloadHash,
|
|
52236
|
+
headerHash: descriptor.headerHash,
|
|
52237
|
+
});
|
|
52238
|
+
}
|
|
52239
|
+
return sources;
|
|
52240
|
+
});
|
|
52241
|
+
}
|
|
52242
|
+
prepareLegacyProtocolV2ResourceFiles() {
|
|
52243
|
+
var _a;
|
|
52244
|
+
const files = (_a = this.params.resourceFiles) !== null && _a !== void 0 ? _a : [];
|
|
52245
|
+
if (files.length === 0 || files.length > PROTOCOL_V2_RESOURCE_FILE_MAX_COUNT) {
|
|
52246
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, 'Protocol V2 legacy resource file count is invalid');
|
|
52247
|
+
}
|
|
52248
|
+
const paths = new Set();
|
|
52249
|
+
let totalSize = 0;
|
|
52250
|
+
return files.map((file, index) => {
|
|
52251
|
+
var _a;
|
|
52252
|
+
const devicePath = validateProtocolV2FilesystemPath(file.devicePath, `resourceFiles[${index}].devicePath`);
|
|
52253
|
+
if (paths.has(devicePath)) {
|
|
52254
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, `Protocol V2 resourceFiles contain duplicate devicePath: ${devicePath}`);
|
|
52255
|
+
}
|
|
52256
|
+
paths.add(devicePath);
|
|
52257
|
+
totalSize += file.binary.byteLength;
|
|
52258
|
+
if (file.binary.byteLength <= 0 ||
|
|
52259
|
+
totalSize > PROTOCOL_V2_RESOURCE_TOTAL_MAX_BYTES ||
|
|
52260
|
+
(file.size !== undefined && file.size !== file.binary.byteLength)) {
|
|
52261
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, `Protocol V2 resourceFiles[${index}] size is invalid`);
|
|
52262
|
+
}
|
|
52263
|
+
if (file.fileHash &&
|
|
52264
|
+
bytesToHex(sha256.sha256(new Uint8Array(file.binary))) !== file.fileHash.toLowerCase()) {
|
|
52265
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, `Protocol V2 resourceFiles[${index}] SHA-256 mismatch`);
|
|
52266
|
+
}
|
|
52267
|
+
return {
|
|
52268
|
+
name: (_a = devicePath.split('/').pop()) !== null && _a !== void 0 ? _a : devicePath,
|
|
52269
|
+
binary: file.binary,
|
|
52270
|
+
devicePath,
|
|
52271
|
+
};
|
|
52272
|
+
});
|
|
52273
|
+
}
|
|
52172
52274
|
prepareProtocolV2ResourceArchiveSources() {
|
|
52173
52275
|
var _a, _b, _c, _d;
|
|
52174
52276
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -52245,7 +52347,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52245
52347
|
try {
|
|
52246
52348
|
this.postTipMessage(exports.FirmwareUpdateTipMessage.StartDownloadFirmware);
|
|
52247
52349
|
const installSources = yield this.prepareProtocolV2InstallSources(firmwareType, features);
|
|
52248
|
-
const resourceSources = yield this.prepareProtocolV2ResourceSources();
|
|
52350
|
+
const resourceSources = yield this.prepareProtocolV2ResourceSources(firmwareType, features);
|
|
52249
52351
|
if (installSources.length === 0 && resourceSources.length === 0) {
|
|
52250
52352
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FirmwareUpdateDownloadFailed, 'No firmware to update');
|
|
52251
52353
|
}
|
|
@@ -52374,8 +52476,16 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52374
52476
|
const serialNumber = (_b = (_a = deviceInfo.hw) === null || _a === void 0 ? void 0 : _a.serial_no) === null || _b === void 0 ? void 0 : _b.trim();
|
|
52375
52477
|
return serialNumber || undefined;
|
|
52376
52478
|
}
|
|
52479
|
+
getProtocolV2ConnectionRoute() {
|
|
52480
|
+
var _a, _b, _c, _d, _e;
|
|
52481
|
+
const descriptor = this.device.originalDescriptor;
|
|
52482
|
+
return (((_a = descriptor === null || descriptor === void 0 ? void 0 : descriptor.path) === null || _a === void 0 ? void 0 : _a.trim()) ||
|
|
52483
|
+
((_d = (_c = (_b = this.device).getConnectId) === null || _c === void 0 ? void 0 : _c.call(_b)) === null || _d === void 0 ? void 0 : _d.trim()) ||
|
|
52484
|
+
((_e = descriptor === null || descriptor === void 0 ? void 0 : descriptor.id) === null || _e === void 0 ? void 0 : _e.trim()) ||
|
|
52485
|
+
undefined);
|
|
52486
|
+
}
|
|
52377
52487
|
assertProtocolV2DeviceInfoIdentity(deviceInfo) {
|
|
52378
|
-
assertProtocolV2ReconnectIdentity(this.protocolV2ExpectedSerialNumber, this.getProtocolV2SerialNumber(deviceInfo), this.protocolV2ExpectedPath, this.
|
|
52488
|
+
assertProtocolV2ReconnectIdentity(this.protocolV2ExpectedSerialNumber, this.getProtocolV2SerialNumber(deviceInfo), this.protocolV2ExpectedPath, this.getProtocolV2ConnectionRoute());
|
|
52379
52489
|
}
|
|
52380
52490
|
getProtocolV2DeviceInfoTimeout() {
|
|
52381
52491
|
var _a;
|
|
@@ -52392,19 +52502,19 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52392
52502
|
});
|
|
52393
52503
|
}
|
|
52394
52504
|
captureProtocolV2PhysicalIdentity() {
|
|
52395
|
-
var _a, _b, _c
|
|
52505
|
+
var _a, _b, _c;
|
|
52396
52506
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52397
52507
|
const deviceInfo = yield this.requestProtocolV2PhysicalIdentity();
|
|
52398
52508
|
const serialNumber = this.getProtocolV2SerialNumber(deviceInfo);
|
|
52399
|
-
const path =
|
|
52400
|
-
if ((
|
|
52509
|
+
const path = this.getProtocolV2ConnectionRoute();
|
|
52510
|
+
if ((_a = this.params) === null || _a === void 0 ? void 0 : _a.preparedPlan) {
|
|
52401
52511
|
assertFirmwareUpdatePreparedPlanDeviceIdentity({
|
|
52402
52512
|
preparedPlan: this.params.preparedPlan,
|
|
52403
52513
|
deviceIdentity: serialNumber,
|
|
52404
52514
|
});
|
|
52405
52515
|
}
|
|
52406
|
-
else if ((
|
|
52407
|
-
assertProtocolV2ReconnectIdentity((
|
|
52516
|
+
else if ((_b = this.params) === null || _b === void 0 ? void 0 : _b.expectedDeviceId) {
|
|
52517
|
+
assertProtocolV2ReconnectIdentity((_c = this.params) === null || _c === void 0 ? void 0 : _c.expectedDeviceId, serialNumber);
|
|
52408
52518
|
}
|
|
52409
52519
|
else {
|
|
52410
52520
|
assertProtocolV2ReconnectIdentity(serialNumber, serialNumber, path, path);
|
|
@@ -114,9 +114,19 @@ export interface FirmwareUpdateV4Params {
|
|
|
114
114
|
se03Binary?: ArrayBuffer;
|
|
115
115
|
se04Binary?: ArrayBuffer;
|
|
116
116
|
resourceArchiveBinary?: ArrayBuffer;
|
|
117
|
+
resourceFiles?: Array<{
|
|
118
|
+
binary: ArrayBuffer;
|
|
119
|
+
devicePath: string;
|
|
120
|
+
size?: number;
|
|
121
|
+
fileHash?: string;
|
|
122
|
+
}>;
|
|
117
123
|
forcedUpdateRes?: boolean;
|
|
118
124
|
artifactReader?: FirmwareArtifactReader;
|
|
119
125
|
componentArtifacts?: Partial<Record<Exclude<FirmwareUpdateV4Target, 'resource' | 'boot_resources'>, FirmwareArtifactReference>>;
|
|
126
|
+
resourceBundleArtifacts?: Array<{
|
|
127
|
+
name: string;
|
|
128
|
+
artifact: FirmwareArtifactReference;
|
|
129
|
+
}>;
|
|
120
130
|
}
|
|
121
131
|
export declare function registerFirmwareUpdateHostBinding(binding: FirmwareUpdateHostBinding): number;
|
|
122
132
|
export declare function unregisterFirmwareUpdateHostBinding(generation?: number): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firmwareUpdate.d.ts","sourceRoot":"","sources":["../../../src/types/api/firmwareUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE/E,KAAK,WAAW,GAAG,UAAU,GAAG,KAAK,CAAC;AAEtC,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAC5C,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;IACH,IAAI,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QACzE,IAAI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AM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC,CAAC"}
|
package/dist/types/settings.d.ts
CHANGED
|
@@ -43,6 +43,16 @@ export type IProtocolV2ResourceSource = {
|
|
|
43
43
|
export type IProtocolV2Resources = {
|
|
44
44
|
source: IProtocolV2ResourceSource;
|
|
45
45
|
};
|
|
46
|
+
export type IProtocolV2ResourceBundle = {
|
|
47
|
+
name: string;
|
|
48
|
+
url: string;
|
|
49
|
+
fingerprint?: string;
|
|
50
|
+
expectedSize?: number;
|
|
51
|
+
devicePath: string;
|
|
52
|
+
version?: IVersionArray;
|
|
53
|
+
payloadHash?: string;
|
|
54
|
+
headerHash?: string;
|
|
55
|
+
};
|
|
46
56
|
export type IProtocolV2ResourceManifestFile = {
|
|
47
57
|
archive_path: string;
|
|
48
58
|
original_name: string;
|
|
@@ -91,6 +101,7 @@ export type IFirmwareReleaseInfo = {
|
|
|
91
101
|
upgradeType?: 'payload-package-set' | string;
|
|
92
102
|
components?: Record<string, IProtocolV2FirmwareComponent>;
|
|
93
103
|
installOrder?: string[];
|
|
104
|
+
resourceBundles?: IProtocolV2ResourceBundle[];
|
|
94
105
|
bootloaderChangelog?: {
|
|
95
106
|
[k in ILocale]: string;
|
|
96
107
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/types/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,KAAK,GACL,cAAc,GACd,UAAU,GACV,cAAc,GACd,QAAQ,GACR,gBAAgB,GAChB,iBAAiB,GACjB,UAAU,GACV,UAAU,GACV,UAAU,CAAC;AACf,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,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AAG;IACjC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;CAC7B,GAAG,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.92",
|
|
4
4
|
"description": "Core processes and APIs for communicating with OneKey hardware devices.",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@onekeyfe/hd-shared": "1.2.0-alpha.
|
|
29
|
-
"@onekeyfe/hd-transport": "1.2.0-alpha.
|
|
28
|
+
"@onekeyfe/hd-shared": "1.2.0-alpha.92",
|
|
29
|
+
"@onekeyfe/hd-transport": "1.2.0-alpha.92",
|
|
30
30
|
"axios": "1.15.2",
|
|
31
31
|
"bignumber.js": "^9.0.2",
|
|
32
32
|
"bytebuffer": "^5.0.1",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"@types/w3c-web-usb": "^1.0.10",
|
|
45
45
|
"@types/web-bluetooth": "^0.0.21"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "451cf48c34c896033474163f7eaf2b4bf1a0ec55"
|
|
48
48
|
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import { sha256 } from '@noble/hashes/sha256';
|
|
11
11
|
|
|
12
12
|
import { FirmwareUpdateTipMessage, UI_REQUEST } from '../events/ui-request';
|
|
13
|
+
import { validateProtocolV2FilesystemPath } from './helpers/filesystemValidation';
|
|
13
14
|
import { validateParams } from './helpers/paramsValidator';
|
|
14
15
|
import {
|
|
15
16
|
LoggerNames,
|
|
@@ -625,12 +626,6 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
625
626
|
'Protocol V2 expected device identity is invalid'
|
|
626
627
|
);
|
|
627
628
|
}
|
|
628
|
-
if (payload.resourceFiles?.length || payload.resourceBundleArtifacts?.length) {
|
|
629
|
-
throw ERRORS.TypedError(
|
|
630
|
-
HardwareErrorCode.CallMethodInvalidParameter,
|
|
631
|
-
'Protocol V2 resourceFiles and resourceBundleArtifacts are deprecated; provide a complete signed resource ZIP through resourceArchiveBinary or preparedPlan'
|
|
632
|
-
);
|
|
633
|
-
}
|
|
634
629
|
const preparedPlan = payload.preparedPlan
|
|
635
630
|
? validateFirmwareUpdatePreparedPlan(payload.preparedPlan)
|
|
636
631
|
: undefined;
|
|
@@ -645,11 +640,12 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
645
640
|
payload.se03Binary,
|
|
646
641
|
payload.se04Binary,
|
|
647
642
|
payload.resourceArchiveBinary,
|
|
643
|
+
payload.resourceFiles?.length,
|
|
648
644
|
].some(Boolean);
|
|
649
|
-
if (preparedPlan && hasLocalArtifacts) {
|
|
645
|
+
if (preparedPlan && (hasLocalArtifacts || payload.resourceBundleArtifacts?.length)) {
|
|
650
646
|
throw ERRORS.TypedError(
|
|
651
647
|
HardwareErrorCode.CallMethodInvalidParameter,
|
|
652
|
-
'Prepared firmware plans cannot be combined with local firmware
|
|
648
|
+
'Prepared firmware plans cannot be combined with legacy or local firmware inputs'
|
|
653
649
|
);
|
|
654
650
|
}
|
|
655
651
|
const hostBinding =
|
|
@@ -710,7 +706,9 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
710
706
|
target === 'boot_resources' ? 'resource' : target
|
|
711
707
|
);
|
|
712
708
|
if (
|
|
713
|
-
payload.resourceArchiveBinary
|
|
709
|
+
(payload.resourceArchiveBinary ||
|
|
710
|
+
payload.resourceFiles?.length ||
|
|
711
|
+
payload.resourceBundleArtifacts?.length) &&
|
|
714
712
|
localTargetsToUpdate &&
|
|
715
713
|
!localTargetsToUpdate.includes('resource')
|
|
716
714
|
) {
|
|
@@ -718,7 +716,12 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
718
716
|
}
|
|
719
717
|
// 本地 ZIP 本身就是明确的资源升级请求,不要求调用方重复声明 target。
|
|
720
718
|
const resolvedLocalTargetsToUpdate =
|
|
721
|
-
localTargetsToUpdate ??
|
|
719
|
+
localTargetsToUpdate ??
|
|
720
|
+
(payload.resourceArchiveBinary ||
|
|
721
|
+
payload.resourceFiles?.length ||
|
|
722
|
+
payload.resourceBundleArtifacts?.length
|
|
723
|
+
? ['resource']
|
|
724
|
+
: undefined);
|
|
722
725
|
|
|
723
726
|
this.params = {
|
|
724
727
|
preparedPlan,
|
|
@@ -734,6 +737,7 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
734
737
|
se03Binary: payload.se03Binary,
|
|
735
738
|
se04Binary: payload.se04Binary,
|
|
736
739
|
resourceArchiveBinary: payload.resourceArchiveBinary,
|
|
740
|
+
resourceFiles: payload.resourceFiles,
|
|
737
741
|
firmwareType: preparedPlan?.firmwareType ?? payload.firmwareType,
|
|
738
742
|
targetsToUpdate: preparedPlan
|
|
739
743
|
? ([...preparedPlan.targetsToUpdate] as FirmwareUpdateV4Target[])
|
|
@@ -745,6 +749,7 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
745
749
|
expectedDeviceId: payload.expectedDeviceId,
|
|
746
750
|
artifactReader: hostBinding?.artifactReader ?? payload.artifactReader,
|
|
747
751
|
componentArtifacts: preparedPlan ? undefined : payload.componentArtifacts,
|
|
752
|
+
resourceBundleArtifacts: preparedPlan ? undefined : payload.resourceBundleArtifacts,
|
|
748
753
|
};
|
|
749
754
|
}
|
|
750
755
|
|
|
@@ -790,6 +795,34 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
790
795
|
const firmwareType = this.params.firmwareType ?? deviceFirmwareType;
|
|
791
796
|
this.validateExpectedTargetVersions();
|
|
792
797
|
|
|
798
|
+
if (!this.params.preparedPlan && this.params.resourceFiles?.length) {
|
|
799
|
+
if (this.params.resourceArchiveBinary || this.params.resourceBundleArtifacts?.length) {
|
|
800
|
+
throw ERRORS.TypedError(
|
|
801
|
+
HardwareErrorCode.CallMethodInvalidParameter,
|
|
802
|
+
'Legacy resourceFiles cannot be combined with another Protocol V2 resource input'
|
|
803
|
+
);
|
|
804
|
+
}
|
|
805
|
+
this.postTipMessage(FirmwareUpdateTipMessage.StartDownloadFirmware);
|
|
806
|
+
const installItems = this.buildProtocolV2InstallItems({
|
|
807
|
+
bootloaderBinary: this.prepareBootloaderBinary(),
|
|
808
|
+
fwBinaryMap: this.collectExplicitTargetBinaries(),
|
|
809
|
+
});
|
|
810
|
+
const missingFirmwareTarget = this.getMissingProtocolV2FirmwareTargets(installItems)[0];
|
|
811
|
+
if (missingFirmwareTarget) {
|
|
812
|
+
throw ERRORS.TypedError(
|
|
813
|
+
HardwareErrorCode.RuntimeError,
|
|
814
|
+
`Protocol V2 legacy local update has no binary for requested target ${missingFirmwareTarget}`,
|
|
815
|
+
{
|
|
816
|
+
firmwareUpdateCode: 'FirmwareArtifactsNotPrepared',
|
|
817
|
+
artifactName: missingFirmwareTarget,
|
|
818
|
+
}
|
|
819
|
+
);
|
|
820
|
+
}
|
|
821
|
+
const resourceBundles = this.prepareLegacyProtocolV2ResourceFiles();
|
|
822
|
+
this.postTipMessage(FirmwareUpdateTipMessage.FinishDownloadFirmware);
|
|
823
|
+
return this.executeProtocolV2Update({ installItems, resourceBundles });
|
|
824
|
+
}
|
|
825
|
+
|
|
793
826
|
if (
|
|
794
827
|
!this.params.preparedPlan &&
|
|
795
828
|
this.params.resourceArchiveBinary &&
|
|
@@ -809,7 +842,11 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
809
842
|
const hasPreparedComponentArtifacts = Object.values(this.params.componentArtifacts ?? {}).some(
|
|
810
843
|
Boolean
|
|
811
844
|
);
|
|
812
|
-
if (
|
|
845
|
+
if (
|
|
846
|
+
this.params.preparedPlan ||
|
|
847
|
+
hasPreparedComponentArtifacts ||
|
|
848
|
+
this.params.resourceBundleArtifacts?.length
|
|
849
|
+
) {
|
|
813
850
|
return this.runProtocolV2PreparedArtifacts(deviceFeatures, firmwareType);
|
|
814
851
|
}
|
|
815
852
|
const wantsResources = !!this.params.targetsToUpdate?.includes('resource');
|
|
@@ -1295,7 +1332,10 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
1295
1332
|
return { binary, materializedEntries };
|
|
1296
1333
|
}
|
|
1297
1334
|
|
|
1298
|
-
private async prepareProtocolV2ResourceSources(
|
|
1335
|
+
private async prepareProtocolV2ResourceSources(
|
|
1336
|
+
firmwareType: EFirmwareType,
|
|
1337
|
+
features: Features
|
|
1338
|
+
): Promise<ProtocolV2ResourceBundleSource[]> {
|
|
1299
1339
|
const resourceRequested = this.params.targetsToUpdate?.includes('resource') ?? false;
|
|
1300
1340
|
if (!resourceRequested) {
|
|
1301
1341
|
return [];
|
|
@@ -1304,6 +1344,9 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
1304
1344
|
if (archiveSources) {
|
|
1305
1345
|
return archiveSources;
|
|
1306
1346
|
}
|
|
1347
|
+
if (!this.params.preparedPlan && this.params.resourceBundleArtifacts?.length) {
|
|
1348
|
+
return this.prepareLegacyProtocolV2ResourceBundleSources(firmwareType, features);
|
|
1349
|
+
}
|
|
1307
1350
|
throw ERRORS.TypedError(
|
|
1308
1351
|
HardwareErrorCode.RuntimeError,
|
|
1309
1352
|
'Protocol V2 resource archive is not prepared',
|
|
@@ -1311,6 +1354,117 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
1311
1354
|
);
|
|
1312
1355
|
}
|
|
1313
1356
|
|
|
1357
|
+
private async prepareLegacyProtocolV2ResourceBundleSources(
|
|
1358
|
+
firmwareType: EFirmwareType,
|
|
1359
|
+
features: Features
|
|
1360
|
+
): Promise<ProtocolV2ResourceBundleSource[]> {
|
|
1361
|
+
const artifacts = this.params.resourceBundleArtifacts ?? [];
|
|
1362
|
+
if (artifacts.length > PROTOCOL_V2_RESOURCE_FILE_MAX_COUNT) {
|
|
1363
|
+
throw ERRORS.TypedError(
|
|
1364
|
+
HardwareErrorCode.RuntimeError,
|
|
1365
|
+
'Protocol V2 legacy resource artifact count exceeds the allowed limit',
|
|
1366
|
+
{ firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' }
|
|
1367
|
+
);
|
|
1368
|
+
}
|
|
1369
|
+
const names = new Set<string>();
|
|
1370
|
+
const release = DataManager.getFirmwareLatestRelease(features, firmwareType);
|
|
1371
|
+
const descriptors = new Map(
|
|
1372
|
+
(release?.resourceBundles ?? []).map(descriptor => [descriptor.name, descriptor] as const)
|
|
1373
|
+
);
|
|
1374
|
+
const sources: ProtocolV2ResourceBundleSource[] = [];
|
|
1375
|
+
let totalSize = 0;
|
|
1376
|
+
for (const [index, item] of artifacts.entries()) {
|
|
1377
|
+
if (!item.name || names.has(item.name)) {
|
|
1378
|
+
throw ERRORS.TypedError(
|
|
1379
|
+
HardwareErrorCode.RuntimeError,
|
|
1380
|
+
`Protocol V2 legacy resource artifact name is invalid: ${item.name || index}`,
|
|
1381
|
+
{ firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' }
|
|
1382
|
+
);
|
|
1383
|
+
}
|
|
1384
|
+
names.add(item.name);
|
|
1385
|
+
const descriptor = descriptors.get(item.name);
|
|
1386
|
+
if (!descriptor) {
|
|
1387
|
+
throw ERRORS.TypedError(
|
|
1388
|
+
HardwareErrorCode.RuntimeError,
|
|
1389
|
+
`Protocol V2 release does not contain legacy resource bundle ${item.name}`,
|
|
1390
|
+
{ firmwareUpdateCode: 'FirmwareArtifactsNotPrepared', artifactName: item.name }
|
|
1391
|
+
);
|
|
1392
|
+
}
|
|
1393
|
+
const source = await this.openProtocolV2PreparedSource(item.artifact);
|
|
1394
|
+
totalSize += source.size;
|
|
1395
|
+
if (source.size <= 0 || totalSize > PROTOCOL_V2_RESOURCE_TOTAL_MAX_BYTES) {
|
|
1396
|
+
throw ERRORS.TypedError(
|
|
1397
|
+
HardwareErrorCode.RuntimeError,
|
|
1398
|
+
'Protocol V2 legacy resource artifacts exceed the allowed size limit',
|
|
1399
|
+
{ firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' }
|
|
1400
|
+
);
|
|
1401
|
+
}
|
|
1402
|
+
const devicePath = validateProtocolV2FilesystemPath(
|
|
1403
|
+
descriptor.devicePath,
|
|
1404
|
+
`resourceBundleArtifacts[${index}].devicePath`
|
|
1405
|
+
);
|
|
1406
|
+
sources.push({
|
|
1407
|
+
name: descriptor.name,
|
|
1408
|
+
source,
|
|
1409
|
+
devicePath,
|
|
1410
|
+
version: descriptor.version,
|
|
1411
|
+
payloadHash: descriptor.payloadHash,
|
|
1412
|
+
headerHash: descriptor.headerHash,
|
|
1413
|
+
});
|
|
1414
|
+
}
|
|
1415
|
+
return sources;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
private prepareLegacyProtocolV2ResourceFiles(): ProtocolV2ResourceBundleBinary[] {
|
|
1419
|
+
const files = this.params.resourceFiles ?? [];
|
|
1420
|
+
if (files.length === 0 || files.length > PROTOCOL_V2_RESOURCE_FILE_MAX_COUNT) {
|
|
1421
|
+
throw ERRORS.TypedError(
|
|
1422
|
+
HardwareErrorCode.CallMethodInvalidParameter,
|
|
1423
|
+
'Protocol V2 legacy resource file count is invalid'
|
|
1424
|
+
);
|
|
1425
|
+
}
|
|
1426
|
+
const paths = new Set<string>();
|
|
1427
|
+
let totalSize = 0;
|
|
1428
|
+
return files.map((file, index) => {
|
|
1429
|
+
const devicePath = validateProtocolV2FilesystemPath(
|
|
1430
|
+
file.devicePath,
|
|
1431
|
+
`resourceFiles[${index}].devicePath`
|
|
1432
|
+
);
|
|
1433
|
+
if (paths.has(devicePath)) {
|
|
1434
|
+
throw ERRORS.TypedError(
|
|
1435
|
+
HardwareErrorCode.CallMethodInvalidParameter,
|
|
1436
|
+
`Protocol V2 resourceFiles contain duplicate devicePath: ${devicePath}`
|
|
1437
|
+
);
|
|
1438
|
+
}
|
|
1439
|
+
paths.add(devicePath);
|
|
1440
|
+
totalSize += file.binary.byteLength;
|
|
1441
|
+
if (
|
|
1442
|
+
file.binary.byteLength <= 0 ||
|
|
1443
|
+
totalSize > PROTOCOL_V2_RESOURCE_TOTAL_MAX_BYTES ||
|
|
1444
|
+
(file.size !== undefined && file.size !== file.binary.byteLength)
|
|
1445
|
+
) {
|
|
1446
|
+
throw ERRORS.TypedError(
|
|
1447
|
+
HardwareErrorCode.CallMethodInvalidParameter,
|
|
1448
|
+
`Protocol V2 resourceFiles[${index}] size is invalid`
|
|
1449
|
+
);
|
|
1450
|
+
}
|
|
1451
|
+
if (
|
|
1452
|
+
file.fileHash &&
|
|
1453
|
+
bytesToHex(sha256(new Uint8Array(file.binary))) !== file.fileHash.toLowerCase()
|
|
1454
|
+
) {
|
|
1455
|
+
throw ERRORS.TypedError(
|
|
1456
|
+
HardwareErrorCode.CallMethodInvalidParameter,
|
|
1457
|
+
`Protocol V2 resourceFiles[${index}] SHA-256 mismatch`
|
|
1458
|
+
);
|
|
1459
|
+
}
|
|
1460
|
+
return {
|
|
1461
|
+
name: devicePath.split('/').pop() ?? devicePath,
|
|
1462
|
+
binary: file.binary,
|
|
1463
|
+
devicePath,
|
|
1464
|
+
};
|
|
1465
|
+
});
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1314
1468
|
private async prepareProtocolV2ResourceArchiveSources(): Promise<
|
|
1315
1469
|
ProtocolV2ResourceBundleSource[] | undefined
|
|
1316
1470
|
> {
|
|
@@ -1435,7 +1589,7 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
1435
1589
|
try {
|
|
1436
1590
|
this.postTipMessage(FirmwareUpdateTipMessage.StartDownloadFirmware);
|
|
1437
1591
|
const installSources = await this.prepareProtocolV2InstallSources(firmwareType, features);
|
|
1438
|
-
const resourceSources = await this.prepareProtocolV2ResourceSources();
|
|
1592
|
+
const resourceSources = await this.prepareProtocolV2ResourceSources(firmwareType, features);
|
|
1439
1593
|
if (installSources.length === 0 && resourceSources.length === 0) {
|
|
1440
1594
|
throw ERRORS.TypedError(
|
|
1441
1595
|
HardwareErrorCode.FirmwareUpdateDownloadFailed,
|
|
@@ -1585,12 +1739,22 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
1585
1739
|
return serialNumber || undefined;
|
|
1586
1740
|
}
|
|
1587
1741
|
|
|
1742
|
+
private getProtocolV2ConnectionRoute() {
|
|
1743
|
+
const descriptor = this.device.originalDescriptor;
|
|
1744
|
+
return (
|
|
1745
|
+
descriptor?.path?.trim() ||
|
|
1746
|
+
this.device.getConnectId?.()?.trim() ||
|
|
1747
|
+
descriptor?.id?.trim() ||
|
|
1748
|
+
undefined
|
|
1749
|
+
);
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1588
1752
|
private assertProtocolV2DeviceInfoIdentity(deviceInfo: ProtocolV2DeviceInfo) {
|
|
1589
1753
|
assertProtocolV2ReconnectIdentity(
|
|
1590
1754
|
this.protocolV2ExpectedSerialNumber,
|
|
1591
1755
|
this.getProtocolV2SerialNumber(deviceInfo),
|
|
1592
1756
|
this.protocolV2ExpectedPath,
|
|
1593
|
-
this.
|
|
1757
|
+
this.getProtocolV2ConnectionRoute()
|
|
1594
1758
|
);
|
|
1595
1759
|
}
|
|
1596
1760
|
|
|
@@ -1610,7 +1774,7 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
1610
1774
|
private async captureProtocolV2PhysicalIdentity() {
|
|
1611
1775
|
const deviceInfo = await this.requestProtocolV2PhysicalIdentity();
|
|
1612
1776
|
const serialNumber = this.getProtocolV2SerialNumber(deviceInfo);
|
|
1613
|
-
const path = this.
|
|
1777
|
+
const path = this.getProtocolV2ConnectionRoute();
|
|
1614
1778
|
if (this.params?.preparedPlan) {
|
|
1615
1779
|
assertFirmwareUpdatePreparedPlanDeviceIdentity({
|
|
1616
1780
|
preparedPlan: this.params.preparedPlan,
|
|
@@ -158,6 +158,13 @@ export interface FirmwareUpdateV4Params {
|
|
|
158
158
|
se04Binary?: ArrayBuffer;
|
|
159
159
|
/** Complete Protocol V2 resource ZIP for local development; Core converts it to a local PreparedPlan. */
|
|
160
160
|
resourceArchiveBinary?: ArrayBuffer;
|
|
161
|
+
/** @deprecated Package the complete signed resource set as a ZIP and use resourceArchiveBinary. */
|
|
162
|
+
resourceFiles?: Array<{
|
|
163
|
+
binary: ArrayBuffer;
|
|
164
|
+
devicePath: string;
|
|
165
|
+
size?: number;
|
|
166
|
+
fileHash?: string;
|
|
167
|
+
}>;
|
|
161
168
|
forcedUpdateRes?: boolean;
|
|
162
169
|
artifactReader?: FirmwareArtifactReader;
|
|
163
170
|
componentArtifacts?: Partial<
|
|
@@ -166,6 +173,11 @@ export interface FirmwareUpdateV4Params {
|
|
|
166
173
|
FirmwareArtifactReference
|
|
167
174
|
>
|
|
168
175
|
>;
|
|
176
|
+
/** @deprecated Use a ZIP artifact in preparedPlan instead. */
|
|
177
|
+
resourceBundleArtifacts?: Array<{
|
|
178
|
+
name: string;
|
|
179
|
+
artifact: FirmwareArtifactReference;
|
|
180
|
+
}>;
|
|
169
181
|
}
|
|
170
182
|
|
|
171
183
|
export declare function registerFirmwareUpdateHostBinding(
|
package/src/types/settings.ts
CHANGED
|
@@ -74,6 +74,18 @@ export type IProtocolV2Resources = {
|
|
|
74
74
|
source: IProtocolV2ResourceSource;
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
+
/** @deprecated Legacy per-bundle resource descriptor retained for published V4 callers. */
|
|
78
|
+
export type IProtocolV2ResourceBundle = {
|
|
79
|
+
name: string;
|
|
80
|
+
url: string;
|
|
81
|
+
fingerprint?: string;
|
|
82
|
+
expectedSize?: number;
|
|
83
|
+
devicePath: string;
|
|
84
|
+
version?: IVersionArray;
|
|
85
|
+
payloadHash?: string;
|
|
86
|
+
headerHash?: string;
|
|
87
|
+
};
|
|
88
|
+
|
|
77
89
|
export type IProtocolV2ResourceManifestFile = {
|
|
78
90
|
archive_path: string;
|
|
79
91
|
original_name: string;
|
|
@@ -131,6 +143,8 @@ export type IFirmwareReleaseInfo = {
|
|
|
131
143
|
upgradeType?: 'payload-package-set' | string;
|
|
132
144
|
components?: Record<string, IProtocolV2FirmwareComponent>;
|
|
133
145
|
installOrder?: string[];
|
|
146
|
+
/** @deprecated New Protocol V2 releases use the independent signed resource ZIP. */
|
|
147
|
+
resourceBundles?: IProtocolV2ResourceBundle[];
|
|
134
148
|
bootloaderChangelog?: {
|
|
135
149
|
[k in ILocale]: string;
|
|
136
150
|
};
|