@onekeyfe/hardware-cli 1.2.0-alpha.90 → 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/dist/cli.d.ts +2 -0
- package/dist/cli.js +4 -1
- package/package.json +6 -6
- package/src/__tests__/firmware-update-v4-command.test.ts +1 -0
- package/src/cli.ts +7 -1
package/dist/cli.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ declare function buildFirmwareUpdateV4Params(opts: {
|
|
|
62
62
|
se02?: string;
|
|
63
63
|
se03?: string;
|
|
64
64
|
se04?: string;
|
|
65
|
+
resourceArchive?: string;
|
|
65
66
|
forcedUpdateRes?: boolean;
|
|
66
67
|
}): {
|
|
67
68
|
platform: "desktop";
|
|
@@ -77,5 +78,6 @@ declare function buildFirmwareUpdateV4Params(opts: {
|
|
|
77
78
|
se02Binary: ArrayBuffer | undefined;
|
|
78
79
|
se03Binary: ArrayBuffer | undefined;
|
|
79
80
|
se04Binary: ArrayBuffer | undefined;
|
|
81
|
+
resourceArchiveBinary: ArrayBuffer | undefined;
|
|
80
82
|
};
|
|
81
83
|
export { program };
|
package/dist/cli.js
CHANGED
|
@@ -494,6 +494,7 @@ program
|
|
|
494
494
|
.option('--se02 <path>', 'FW_MGMT_TARGET_SE02 binary path')
|
|
495
495
|
.option('--se03 <path>', 'FW_MGMT_TARGET_SE03 binary path')
|
|
496
496
|
.option('--se04 <path>', 'FW_MGMT_TARGET_SE04 binary path')
|
|
497
|
+
.option('--resource-archive <path>', 'Complete signed Protocol V2 resource ZIP path')
|
|
497
498
|
.option('--forced-update-res', 'Force resource update')
|
|
498
499
|
.option('--retries <count>', 'Retry count for transient Protocol V2 USB probe failures')
|
|
499
500
|
.action(opts => runCommand({}, async ({ sdk, globalOpts }) => {
|
|
@@ -1201,6 +1202,7 @@ function buildFirmwareUpdateV4Params(opts) {
|
|
|
1201
1202
|
se02Binary: opts.se02 ? readBinaryParam(opts.se02) : undefined,
|
|
1202
1203
|
se03Binary: opts.se03 ? readBinaryParam(opts.se03) : undefined,
|
|
1203
1204
|
se04Binary: opts.se04 ? readBinaryParam(opts.se04) : undefined,
|
|
1205
|
+
resourceArchiveBinary: opts.resourceArchive ? readBinaryParam(opts.resourceArchive) : undefined,
|
|
1204
1206
|
};
|
|
1205
1207
|
const hasPayload = [
|
|
1206
1208
|
params.romloaderBinary,
|
|
@@ -1212,9 +1214,10 @@ function buildFirmwareUpdateV4Params(opts) {
|
|
|
1212
1214
|
params.se02Binary,
|
|
1213
1215
|
params.se03Binary,
|
|
1214
1216
|
params.se04Binary,
|
|
1217
|
+
params.resourceArchiveBinary,
|
|
1215
1218
|
].some(Boolean);
|
|
1216
1219
|
if (!hasPayload) {
|
|
1217
|
-
const err = new Error('firmware-update-v4 requires at least one binary path');
|
|
1220
|
+
const err = new Error('firmware-update-v4 requires at least one firmware binary or resource archive path');
|
|
1218
1221
|
err.code = 'MISSING_FIRMWARE_BINARY';
|
|
1219
1222
|
throw err;
|
|
1220
1223
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hardware-cli",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.92",
|
|
4
4
|
"description": "OneKey hardware wallet CLI for testing device communication",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"test": "jest"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@onekeyfe/hd-common-connect-sdk": "1.2.0-alpha.
|
|
35
|
-
"@onekeyfe/hd-core": "1.2.0-alpha.
|
|
36
|
-
"@onekeyfe/hd-shared": "1.2.0-alpha.
|
|
37
|
-
"@onekeyfe/hd-transport-usb": "1.2.0-alpha.
|
|
34
|
+
"@onekeyfe/hd-common-connect-sdk": "1.2.0-alpha.92",
|
|
35
|
+
"@onekeyfe/hd-core": "1.2.0-alpha.92",
|
|
36
|
+
"@onekeyfe/hd-shared": "1.2.0-alpha.92",
|
|
37
|
+
"@onekeyfe/hd-transport-usb": "1.2.0-alpha.92",
|
|
38
38
|
"@stoprocent/noble": "2.3.16",
|
|
39
39
|
"commander": "^12.0.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "451cf48c34c896033474163f7eaf2b4bf1a0ec55"
|
|
42
42
|
}
|
|
@@ -36,6 +36,7 @@ describe('firmware-update-v4 CLI command', () => {
|
|
|
36
36
|
expect(command?.description()).toBe(
|
|
37
37
|
'Run Protocol V2 firmware update through sdk.firmwareUpdateV4'
|
|
38
38
|
);
|
|
39
|
+
expect(command?.options.some(option => option.long === '--resource-archive')).toBe(true);
|
|
39
40
|
});
|
|
40
41
|
|
|
41
42
|
test('does not expose the pre-release firmware-update-v4-debug command', () => {
|
package/src/cli.ts
CHANGED
|
@@ -637,6 +637,7 @@ program
|
|
|
637
637
|
.option('--se02 <path>', 'FW_MGMT_TARGET_SE02 binary path')
|
|
638
638
|
.option('--se03 <path>', 'FW_MGMT_TARGET_SE03 binary path')
|
|
639
639
|
.option('--se04 <path>', 'FW_MGMT_TARGET_SE04 binary path')
|
|
640
|
+
.option('--resource-archive <path>', 'Complete signed Protocol V2 resource ZIP path')
|
|
640
641
|
.option('--forced-update-res', 'Force resource update')
|
|
641
642
|
.option('--retries <count>', 'Retry count for transient Protocol V2 USB probe failures')
|
|
642
643
|
.action(opts =>
|
|
@@ -1584,6 +1585,7 @@ function buildFirmwareUpdateV4Params(opts: {
|
|
|
1584
1585
|
se02?: string;
|
|
1585
1586
|
se03?: string;
|
|
1586
1587
|
se04?: string;
|
|
1588
|
+
resourceArchive?: string;
|
|
1587
1589
|
forcedUpdateRes?: boolean;
|
|
1588
1590
|
}) {
|
|
1589
1591
|
const params = {
|
|
@@ -1600,6 +1602,7 @@ function buildFirmwareUpdateV4Params(opts: {
|
|
|
1600
1602
|
se02Binary: opts.se02 ? readBinaryParam(opts.se02) : undefined,
|
|
1601
1603
|
se03Binary: opts.se03 ? readBinaryParam(opts.se03) : undefined,
|
|
1602
1604
|
se04Binary: opts.se04 ? readBinaryParam(opts.se04) : undefined,
|
|
1605
|
+
resourceArchiveBinary: opts.resourceArchive ? readBinaryParam(opts.resourceArchive) : undefined,
|
|
1603
1606
|
};
|
|
1604
1607
|
|
|
1605
1608
|
const hasPayload = [
|
|
@@ -1612,10 +1615,13 @@ function buildFirmwareUpdateV4Params(opts: {
|
|
|
1612
1615
|
params.se02Binary,
|
|
1613
1616
|
params.se03Binary,
|
|
1614
1617
|
params.se04Binary,
|
|
1618
|
+
params.resourceArchiveBinary,
|
|
1615
1619
|
].some(Boolean);
|
|
1616
1620
|
|
|
1617
1621
|
if (!hasPayload) {
|
|
1618
|
-
const err = new Error(
|
|
1622
|
+
const err = new Error(
|
|
1623
|
+
'firmware-update-v4 requires at least one firmware binary or resource archive path'
|
|
1624
|
+
);
|
|
1619
1625
|
(err as Error & { code?: string }).code = 'MISSING_FIRMWARE_BINARY';
|
|
1620
1626
|
throw err;
|
|
1621
1627
|
}
|