@onekeyfe/hd-core 1.2.0-alpha.92 → 1.2.0-alpha.93
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 +0 -82
- package/dist/api/FirmwareUpdateV4.d.ts +0 -2
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/api/firmware/getBinary.d.ts +0 -1
- package/dist/api/firmware/getBinary.d.ts.map +1 -1
- package/dist/index.d.ts +1 -26
- package/dist/index.js +19 -129
- package/dist/types/api/firmwareUpdate.d.ts +0 -10
- package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
- package/dist/types/settings.d.ts +0 -11
- package/dist/types/settings.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/FirmwareUpdateV4.ts +7 -185
- package/src/types/api/firmwareUpdate.ts +0 -12
- package/src/types/settings.ts +0 -14
|
@@ -6783,88 +6783,6 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
6783
6783
|
expect((method as any).params.targetsToUpdate).toEqual(['resource']);
|
|
6784
6784
|
});
|
|
6785
6785
|
|
|
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))),
|
|
6799
|
-
},
|
|
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
|
-
};
|
|
6821
|
-
const method = new FirmwareUpdateV4({
|
|
6822
|
-
id: 1,
|
|
6823
|
-
payload: {
|
|
6824
|
-
method: 'firmwareUpdateV4',
|
|
6825
|
-
platform: 'web',
|
|
6826
|
-
resourceBundleArtifacts: [
|
|
6827
|
-
{
|
|
6828
|
-
name: 'images',
|
|
6829
|
-
artifact,
|
|
6830
|
-
},
|
|
6831
|
-
],
|
|
6832
|
-
},
|
|
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);
|
|
6848
|
-
|
|
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
|
-
}
|
|
6866
|
-
});
|
|
6867
|
-
|
|
6868
6786
|
test('keeps the legacy componentArtifacts and artifactReader path without a prepared Plan', async () => {
|
|
6869
6787
|
const artifactReader = {
|
|
6870
6788
|
open: jest.fn(),
|
|
@@ -28,8 +28,6 @@ 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;
|
|
33
31
|
private prepareProtocolV2ResourceArchiveSources;
|
|
34
32
|
private runProtocolV2PreparedArtifacts;
|
|
35
33
|
private validateExpectedTargetVersions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirmwareUpdateV4.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkD,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"FirmwareUpdateV4.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkD,MAAM,qBAAqB,CAAC;AAyBlG,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAkC/E,OA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OAAO,CAAC,mCAAmC;IAe3C,OAAO,CAAC,2BAA2B;IAsBnC,OAAO,CAAC,yBAAyB;IAiBjC,OAAO,CAAC,wBAAwB;YAkBlB,iCAAiC;YAuDjC,+BAA+B;IA6E7C,OAAO,CAAC,6BAA6B;YAMvB,8BAA8B;YA+C9B,kCAAkC;IA+BhD,OAAO,CAAC,0BAA0B;IAUlC,OAAO,CAAC,yBAAyB;IAc3B,6BAA6B;YAgCrB,+BAA+B;IAkD7C,OAAO,CAAC,6BAA6B;IAkCrC,OAAO,CAAC,8BAA8B;YA8CxB,uBAAuB;YAiCvB,6BAA6B;YAa7B,uBAAuB;YAiCvB,8BAA8B;YA8D9B,6BAA6B;IAuE3C,OAAO,CAAC,mCAAmC;YAI7B,0BAA0B;IAaxC,OAAO,CAAC,4BAA4B;IAyGpC,OAAO,CAAC,6BAA6B;YAcvB,uCAAuC;YA0JvC,gCAAgC;YAehC,yBAAyB;YAQzB,8BAA8B;IAQ5C,OAAO,CAAC,0BAA0B;YAkBpB,mCAAmC;YAWnC,qCAAqC;YAgDrC,yBAAyB;YA8DzB,8BAA8B;IAU5C,OAAO,CAAC,kCAAkC;YAQ5B,cAAc;YAuCd,6BAA6B;YAW7B,0BAA0B;YAS1B,6BAA6B;YAmB7B,gBAAgB;IAiB9B,OAAO,CAAC,qBAAqB;CAM9B"}
|
|
@@ -35,7 +35,6 @@ export declare const getBinary: ({ features, updateType, version, isUpdateBootlo
|
|
|
35
35
|
upgradeType?: string | undefined;
|
|
36
36
|
components?: Record<string, import("../../types").IProtocolV2FirmwareComponent> | undefined;
|
|
37
37
|
installOrder?: string[] | undefined;
|
|
38
|
-
resourceBundles?: import("../../types").IProtocolV2ResourceBundle[] | undefined;
|
|
39
38
|
bootloaderChangelog?: {
|
|
40
39
|
"zh-CN": string;
|
|
41
40
|
"en-US": string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBinary.d.ts","sourceRoot":"","sources":["../../../src/api/firmware/getBinary.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AAC,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,17 +219,6 @@ 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
|
-
};
|
|
233
222
|
type IProtocolV2ResourceManifestFile = {
|
|
234
223
|
archive_path: string;
|
|
235
224
|
original_name: string;
|
|
@@ -285,8 +274,6 @@ type IFirmwareReleaseInfo = {
|
|
|
285
274
|
upgradeType?: 'payload-package-set' | string;
|
|
286
275
|
components?: Record<string, IProtocolV2FirmwareComponent>;
|
|
287
276
|
installOrder?: string[];
|
|
288
|
-
/** @deprecated New Protocol V2 releases use the independent signed resource ZIP. */
|
|
289
|
-
resourceBundles?: IProtocolV2ResourceBundle[];
|
|
290
277
|
bootloaderChangelog?: {
|
|
291
278
|
[k in ILocale]: string;
|
|
292
279
|
};
|
|
@@ -1450,21 +1437,9 @@ interface FirmwareUpdateV4Params {
|
|
|
1450
1437
|
se04Binary?: ArrayBuffer;
|
|
1451
1438
|
/** Complete Protocol V2 resource ZIP for local development; Core converts it to a local PreparedPlan. */
|
|
1452
1439
|
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
|
-
}>;
|
|
1460
1440
|
forcedUpdateRes?: boolean;
|
|
1461
1441
|
artifactReader?: FirmwareArtifactReader;
|
|
1462
1442
|
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
|
-
}>;
|
|
1468
1443
|
}
|
|
1469
1444
|
declare function registerFirmwareUpdateHostBinding$1(binding: FirmwareUpdateHostBinding): number;
|
|
1470
1445
|
declare function unregisterFirmwareUpdateHostBinding$1(generation?: number): boolean;
|
|
@@ -4928,4 +4903,4 @@ declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, can
|
|
|
4928
4903
|
declare const HardwareSDKLowLevel: ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel, updateSettings, switchTransport, }: LowLevelInjectApi) => LowLevelCoreApi;
|
|
4929
4904
|
declare const HardwareTopLevelSdk: () => CoreApi;
|
|
4930
4905
|
|
|
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 };
|
|
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 };
|
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
|
|
51640
|
+
var _a, _b, _c;
|
|
51641
51641
|
this.allowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.NOT_INITIALIZE];
|
|
51642
51642
|
this.requireDeviceMode = [];
|
|
51643
51643
|
this.unlockPolicy = 'unlock-before-run';
|
|
@@ -51669,8 +51669,6 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51669
51669
|
{ name: 'se03Binary', type: 'buffer' },
|
|
51670
51670
|
{ name: 'se04Binary', type: 'buffer' },
|
|
51671
51671
|
{ name: 'resourceArchiveBinary', type: 'buffer' },
|
|
51672
|
-
{ name: 'resourceFiles', type: 'array', allowEmpty: true },
|
|
51673
|
-
{ name: 'resourceBundleArtifacts', type: 'array', allowEmpty: true },
|
|
51674
51672
|
{ name: 'firmwareType', type: 'string' },
|
|
51675
51673
|
{ name: 'targetsToUpdate', type: 'array', allowEmpty: true },
|
|
51676
51674
|
{ name: 'platform', type: 'string' },
|
|
@@ -51694,9 +51692,8 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51694
51692
|
payload.se03Binary,
|
|
51695
51693
|
payload.se04Binary,
|
|
51696
51694
|
payload.resourceArchiveBinary,
|
|
51697
|
-
(_a = payload.resourceFiles) === null || _a === void 0 ? void 0 : _a.length,
|
|
51698
51695
|
].some(Boolean);
|
|
51699
|
-
if (preparedPlan &&
|
|
51696
|
+
if (preparedPlan && hasLocalArtifacts) {
|
|
51700
51697
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, 'Prepared firmware plans cannot be combined with legacy or local firmware inputs');
|
|
51701
51698
|
}
|
|
51702
51699
|
const hostBinding = payload.hostBindingGeneration !== undefined
|
|
@@ -51737,19 +51734,13 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51737
51734
|
}
|
|
51738
51735
|
return result;
|
|
51739
51736
|
}, {});
|
|
51740
|
-
const localTargetsToUpdate = (
|
|
51741
|
-
if (
|
|
51742
|
-
((_d = payload.resourceFiles) === null || _d === void 0 ? void 0 : _d.length) ||
|
|
51743
|
-
((_e = payload.resourceBundleArtifacts) === null || _e === void 0 ? void 0 : _e.length)) &&
|
|
51737
|
+
const localTargetsToUpdate = (_a = payload.targetsToUpdate) === null || _a === void 0 ? void 0 : _a.map((target) => target === 'boot_resources' ? 'resource' : target);
|
|
51738
|
+
if (payload.resourceArchiveBinary &&
|
|
51744
51739
|
localTargetsToUpdate &&
|
|
51745
51740
|
!localTargetsToUpdate.includes('resource')) {
|
|
51746
51741
|
localTargetsToUpdate.push('resource');
|
|
51747
51742
|
}
|
|
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);
|
|
51743
|
+
const resolvedLocalTargetsToUpdate = localTargetsToUpdate !== null && localTargetsToUpdate !== void 0 ? localTargetsToUpdate : (payload.resourceArchiveBinary ? ['resource'] : undefined);
|
|
51753
51744
|
this.params = {
|
|
51754
51745
|
preparedPlan,
|
|
51755
51746
|
chunkSize: payload.chunkSize,
|
|
@@ -51764,8 +51755,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51764
51755
|
se03Binary: payload.se03Binary,
|
|
51765
51756
|
se04Binary: payload.se04Binary,
|
|
51766
51757
|
resourceArchiveBinary: payload.resourceArchiveBinary,
|
|
51767
|
-
|
|
51768
|
-
firmwareType: (_h = preparedPlan === null || preparedPlan === void 0 ? void 0 : preparedPlan.firmwareType) !== null && _h !== void 0 ? _h : payload.firmwareType,
|
|
51758
|
+
firmwareType: (_b = preparedPlan === null || preparedPlan === void 0 ? void 0 : preparedPlan.firmwareType) !== null && _b !== void 0 ? _b : payload.firmwareType,
|
|
51769
51759
|
targetsToUpdate: preparedPlan
|
|
51770
51760
|
? [...preparedPlan.targetsToUpdate]
|
|
51771
51761
|
: resolvedLocalTargetsToUpdate,
|
|
@@ -51774,9 +51764,8 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51774
51764
|
: payload.expectedTargetVersions,
|
|
51775
51765
|
platform: payload.platform,
|
|
51776
51766
|
expectedDeviceId: payload.expectedDeviceId,
|
|
51777
|
-
artifactReader: (
|
|
51767
|
+
artifactReader: (_c = hostBinding === null || hostBinding === void 0 ? void 0 : hostBinding.artifactReader) !== null && _c !== void 0 ? _c : payload.artifactReader,
|
|
51778
51768
|
componentArtifacts: preparedPlan ? undefined : payload.componentArtifacts,
|
|
51779
|
-
resourceBundleArtifacts: preparedPlan ? undefined : payload.resourceBundleArtifacts,
|
|
51780
51769
|
};
|
|
51781
51770
|
}
|
|
51782
51771
|
getProtocolV2FirmwareChunkSize(direction, filePath) {
|
|
@@ -51807,7 +51796,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51807
51796
|
});
|
|
51808
51797
|
}
|
|
51809
51798
|
runProtocolV2() {
|
|
51810
|
-
var _a, _b, _c, _d, _e, _f
|
|
51799
|
+
var _a, _b, _c, _d, _e, _f;
|
|
51811
51800
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51812
51801
|
yield this.captureProtocolV2PhysicalIdentity();
|
|
51813
51802
|
const deviceFeatures = yield this.getProtocolV2DeviceFeatures();
|
|
@@ -51819,29 +51808,9 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51819
51808
|
const deviceFirmwareType = getFirmwareType(deviceFeatures);
|
|
51820
51809
|
const firmwareType = (_a = this.params.firmwareType) !== null && _a !== void 0 ? _a : deviceFirmwareType;
|
|
51821
51810
|
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
|
-
}
|
|
51842
51811
|
if (!this.params.preparedPlan &&
|
|
51843
51812
|
this.params.resourceArchiveBinary &&
|
|
51844
|
-
((
|
|
51813
|
+
((_b = this.params.targetsToUpdate) === null || _b === void 0 ? void 0 : _b.includes('resource'))) {
|
|
51845
51814
|
const localMemoryHost = yield this.prepareProtocolV2LocalMemoryHost({
|
|
51846
51815
|
features: deviceFeatures,
|
|
51847
51816
|
firmwareType,
|
|
@@ -51853,13 +51822,11 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51853
51822
|
localMemoryHost.release();
|
|
51854
51823
|
}
|
|
51855
51824
|
}
|
|
51856
|
-
const hasPreparedComponentArtifacts = Object.values((
|
|
51857
|
-
if (this.params.preparedPlan ||
|
|
51858
|
-
hasPreparedComponentArtifacts ||
|
|
51859
|
-
((_f = this.params.resourceBundleArtifacts) === null || _f === void 0 ? void 0 : _f.length)) {
|
|
51825
|
+
const hasPreparedComponentArtifacts = Object.values((_c = this.params.componentArtifacts) !== null && _c !== void 0 ? _c : {}).some(Boolean);
|
|
51826
|
+
if (this.params.preparedPlan || hasPreparedComponentArtifacts) {
|
|
51860
51827
|
return this.runProtocolV2PreparedArtifacts(deviceFeatures, firmwareType);
|
|
51861
51828
|
}
|
|
51862
|
-
const wantsResources = !!((
|
|
51829
|
+
const wantsResources = !!((_d = this.params.targetsToUpdate) === null || _d === void 0 ? void 0 : _d.includes('resource'));
|
|
51863
51830
|
let fwBinaryMap = [];
|
|
51864
51831
|
let bootloaderBinary = null;
|
|
51865
51832
|
let installItems;
|
|
@@ -51872,7 +51839,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51872
51839
|
fwBinaryMap,
|
|
51873
51840
|
});
|
|
51874
51841
|
const missingFirmwareTargets = this.getMissingProtocolV2FirmwareTargets(explicitInstallItems);
|
|
51875
|
-
const needsRemoteFirmware = ((
|
|
51842
|
+
const needsRemoteFirmware = ((_e = this.params.targetsToUpdate) === null || _e === void 0 ? void 0 : _e.length)
|
|
51876
51843
|
? missingFirmwareTargets.length > 0
|
|
51877
51844
|
: explicitInstallItems.length === 0;
|
|
51878
51845
|
if (wantsResources) {
|
|
@@ -51902,7 +51869,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51902
51869
|
if (typeof err === 'object' &&
|
|
51903
51870
|
err !== null &&
|
|
51904
51871
|
'params' in err &&
|
|
51905
|
-
((
|
|
51872
|
+
((_f = err.params) === null || _f === void 0 ? void 0 : _f.firmwareUpdateCode) === 'FirmwareArtifactsNotPrepared') {
|
|
51906
51873
|
throw err;
|
|
51907
51874
|
}
|
|
51908
51875
|
if (err instanceof hdShared.HardwareError && err.errorCode === hdShared.HardwareErrorCode.NetworkError) {
|
|
@@ -52183,8 +52150,8 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52183
52150
|
return { binary, materializedEntries };
|
|
52184
52151
|
});
|
|
52185
52152
|
}
|
|
52186
|
-
prepareProtocolV2ResourceSources(
|
|
52187
|
-
var _a, _b
|
|
52153
|
+
prepareProtocolV2ResourceSources() {
|
|
52154
|
+
var _a, _b;
|
|
52188
52155
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52189
52156
|
const resourceRequested = (_b = (_a = this.params.targetsToUpdate) === null || _a === void 0 ? void 0 : _a.includes('resource')) !== null && _b !== void 0 ? _b : false;
|
|
52190
52157
|
if (!resourceRequested) {
|
|
@@ -52194,83 +52161,9 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52194
52161
|
if (archiveSources) {
|
|
52195
52162
|
return archiveSources;
|
|
52196
52163
|
}
|
|
52197
|
-
if (!this.params.preparedPlan && ((_c = this.params.resourceBundleArtifacts) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
52198
|
-
return this.prepareLegacyProtocolV2ResourceBundleSources(firmwareType, features);
|
|
52199
|
-
}
|
|
52200
52164
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 resource archive is not prepared', { firmwareUpdateCode: 'FirmwareArtifactsNotPrepared' });
|
|
52201
52165
|
});
|
|
52202
52166
|
}
|
|
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
|
-
}
|
|
52274
52167
|
prepareProtocolV2ResourceArchiveSources() {
|
|
52275
52168
|
var _a, _b, _c, _d;
|
|
52276
52169
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -52347,7 +52240,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52347
52240
|
try {
|
|
52348
52241
|
this.postTipMessage(exports.FirmwareUpdateTipMessage.StartDownloadFirmware);
|
|
52349
52242
|
const installSources = yield this.prepareProtocolV2InstallSources(firmwareType, features);
|
|
52350
|
-
const resourceSources = yield this.prepareProtocolV2ResourceSources(
|
|
52243
|
+
const resourceSources = yield this.prepareProtocolV2ResourceSources();
|
|
52351
52244
|
if (installSources.length === 0 && resourceSources.length === 0) {
|
|
52352
52245
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FirmwareUpdateDownloadFailed, 'No firmware to update');
|
|
52353
52246
|
}
|
|
@@ -52929,7 +52822,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52929
52822
|
});
|
|
52930
52823
|
});
|
|
52931
52824
|
}
|
|
52932
|
-
executeProtocolV2Update({ fwBinaryMap, bootloaderBinary, installItems,
|
|
52825
|
+
executeProtocolV2Update({ fwBinaryMap, bootloaderBinary, installItems, }) {
|
|
52933
52826
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52934
52827
|
const memoryInstallItems = installItems !== null && installItems !== void 0 ? installItems : this.buildProtocolV2InstallItems({
|
|
52935
52828
|
fwBinaryMap: fwBinaryMap !== null && fwBinaryMap !== void 0 ? fwBinaryMap : [],
|
|
@@ -52944,12 +52837,9 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52944
52837
|
kind: item.kind,
|
|
52945
52838
|
});
|
|
52946
52839
|
})));
|
|
52947
|
-
const resourceSources = yield Promise.all(resourceBundles.map((resource) => __awaiter(this, void 0, void 0, function* () {
|
|
52948
|
-
return (Object.assign(Object.assign(Object.assign({ name: resource.name, source: yield this.openProtocolV2MemorySource(resource.binary), devicePath: resource.devicePath }, (resource.version ? { version: resource.version } : {})), (resource.payloadHash ? { payloadHash: resource.payloadHash } : {})), (resource.headerHash ? { headerHash: resource.headerHash } : {})));
|
|
52949
|
-
})));
|
|
52950
52840
|
return yield this.executeProtocolV2Phases({
|
|
52951
52841
|
installSources,
|
|
52952
|
-
resourceSources,
|
|
52842
|
+
resourceSources: [],
|
|
52953
52843
|
});
|
|
52954
52844
|
}
|
|
52955
52845
|
finally {
|
|
@@ -114,19 +114,9 @@ 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
|
-
}>;
|
|
123
117
|
forcedUpdateRes?: boolean;
|
|
124
118
|
artifactReader?: FirmwareArtifactReader;
|
|
125
119
|
componentArtifacts?: Partial<Record<Exclude<FirmwareUpdateV4Target, 'resource' | 'boot_resources'>, FirmwareArtifactReference>>;
|
|
126
|
-
resourceBundleArtifacts?: Array<{
|
|
127
|
-
name: string;
|
|
128
|
-
artifact: FirmwareArtifactReference;
|
|
129
|
-
}>;
|
|
130
120
|
}
|
|
131
121
|
export declare function registerFirmwareUpdateHostBinding(binding: FirmwareUpdateHostBinding): number;
|
|
132
122
|
export declare function unregisterFirmwareUpdateHostBinding(generation?: number): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firmwareUpdate.d.ts","sourceRoot":"","sources":["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AM,CAAC,OAAO,UAAU,sCAAsC,IAAI,MAAM,CAAC;AAEzE,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,CAAC,sBAAsB,CAAC,GACrC,QAAQ,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,CAAC,sBAAsB,CAAC,GACrC,QAAQ,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC,CAAC"}
|
package/dist/types/settings.d.ts
CHANGED
|
@@ -43,16 +43,6 @@ 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
|
-
};
|
|
56
46
|
export type IProtocolV2ResourceManifestFile = {
|
|
57
47
|
archive_path: string;
|
|
58
48
|
original_name: string;
|
|
@@ -101,7 +91,6 @@ export type IFirmwareReleaseInfo = {
|
|
|
101
91
|
upgradeType?: 'payload-package-set' | string;
|
|
102
92
|
components?: Record<string, IProtocolV2FirmwareComponent>;
|
|
103
93
|
installOrder?: string[];
|
|
104
|
-
resourceBundles?: IProtocolV2ResourceBundle[];
|
|
105
94
|
bootloaderChangelog?: {
|
|
106
95
|
[k in ILocale]: string;
|
|
107
96
|
};
|
|
@@ -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,CAAC,EAAE,OAAO,CAAC;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,GAAG,EAAE,YAAY,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oBAAoB,CAAC,EAAE,aAAa,GAAG,eAAe,CAAC;IACvD,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,GAAG,IAA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AG,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AACpD,KAAK,kBAAkB,GAAG;IACxB,QAAQ,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAElC,aAAa,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACvC,aAAa,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACvC,aAAa,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACvC,iBAAiB,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC3C,GAAG,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAEhC,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;KACzB,CAAC,IAAI,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,GAAG,kBAAkB;CACxD,GAAG;IAEF,GAAG,CAAC,EAAE,kBAAkB,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE;QACN,OAAO,EAAE,aAAa,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE;aACR,CAAC,IAAI,OAAO,GAAG,MAAM;SACvB,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;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.93",
|
|
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.93",
|
|
29
|
+
"@onekeyfe/hd-transport": "1.2.0-alpha.93",
|
|
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": "0cae321e989b47b8c05455b2d59755e5322f2bb1"
|
|
48
48
|
}
|
|
@@ -10,7 +10,6 @@ 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';
|
|
14
13
|
import { validateParams } from './helpers/paramsValidator';
|
|
15
14
|
import {
|
|
16
15
|
LoggerNames,
|
|
@@ -214,10 +213,6 @@ type ProtocolV2ResourceBundleSource = {
|
|
|
214
213
|
headerHash?: string;
|
|
215
214
|
};
|
|
216
215
|
|
|
217
|
-
type ProtocolV2ResourceBundleBinary = Omit<ProtocolV2ResourceBundleSource, 'source'> & {
|
|
218
|
-
binary: ArrayBuffer;
|
|
219
|
-
};
|
|
220
|
-
|
|
221
216
|
type ProtocolV2LocalResourceArchive = {
|
|
222
217
|
binary: ArrayBuffer;
|
|
223
218
|
materializedEntries: FirmwareMemoryArtifactEntry[];
|
|
@@ -610,8 +605,6 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
610
605
|
{ name: 'se03Binary', type: 'buffer' },
|
|
611
606
|
{ name: 'se04Binary', type: 'buffer' },
|
|
612
607
|
{ name: 'resourceArchiveBinary', type: 'buffer' },
|
|
613
|
-
{ name: 'resourceFiles', type: 'array', allowEmpty: true },
|
|
614
|
-
{ name: 'resourceBundleArtifacts', type: 'array', allowEmpty: true },
|
|
615
608
|
{ name: 'firmwareType', type: 'string' },
|
|
616
609
|
{ name: 'targetsToUpdate', type: 'array', allowEmpty: true },
|
|
617
610
|
{ name: 'platform', type: 'string' },
|
|
@@ -640,9 +633,8 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
640
633
|
payload.se03Binary,
|
|
641
634
|
payload.se04Binary,
|
|
642
635
|
payload.resourceArchiveBinary,
|
|
643
|
-
payload.resourceFiles?.length,
|
|
644
636
|
].some(Boolean);
|
|
645
|
-
if (preparedPlan &&
|
|
637
|
+
if (preparedPlan && hasLocalArtifacts) {
|
|
646
638
|
throw ERRORS.TypedError(
|
|
647
639
|
HardwareErrorCode.CallMethodInvalidParameter,
|
|
648
640
|
'Prepared firmware plans cannot be combined with legacy or local firmware inputs'
|
|
@@ -706,9 +698,7 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
706
698
|
target === 'boot_resources' ? 'resource' : target
|
|
707
699
|
);
|
|
708
700
|
if (
|
|
709
|
-
|
|
710
|
-
payload.resourceFiles?.length ||
|
|
711
|
-
payload.resourceBundleArtifacts?.length) &&
|
|
701
|
+
payload.resourceArchiveBinary &&
|
|
712
702
|
localTargetsToUpdate &&
|
|
713
703
|
!localTargetsToUpdate.includes('resource')
|
|
714
704
|
) {
|
|
@@ -716,12 +706,7 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
716
706
|
}
|
|
717
707
|
// 本地 ZIP 本身就是明确的资源升级请求,不要求调用方重复声明 target。
|
|
718
708
|
const resolvedLocalTargetsToUpdate =
|
|
719
|
-
localTargetsToUpdate ??
|
|
720
|
-
(payload.resourceArchiveBinary ||
|
|
721
|
-
payload.resourceFiles?.length ||
|
|
722
|
-
payload.resourceBundleArtifacts?.length
|
|
723
|
-
? ['resource']
|
|
724
|
-
: undefined);
|
|
709
|
+
localTargetsToUpdate ?? (payload.resourceArchiveBinary ? ['resource'] : undefined);
|
|
725
710
|
|
|
726
711
|
this.params = {
|
|
727
712
|
preparedPlan,
|
|
@@ -737,7 +722,6 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
737
722
|
se03Binary: payload.se03Binary,
|
|
738
723
|
se04Binary: payload.se04Binary,
|
|
739
724
|
resourceArchiveBinary: payload.resourceArchiveBinary,
|
|
740
|
-
resourceFiles: payload.resourceFiles,
|
|
741
725
|
firmwareType: preparedPlan?.firmwareType ?? payload.firmwareType,
|
|
742
726
|
targetsToUpdate: preparedPlan
|
|
743
727
|
? ([...preparedPlan.targetsToUpdate] as FirmwareUpdateV4Target[])
|
|
@@ -749,7 +733,6 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
749
733
|
expectedDeviceId: payload.expectedDeviceId,
|
|
750
734
|
artifactReader: hostBinding?.artifactReader ?? payload.artifactReader,
|
|
751
735
|
componentArtifacts: preparedPlan ? undefined : payload.componentArtifacts,
|
|
752
|
-
resourceBundleArtifacts: preparedPlan ? undefined : payload.resourceBundleArtifacts,
|
|
753
736
|
};
|
|
754
737
|
}
|
|
755
738
|
|
|
@@ -795,34 +778,6 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
795
778
|
const firmwareType = this.params.firmwareType ?? deviceFirmwareType;
|
|
796
779
|
this.validateExpectedTargetVersions();
|
|
797
780
|
|
|
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
|
-
|
|
826
781
|
if (
|
|
827
782
|
!this.params.preparedPlan &&
|
|
828
783
|
this.params.resourceArchiveBinary &&
|
|
@@ -842,11 +797,7 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
842
797
|
const hasPreparedComponentArtifacts = Object.values(this.params.componentArtifacts ?? {}).some(
|
|
843
798
|
Boolean
|
|
844
799
|
);
|
|
845
|
-
if (
|
|
846
|
-
this.params.preparedPlan ||
|
|
847
|
-
hasPreparedComponentArtifacts ||
|
|
848
|
-
this.params.resourceBundleArtifacts?.length
|
|
849
|
-
) {
|
|
800
|
+
if (this.params.preparedPlan || hasPreparedComponentArtifacts) {
|
|
850
801
|
return this.runProtocolV2PreparedArtifacts(deviceFeatures, firmwareType);
|
|
851
802
|
}
|
|
852
803
|
const wantsResources = !!this.params.targetsToUpdate?.includes('resource');
|
|
@@ -1332,10 +1283,7 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
1332
1283
|
return { binary, materializedEntries };
|
|
1333
1284
|
}
|
|
1334
1285
|
|
|
1335
|
-
private async prepareProtocolV2ResourceSources(
|
|
1336
|
-
firmwareType: EFirmwareType,
|
|
1337
|
-
features: Features
|
|
1338
|
-
): Promise<ProtocolV2ResourceBundleSource[]> {
|
|
1286
|
+
private async prepareProtocolV2ResourceSources(): Promise<ProtocolV2ResourceBundleSource[]> {
|
|
1339
1287
|
const resourceRequested = this.params.targetsToUpdate?.includes('resource') ?? false;
|
|
1340
1288
|
if (!resourceRequested) {
|
|
1341
1289
|
return [];
|
|
@@ -1344,9 +1292,6 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
1344
1292
|
if (archiveSources) {
|
|
1345
1293
|
return archiveSources;
|
|
1346
1294
|
}
|
|
1347
|
-
if (!this.params.preparedPlan && this.params.resourceBundleArtifacts?.length) {
|
|
1348
|
-
return this.prepareLegacyProtocolV2ResourceBundleSources(firmwareType, features);
|
|
1349
|
-
}
|
|
1350
1295
|
throw ERRORS.TypedError(
|
|
1351
1296
|
HardwareErrorCode.RuntimeError,
|
|
1352
1297
|
'Protocol V2 resource archive is not prepared',
|
|
@@ -1354,117 +1299,6 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
1354
1299
|
);
|
|
1355
1300
|
}
|
|
1356
1301
|
|
|
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
|
-
|
|
1468
1302
|
private async prepareProtocolV2ResourceArchiveSources(): Promise<
|
|
1469
1303
|
ProtocolV2ResourceBundleSource[] | undefined
|
|
1470
1304
|
> {
|
|
@@ -1589,7 +1423,7 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
1589
1423
|
try {
|
|
1590
1424
|
this.postTipMessage(FirmwareUpdateTipMessage.StartDownloadFirmware);
|
|
1591
1425
|
const installSources = await this.prepareProtocolV2InstallSources(firmwareType, features);
|
|
1592
|
-
const resourceSources = await this.prepareProtocolV2ResourceSources(
|
|
1426
|
+
const resourceSources = await this.prepareProtocolV2ResourceSources();
|
|
1593
1427
|
if (installSources.length === 0 && resourceSources.length === 0) {
|
|
1594
1428
|
throw ERRORS.TypedError(
|
|
1595
1429
|
HardwareErrorCode.FirmwareUpdateDownloadFailed,
|
|
@@ -2323,12 +2157,10 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
2323
2157
|
fwBinaryMap,
|
|
2324
2158
|
bootloaderBinary,
|
|
2325
2159
|
installItems,
|
|
2326
|
-
resourceBundles = [],
|
|
2327
2160
|
}: {
|
|
2328
2161
|
fwBinaryMap?: ProtocolV2TargetBinary[];
|
|
2329
2162
|
bootloaderBinary?: ArrayBuffer | null;
|
|
2330
2163
|
installItems?: ProtocolV2InstallItem[];
|
|
2331
|
-
resourceBundles?: ProtocolV2ResourceBundleBinary[];
|
|
2332
2164
|
}) {
|
|
2333
2165
|
const memoryInstallItems =
|
|
2334
2166
|
installItems ??
|
|
@@ -2345,19 +2177,9 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
2345
2177
|
kind: item.kind,
|
|
2346
2178
|
}))
|
|
2347
2179
|
);
|
|
2348
|
-
const resourceSources = await Promise.all(
|
|
2349
|
-
resourceBundles.map(async resource => ({
|
|
2350
|
-
name: resource.name,
|
|
2351
|
-
source: await this.openProtocolV2MemorySource(resource.binary),
|
|
2352
|
-
devicePath: resource.devicePath,
|
|
2353
|
-
...(resource.version ? { version: resource.version } : {}),
|
|
2354
|
-
...(resource.payloadHash ? { payloadHash: resource.payloadHash } : {}),
|
|
2355
|
-
...(resource.headerHash ? { headerHash: resource.headerHash } : {}),
|
|
2356
|
-
}))
|
|
2357
|
-
);
|
|
2358
2180
|
return await this.executeProtocolV2Phases({
|
|
2359
2181
|
installSources,
|
|
2360
|
-
resourceSources,
|
|
2182
|
+
resourceSources: [],
|
|
2361
2183
|
});
|
|
2362
2184
|
} finally {
|
|
2363
2185
|
await this.closeProtocolV2PreparedSources();
|
|
@@ -158,13 +158,6 @@ 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
|
-
}>;
|
|
168
161
|
forcedUpdateRes?: boolean;
|
|
169
162
|
artifactReader?: FirmwareArtifactReader;
|
|
170
163
|
componentArtifacts?: Partial<
|
|
@@ -173,11 +166,6 @@ export interface FirmwareUpdateV4Params {
|
|
|
173
166
|
FirmwareArtifactReference
|
|
174
167
|
>
|
|
175
168
|
>;
|
|
176
|
-
/** @deprecated Use a ZIP artifact in preparedPlan instead. */
|
|
177
|
-
resourceBundleArtifacts?: Array<{
|
|
178
|
-
name: string;
|
|
179
|
-
artifact: FirmwareArtifactReference;
|
|
180
|
-
}>;
|
|
181
169
|
}
|
|
182
170
|
|
|
183
171
|
export declare function registerFirmwareUpdateHostBinding(
|
package/src/types/settings.ts
CHANGED
|
@@ -74,18 +74,6 @@ 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
|
-
|
|
89
77
|
export type IProtocolV2ResourceManifestFile = {
|
|
90
78
|
archive_path: string;
|
|
91
79
|
original_name: string;
|
|
@@ -143,8 +131,6 @@ export type IFirmwareReleaseInfo = {
|
|
|
143
131
|
upgradeType?: 'payload-package-set' | string;
|
|
144
132
|
components?: Record<string, IProtocolV2FirmwareComponent>;
|
|
145
133
|
installOrder?: string[];
|
|
146
|
-
/** @deprecated New Protocol V2 releases use the independent signed resource ZIP. */
|
|
147
|
-
resourceBundles?: IProtocolV2ResourceBundle[];
|
|
148
134
|
bootloaderChangelog?: {
|
|
149
135
|
[k in ILocale]: string;
|
|
150
136
|
};
|