@onekeyfe/hd-core 1.2.1 → 1.2.2-alpha.0
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__/deviceUploadNft.test.ts +41 -0
- package/__tests__/evmSignTypedData.test.ts +42 -0
- package/__tests__/firmware-update/firmware-update-v4-install-poll.test.ts +21 -322
- package/__tests__/pro2HostAssetPackage.test.ts +58 -0
- package/__tests__/protocol-v2.test.ts +46 -1
- package/dist/api/FirmwareUpdateV4.d.ts +0 -1
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceUploadNft.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts.map +1 -1
- package/dist/index.js +273 -45
- package/dist/utils/pro2HostAssetPackage.d.ts +8 -0
- package/dist/utils/pro2HostAssetPackage.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/api/FirmwareUpdateV4.ts +13 -31
- package/src/api/evm/EVMSignTypedData.ts +1 -0
- package/src/api/protocol-v2/DeviceUploadNft.ts +28 -8
- package/src/api/protocol-v2/DeviceUploadWallpaper.ts +19 -8
- package/src/utils/pro2HostAssetPackage.ts +315 -0
|
@@ -32,10 +32,12 @@ const createMethod = ({
|
|
|
32
32
|
typedCall,
|
|
33
33
|
supportedMessages = [60802, 60805, 60808, 61500],
|
|
34
34
|
useFullBundle = false,
|
|
35
|
+
firmwareVersion = '1.0.0',
|
|
35
36
|
}: {
|
|
36
37
|
typedCall: jest.Mock;
|
|
37
38
|
supportedMessages?: number[];
|
|
38
39
|
useFullBundle?: boolean;
|
|
40
|
+
firmwareVersion?: string;
|
|
39
41
|
}) => {
|
|
40
42
|
const method = new DeviceUploadNft({
|
|
41
43
|
id: 1,
|
|
@@ -60,6 +62,7 @@ const createMethod = ({
|
|
|
60
62
|
})
|
|
61
63
|
),
|
|
62
64
|
getCurrentFirmwareType: jest.fn(),
|
|
65
|
+
getCurrentFirmwareVersionString: jest.fn(() => firmwareVersion),
|
|
63
66
|
};
|
|
64
67
|
method.postMessage = jest.fn();
|
|
65
68
|
|
|
@@ -202,6 +205,44 @@ describe('DeviceUploadNft', () => {
|
|
|
202
205
|
});
|
|
203
206
|
});
|
|
204
207
|
|
|
208
|
+
test('uploads one host asset package on firmware 1.0.1', async () => {
|
|
209
|
+
const typedCall = jest.fn((request: string, _response: string, params: any) => {
|
|
210
|
+
if (request === 'FilesystemFileWrite') return fileWriteSuccess(params);
|
|
211
|
+
if (request === 'NftUpdate') return { message: { message: 'NFT updated' } };
|
|
212
|
+
throw new Error(`Unexpected request: ${request}`);
|
|
213
|
+
});
|
|
214
|
+
const method = createMethod({
|
|
215
|
+
typedCall,
|
|
216
|
+
supportedMessages: [60805, 61500],
|
|
217
|
+
firmwareVersion: '1.0.1',
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
const result = await method.run();
|
|
221
|
+
|
|
222
|
+
const requests = typedCall.mock.calls.map(call => call[0]);
|
|
223
|
+
expect(requests).not.toContain('FilesystemPathInfoQuery');
|
|
224
|
+
expect(requests).not.toContain('FilesystemDirList');
|
|
225
|
+
const fileWrites = typedCall.mock.calls.filter(call => call[0] === 'FilesystemFileWrite');
|
|
226
|
+
expect(new Set(fileWrites.map(call => call[2].file.path))).toEqual(
|
|
227
|
+
new Set(['vol1:/nft/nft-deadbeef-1760000000000.okpkg'])
|
|
228
|
+
);
|
|
229
|
+
expect(fileWrites[0][2].file.data.subarray(0, 4)).toEqual(
|
|
230
|
+
new Uint8Array([0x4f, 0x4b, 0x50, 0x50])
|
|
231
|
+
);
|
|
232
|
+
expect(typedCall).toHaveBeenLastCalledWith(
|
|
233
|
+
'NftUpdate',
|
|
234
|
+
'Success',
|
|
235
|
+
{ file_name_no_ext: result.basename },
|
|
236
|
+
{ timeoutMs: 15_000 }
|
|
237
|
+
);
|
|
238
|
+
expect(result).toMatchObject({
|
|
239
|
+
imagePath: 'vol1:/nft/nft-deadbeef-1760000000000.bin',
|
|
240
|
+
thumbnailPath: 'vol1:/nft/nft-deadbeef-1760000000000_m.bin',
|
|
241
|
+
metadataPath: 'vol1:/nft/nft-deadbeef-1760000000000.json',
|
|
242
|
+
nftUpdated: true,
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
|
|
205
246
|
test('treats a missing NFT directory as empty before the first upload', async () => {
|
|
206
247
|
const typedCall = jest.fn((request: string, _response: string, params: any) => {
|
|
207
248
|
if (request === 'FilesystemPathInfoQuery') {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { EDeviceType } from '@onekeyfe/hd-shared';
|
|
2
|
+
|
|
1
3
|
import EVMSignTypedData from '../src/api/evm/EVMSignTypedData';
|
|
2
4
|
|
|
3
5
|
import type { EthereumSignTypedDataMessage, EthereumSignTypedDataTypes } from '../src/types';
|
|
@@ -577,3 +579,43 @@ describe('EVMSignTypedData — OneKey Pro Safe Protocol V1', () => {
|
|
|
577
579
|
});
|
|
578
580
|
});
|
|
579
581
|
});
|
|
582
|
+
|
|
583
|
+
describe('EVMSignTypedData — Protocol V2 data size routing', () => {
|
|
584
|
+
const buildSafeTxData = (
|
|
585
|
+
dataSize: number
|
|
586
|
+
): EthereumSignTypedDataMessage<EthereumSignTypedDataTypes> =>
|
|
587
|
+
({
|
|
588
|
+
types: {
|
|
589
|
+
EIP712Domain: [],
|
|
590
|
+
SafeTx: [{ name: 'data', type: 'bytes' }],
|
|
591
|
+
},
|
|
592
|
+
primaryType: 'SafeTx',
|
|
593
|
+
domain: {},
|
|
594
|
+
message: { data: `0x${'ab'.repeat(dataSize)}` },
|
|
595
|
+
} as EthereumSignTypedDataMessage<EthereumSignTypedDataTypes>);
|
|
596
|
+
|
|
597
|
+
test.each([EDeviceType.Pro2, EDeviceType.Neo])(
|
|
598
|
+
'keeps SafeTx data up to 1536 bytes on the structured route for %s',
|
|
599
|
+
deviceType => {
|
|
600
|
+
const data = buildSafeTxData(1316);
|
|
601
|
+
const method = createMethod(data);
|
|
602
|
+
method.device.getCurrentDeviceType = jest.fn(() => deviceType);
|
|
603
|
+
method.device.getCurrentFirmwareVersionString = jest.fn(() => '1.0.0');
|
|
604
|
+
|
|
605
|
+
expect(method.hasBiggerData(data)).toBe(false);
|
|
606
|
+
expect(method.hasBiggerData(buildSafeTxData(1536))).toBe(false);
|
|
607
|
+
}
|
|
608
|
+
);
|
|
609
|
+
|
|
610
|
+
test.each([EDeviceType.Pro2, EDeviceType.Neo])(
|
|
611
|
+
'falls back to the hash route above 1536 bytes for %s',
|
|
612
|
+
deviceType => {
|
|
613
|
+
const data = buildSafeTxData(1537);
|
|
614
|
+
const method = createMethod(data);
|
|
615
|
+
method.device.getCurrentDeviceType = jest.fn(() => deviceType);
|
|
616
|
+
method.device.getCurrentFirmwareVersionString = jest.fn(() => '1.0.0');
|
|
617
|
+
|
|
618
|
+
expect(method.hasBiggerData(data)).toBe(true);
|
|
619
|
+
}
|
|
620
|
+
);
|
|
621
|
+
});
|
|
@@ -335,97 +335,7 @@ describe('FirmwareUpdateV4 install polling', () => {
|
|
|
335
335
|
expect(method.postProgressMessage).toHaveBeenCalledWith(100, 'installingFirmware');
|
|
336
336
|
});
|
|
337
337
|
|
|
338
|
-
test
|
|
339
|
-
{
|
|
340
|
-
component: 'boot',
|
|
341
|
-
targets: [{ target_id: 3, path: 'vol0:/bootloader.bin' }],
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
component: 'P1',
|
|
345
|
-
targets: [{ target_id: 4, path: 'vol0:/application_p1.bin' }],
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
component: 'P2',
|
|
349
|
-
targets: [{ target_id: 5, path: 'vol0:/application_p2.bin' }],
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
component: 'coprocessor',
|
|
353
|
-
targets: [{ target_id: 6, path: 'vol0:/coprocessor.bin' }],
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
component: 'SE',
|
|
357
|
-
targets: [
|
|
358
|
-
{ target_id: 7, path: 'vol0:/se01.bin' },
|
|
359
|
-
{ target_id: 8, path: 'vol0:/se02.bin' },
|
|
360
|
-
{ target_id: 9, path: 'vol0:/se03.bin' },
|
|
361
|
-
{ target_id: 10, path: 'vol0:/se04.bin' },
|
|
362
|
-
],
|
|
363
|
-
},
|
|
364
|
-
])(
|
|
365
|
-
'accepts stable finished BLE status for $component after an actual install disconnect hides in-progress',
|
|
366
|
-
async ({ targets }) => {
|
|
367
|
-
const method = new FirmwareUpdateV4({
|
|
368
|
-
id: 1,
|
|
369
|
-
payload: {
|
|
370
|
-
method: 'firmwareUpdateV4',
|
|
371
|
-
connectId: 'pro2-ble',
|
|
372
|
-
},
|
|
373
|
-
});
|
|
374
|
-
const finishedStatus = {
|
|
375
|
-
type: 'DeviceFirmwareUpdateStatus',
|
|
376
|
-
message: {
|
|
377
|
-
records: targets.map(target => ({
|
|
378
|
-
...target,
|
|
379
|
-
status: 'FW_MGMT_UPDATER_TASK_STATUS_FINISHED',
|
|
380
|
-
})),
|
|
381
|
-
},
|
|
382
|
-
};
|
|
383
|
-
const typedCall = jest
|
|
384
|
-
.fn()
|
|
385
|
-
.mockResolvedValueOnce(finishedStatus)
|
|
386
|
-
.mockImplementationOnce(() => {
|
|
387
|
-
expect(method.postProgressMessage).not.toHaveBeenCalled();
|
|
388
|
-
throw new Error('device was disconnected');
|
|
389
|
-
})
|
|
390
|
-
.mockResolvedValueOnce(finishedStatus)
|
|
391
|
-
.mockImplementationOnce(() => {
|
|
392
|
-
expect(method.postProgressMessage).toHaveBeenCalledTimes(1);
|
|
393
|
-
expect(method.postProgressMessage).toHaveBeenCalledWith(1, 'installingFirmware');
|
|
394
|
-
return finishedStatus;
|
|
395
|
-
})
|
|
396
|
-
.mockResolvedValueOnce(finishedStatus)
|
|
397
|
-
.mockResolvedValueOnce(finishedStatus)
|
|
398
|
-
.mockRejectedValueOnce(ERRORS.TypedError(HardwareErrorCode.ActionCancelled));
|
|
399
|
-
const reconnectProtocolV2Device = jest.fn().mockResolvedValue(undefined);
|
|
400
|
-
|
|
401
|
-
method.device = {
|
|
402
|
-
getCommands: () => ({ typedCall }),
|
|
403
|
-
setCancelableAction: jest.fn(),
|
|
404
|
-
} as unknown as Device;
|
|
405
|
-
method.postProgressMessage = jest.fn();
|
|
406
|
-
|
|
407
|
-
const firmwareUpdate = method as unknown as {
|
|
408
|
-
waitForProtocolV2FirmwareUpdateComplete: (
|
|
409
|
-
value: typeof targets,
|
|
410
|
-
requireCurrentInstallStatus: boolean
|
|
411
|
-
) => Promise<void>;
|
|
412
|
-
reconnectProtocolV2Device: (options: { skipProtocolProbe: boolean }) => Promise<void>;
|
|
413
|
-
};
|
|
414
|
-
firmwareUpdate.reconnectProtocolV2Device = reconnectProtocolV2Device;
|
|
415
|
-
(method as any).isBleReconnect = jest.fn(() => true);
|
|
416
|
-
|
|
417
|
-
await firmwareUpdate.waitForProtocolV2FirmwareUpdateComplete(targets, true);
|
|
418
|
-
|
|
419
|
-
expect(reconnectProtocolV2Device).toHaveBeenCalledWith({ skipProtocolProbe: true });
|
|
420
|
-
expect(typedCall).toHaveBeenCalledTimes(6);
|
|
421
|
-
expect(method.postProgressMessage).toHaveBeenNthCalledWith(1, 1, 'installingFirmware');
|
|
422
|
-
expect(method.postProgressMessage).toHaveBeenNthCalledWith(2, 100, 'installingFirmware');
|
|
423
|
-
expect(method.postProgressMessage).toHaveBeenCalledTimes(2);
|
|
424
|
-
},
|
|
425
|
-
10_000
|
|
426
|
-
);
|
|
427
|
-
|
|
428
|
-
test('uses a real BLE disconnect while writing the Request as install evidence', async () => {
|
|
338
|
+
test('accepts stable finished BLE status after an actual install disconnect hides in-progress', async () => {
|
|
429
339
|
const method = new FirmwareUpdateV4({
|
|
430
340
|
id: 1,
|
|
431
341
|
payload: {
|
|
@@ -433,109 +343,49 @@ describe('FirmwareUpdateV4 install polling', () => {
|
|
|
433
343
|
connectId: 'pro2-ble',
|
|
434
344
|
},
|
|
435
345
|
});
|
|
436
|
-
const targets = [{ target_id:
|
|
346
|
+
const targets = [{ target_id: 6, path: 'vol0:/coprocessor.bin' }];
|
|
437
347
|
const finishedStatus = {
|
|
438
348
|
type: 'DeviceFirmwareUpdateStatus',
|
|
439
349
|
message: {
|
|
440
350
|
records: [
|
|
441
351
|
{
|
|
442
|
-
|
|
352
|
+
target_id: 6,
|
|
443
353
|
status: 'FW_MGMT_UPDATER_TASK_STATUS_FINISHED',
|
|
354
|
+
payload_version: 65_556,
|
|
355
|
+
path: 'vol0:/coprocessor.bin',
|
|
444
356
|
},
|
|
445
357
|
],
|
|
446
358
|
},
|
|
447
359
|
};
|
|
448
360
|
const typedCall = jest
|
|
449
361
|
.fn()
|
|
450
|
-
.mockResolvedValueOnce({ type: 'Success', message: {} })
|
|
451
362
|
.mockResolvedValueOnce(finishedStatus)
|
|
363
|
+
.mockImplementationOnce(() => {
|
|
364
|
+
expect(method.postProgressMessage).not.toHaveBeenCalled();
|
|
365
|
+
throw new Error('device was disconnected');
|
|
366
|
+
})
|
|
452
367
|
.mockResolvedValueOnce(finishedStatus)
|
|
368
|
+
.mockImplementationOnce(() => {
|
|
369
|
+
expect(method.postProgressMessage).toHaveBeenCalledTimes(1);
|
|
370
|
+
expect(method.postProgressMessage).toHaveBeenCalledWith(1, 'installingFirmware');
|
|
371
|
+
return finishedStatus;
|
|
372
|
+
})
|
|
453
373
|
.mockResolvedValueOnce(finishedStatus)
|
|
454
374
|
.mockResolvedValueOnce(finishedStatus)
|
|
455
375
|
.mockRejectedValueOnce(ERRORS.TypedError(HardwareErrorCode.ActionCancelled));
|
|
456
|
-
const call = jest.fn().mockRejectedValue(ERRORS.TypedError(HardwareErrorCode.BleTimeoutError));
|
|
457
376
|
const reconnectProtocolV2Device = jest.fn().mockResolvedValue(undefined);
|
|
458
377
|
|
|
459
|
-
method.
|
|
460
|
-
|
|
461
|
-
createProtocolV2UiPhaseMetadata: jest.fn().mockReturnValue(undefined),
|
|
462
|
-
toMessageObject: jest.fn().mockReturnValue({ connectId: 'pro2-ble' }),
|
|
463
|
-
setCancelableAction: jest.fn(),
|
|
464
|
-
clearCancelableAction: jest.fn(),
|
|
465
|
-
} as unknown as Device;
|
|
466
|
-
method.postMessage = jest.fn();
|
|
467
|
-
method.postProgressMessage = jest.fn();
|
|
468
|
-
|
|
469
|
-
const firmwareUpdate = method as unknown as {
|
|
470
|
-
protocolV2StartFirmwareUpdate: (params: { targets: typeof targets }) => Promise<void>;
|
|
471
|
-
waitForProtocolV2FirmwareUpdateComplete: (
|
|
472
|
-
value: typeof targets,
|
|
473
|
-
requireCurrentInstallStatus: boolean
|
|
474
|
-
) => Promise<void>;
|
|
475
|
-
reconnectProtocolV2Device: (options: { skipProtocolProbe: boolean }) => Promise<void>;
|
|
476
|
-
};
|
|
477
|
-
firmwareUpdate.reconnectProtocolV2Device = reconnectProtocolV2Device;
|
|
478
|
-
(method as any).isBleReconnect = jest.fn(() => true);
|
|
479
|
-
|
|
480
|
-
await firmwareUpdate.protocolV2StartFirmwareUpdate({ targets });
|
|
481
|
-
await firmwareUpdate.waitForProtocolV2FirmwareUpdateComplete(targets, true);
|
|
482
|
-
|
|
483
|
-
expect(reconnectProtocolV2Device).toHaveBeenCalledWith({ skipProtocolProbe: true });
|
|
484
|
-
expect(method.postProgressMessage).toHaveBeenNthCalledWith(1, 1, 'installingFirmware');
|
|
485
|
-
expect(method.postProgressMessage).toHaveBeenNthCalledWith(2, 100, 'installingFirmware');
|
|
486
|
-
expect(typedCall).toHaveBeenCalledTimes(5);
|
|
487
|
-
}, 10_000);
|
|
488
|
-
|
|
489
|
-
test('does not use a Request response timeout as BLE install evidence', async () => {
|
|
490
|
-
const method = new FirmwareUpdateV4({
|
|
491
|
-
id: 1,
|
|
492
|
-
payload: {
|
|
493
|
-
method: 'firmwareUpdateV4',
|
|
494
|
-
connectId: 'pro2-ble',
|
|
495
|
-
},
|
|
496
|
-
});
|
|
497
|
-
const targets = [{ target_id: 3, path: 'vol0:/bootloader.bin' }];
|
|
498
|
-
const finishedStatus = {
|
|
499
|
-
type: 'DeviceFirmwareUpdateStatus',
|
|
500
|
-
message: {
|
|
501
|
-
records: [
|
|
502
|
-
{
|
|
503
|
-
...targets[0],
|
|
504
|
-
status: 'FW_MGMT_UPDATER_TASK_STATUS_FINISHED',
|
|
505
|
-
},
|
|
506
|
-
],
|
|
507
|
-
},
|
|
378
|
+
(method as any).params = {
|
|
379
|
+
expectedTargetVersions: { coprocessor: '1.0.20' },
|
|
508
380
|
};
|
|
509
|
-
const typedCall = jest
|
|
510
|
-
.fn()
|
|
511
|
-
.mockResolvedValueOnce({ type: 'Success', message: {} })
|
|
512
|
-
.mockResolvedValueOnce(finishedStatus)
|
|
513
|
-
.mockResolvedValueOnce(finishedStatus)
|
|
514
|
-
.mockResolvedValueOnce(finishedStatus)
|
|
515
|
-
.mockResolvedValueOnce(finishedStatus)
|
|
516
|
-
.mockRejectedValueOnce(ERRORS.TypedError(HardwareErrorCode.ActionCancelled));
|
|
517
|
-
const call = jest
|
|
518
|
-
.fn()
|
|
519
|
-
.mockRejectedValue(
|
|
520
|
-
ERRORS.TypedError(
|
|
521
|
-
HardwareErrorCode.BleTimeoutError,
|
|
522
|
-
'device was disconnected after Lowlevel response timeout'
|
|
523
|
-
)
|
|
524
|
-
);
|
|
525
|
-
const reconnectProtocolV2Device = jest.fn().mockResolvedValue(undefined);
|
|
526
381
|
|
|
527
382
|
method.device = {
|
|
528
|
-
getCommands: () => ({ typedCall
|
|
529
|
-
createProtocolV2UiPhaseMetadata: jest.fn().mockReturnValue(undefined),
|
|
530
|
-
toMessageObject: jest.fn().mockReturnValue({ connectId: 'pro2-ble' }),
|
|
383
|
+
getCommands: () => ({ typedCall }),
|
|
531
384
|
setCancelableAction: jest.fn(),
|
|
532
|
-
clearCancelableAction: jest.fn(),
|
|
533
385
|
} as unknown as Device;
|
|
534
|
-
method.postMessage = jest.fn();
|
|
535
386
|
method.postProgressMessage = jest.fn();
|
|
536
387
|
|
|
537
388
|
const firmwareUpdate = method as unknown as {
|
|
538
|
-
protocolV2StartFirmwareUpdate: (params: { targets: typeof targets }) => Promise<void>;
|
|
539
389
|
waitForProtocolV2FirmwareUpdateComplete: (
|
|
540
390
|
value: typeof targets,
|
|
541
391
|
requireCurrentInstallStatus: boolean
|
|
@@ -545,165 +395,14 @@ describe('FirmwareUpdateV4 install polling', () => {
|
|
|
545
395
|
firmwareUpdate.reconnectProtocolV2Device = reconnectProtocolV2Device;
|
|
546
396
|
(method as any).isBleReconnect = jest.fn(() => true);
|
|
547
397
|
|
|
548
|
-
await firmwareUpdate.
|
|
549
|
-
await expect(
|
|
550
|
-
firmwareUpdate.waitForProtocolV2FirmwareUpdateComplete(targets, true)
|
|
551
|
-
).rejects.toMatchObject({
|
|
552
|
-
errorCode: HardwareErrorCode.ActionCancelled,
|
|
553
|
-
});
|
|
398
|
+
await firmwareUpdate.waitForProtocolV2FirmwareUpdateComplete(targets, true);
|
|
554
399
|
|
|
555
400
|
expect(reconnectProtocolV2Device).toHaveBeenCalledWith({ skipProtocolProbe: true });
|
|
556
|
-
expect(
|
|
557
|
-
}, 10_000);
|
|
558
|
-
|
|
559
|
-
test('records a real BLE disconnect that occurs during install reconnect', async () => {
|
|
560
|
-
const method = new FirmwareUpdateV4({
|
|
561
|
-
id: 1,
|
|
562
|
-
payload: {
|
|
563
|
-
method: 'firmwareUpdateV4',
|
|
564
|
-
connectId: 'pro2-ble',
|
|
565
|
-
},
|
|
566
|
-
});
|
|
567
|
-
const targets = [{ target_id: 3, path: 'vol0:/bootloader.bin' }];
|
|
568
|
-
const finishedStatus = {
|
|
569
|
-
type: 'DeviceFirmwareUpdateStatus',
|
|
570
|
-
message: {
|
|
571
|
-
records: [
|
|
572
|
-
{
|
|
573
|
-
...targets[0],
|
|
574
|
-
status: 'FW_MGMT_UPDATER_TASK_STATUS_FINISHED',
|
|
575
|
-
},
|
|
576
|
-
],
|
|
577
|
-
},
|
|
578
|
-
};
|
|
579
|
-
const typedCall = jest
|
|
580
|
-
.fn()
|
|
581
|
-
.mockRejectedValueOnce(
|
|
582
|
-
ERRORS.TypedError(
|
|
583
|
-
HardwareErrorCode.BleTimeoutError,
|
|
584
|
-
'Lowlevel response timeout after 15000ms for DeviceFirmwareUpdateStatusGet'
|
|
585
|
-
)
|
|
586
|
-
)
|
|
587
|
-
.mockResolvedValueOnce(finishedStatus)
|
|
588
|
-
.mockResolvedValueOnce(finishedStatus)
|
|
589
|
-
.mockResolvedValueOnce(finishedStatus)
|
|
590
|
-
.mockResolvedValueOnce(finishedStatus);
|
|
591
|
-
const reconnectProtocolV2Device = jest
|
|
592
|
-
.fn()
|
|
593
|
-
.mockRejectedValueOnce(ERRORS.TypedError(HardwareErrorCode.BleTimeoutError))
|
|
594
|
-
.mockResolvedValueOnce(undefined);
|
|
595
|
-
const setTimeoutSpy = jest.spyOn(global, 'setTimeout').mockImplementation(((
|
|
596
|
-
callback: () => void
|
|
597
|
-
) => {
|
|
598
|
-
callback();
|
|
599
|
-
return 0 as any;
|
|
600
|
-
}) as typeof setTimeout);
|
|
601
|
-
|
|
602
|
-
method.device = {
|
|
603
|
-
getCommands: () => ({ typedCall, cancelDevice: jest.fn() }),
|
|
604
|
-
setCancelableAction: jest.fn(),
|
|
605
|
-
} as unknown as Device;
|
|
606
|
-
method.postProgressMessage = jest.fn();
|
|
607
|
-
|
|
608
|
-
const firmwareUpdate = method as unknown as {
|
|
609
|
-
waitForProtocolV2FirmwareUpdateComplete: (
|
|
610
|
-
value: typeof targets,
|
|
611
|
-
requireCurrentInstallStatus: boolean
|
|
612
|
-
) => Promise<void>;
|
|
613
|
-
reconnectProtocolV2Device: (options: { skipProtocolProbe: boolean }) => Promise<void>;
|
|
614
|
-
};
|
|
615
|
-
firmwareUpdate.reconnectProtocolV2Device = reconnectProtocolV2Device;
|
|
616
|
-
(method as any).isBleReconnect = jest.fn(() => true);
|
|
617
|
-
|
|
618
|
-
try {
|
|
619
|
-
await firmwareUpdate.waitForProtocolV2FirmwareUpdateComplete(targets, true);
|
|
620
|
-
} finally {
|
|
621
|
-
setTimeoutSpy.mockRestore();
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
expect(reconnectProtocolV2Device).toHaveBeenCalledTimes(2);
|
|
401
|
+
expect(typedCall).toHaveBeenCalledTimes(6);
|
|
625
402
|
expect(method.postProgressMessage).toHaveBeenNthCalledWith(1, 1, 'installingFirmware');
|
|
626
403
|
expect(method.postProgressMessage).toHaveBeenNthCalledWith(2, 100, 'installingFirmware');
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
test('does not use a reconnect response timeout as BLE install evidence', async () => {
|
|
630
|
-
const method = new FirmwareUpdateV4({
|
|
631
|
-
id: 1,
|
|
632
|
-
payload: {
|
|
633
|
-
method: 'firmwareUpdateV4',
|
|
634
|
-
connectId: 'pro2-ble',
|
|
635
|
-
},
|
|
636
|
-
});
|
|
637
|
-
const targets = [{ target_id: 3, path: 'vol0:/bootloader.bin' }];
|
|
638
|
-
const finishedStatus = {
|
|
639
|
-
type: 'DeviceFirmwareUpdateStatus',
|
|
640
|
-
message: {
|
|
641
|
-
records: [
|
|
642
|
-
{
|
|
643
|
-
...targets[0],
|
|
644
|
-
status: 'FW_MGMT_UPDATER_TASK_STATUS_FINISHED',
|
|
645
|
-
},
|
|
646
|
-
],
|
|
647
|
-
},
|
|
648
|
-
};
|
|
649
|
-
const typedCall = jest
|
|
650
|
-
.fn()
|
|
651
|
-
.mockRejectedValueOnce(
|
|
652
|
-
ERRORS.TypedError(
|
|
653
|
-
HardwareErrorCode.BleTimeoutError,
|
|
654
|
-
'Lowlevel response timeout after 15000ms for DeviceFirmwareUpdateStatusGet'
|
|
655
|
-
)
|
|
656
|
-
)
|
|
657
|
-
.mockResolvedValueOnce(finishedStatus)
|
|
658
|
-
.mockResolvedValueOnce(finishedStatus)
|
|
659
|
-
.mockResolvedValueOnce(finishedStatus)
|
|
660
|
-
.mockResolvedValueOnce(finishedStatus)
|
|
661
|
-
.mockRejectedValueOnce(ERRORS.TypedError(HardwareErrorCode.ActionCancelled));
|
|
662
|
-
const reconnectProtocolV2Device = jest
|
|
663
|
-
.fn()
|
|
664
|
-
.mockRejectedValueOnce(
|
|
665
|
-
ERRORS.TypedError(
|
|
666
|
-
HardwareErrorCode.BleTimeoutError,
|
|
667
|
-
'device was disconnected after Lowlevel response timeout'
|
|
668
|
-
)
|
|
669
|
-
)
|
|
670
|
-
.mockResolvedValueOnce(undefined);
|
|
671
|
-
const setTimeoutSpy = jest.spyOn(global, 'setTimeout').mockImplementation(((
|
|
672
|
-
callback: () => void
|
|
673
|
-
) => {
|
|
674
|
-
callback();
|
|
675
|
-
return 0 as any;
|
|
676
|
-
}) as typeof setTimeout);
|
|
677
|
-
|
|
678
|
-
method.device = {
|
|
679
|
-
getCommands: () => ({ typedCall, cancelDevice: jest.fn() }),
|
|
680
|
-
setCancelableAction: jest.fn(),
|
|
681
|
-
} as unknown as Device;
|
|
682
|
-
method.postProgressMessage = jest.fn();
|
|
683
|
-
|
|
684
|
-
const firmwareUpdate = method as unknown as {
|
|
685
|
-
waitForProtocolV2FirmwareUpdateComplete: (
|
|
686
|
-
value: typeof targets,
|
|
687
|
-
requireCurrentInstallStatus: boolean
|
|
688
|
-
) => Promise<void>;
|
|
689
|
-
reconnectProtocolV2Device: (options: { skipProtocolProbe: boolean }) => Promise<void>;
|
|
690
|
-
};
|
|
691
|
-
firmwareUpdate.reconnectProtocolV2Device = reconnectProtocolV2Device;
|
|
692
|
-
(method as any).isBleReconnect = jest.fn(() => true);
|
|
693
|
-
|
|
694
|
-
try {
|
|
695
|
-
await expect(
|
|
696
|
-
firmwareUpdate.waitForProtocolV2FirmwareUpdateComplete(targets, true)
|
|
697
|
-
).rejects.toMatchObject({
|
|
698
|
-
errorCode: HardwareErrorCode.ActionCancelled,
|
|
699
|
-
});
|
|
700
|
-
} finally {
|
|
701
|
-
setTimeoutSpy.mockRestore();
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
expect(reconnectProtocolV2Device).toHaveBeenCalledTimes(2);
|
|
705
|
-
expect(method.postProgressMessage).not.toHaveBeenCalled();
|
|
706
|
-
});
|
|
404
|
+
expect(method.postProgressMessage).toHaveBeenCalledTimes(2);
|
|
405
|
+
}, 10_000);
|
|
707
406
|
|
|
708
407
|
test('rejects stable stale finished BLE status after a status response timeout', async () => {
|
|
709
408
|
const method = new FirmwareUpdateV4({
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { sha3_512 } from '@noble/hashes/sha3';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
buildPro2HostAssetPackage,
|
|
5
|
+
supportsPro2HostAssetPackage,
|
|
6
|
+
} from '../src/utils/pro2HostAssetPackage';
|
|
7
|
+
|
|
8
|
+
describe('Pro2 host asset package', () => {
|
|
9
|
+
test('builds the unsigned RESOURCE container and LZ4-blocked archive expected by firmware', () => {
|
|
10
|
+
const raw = new TextEncoder().encode('123456789');
|
|
11
|
+
const packageData = buildPro2HostAssetPackage([{ name: 'wallpaper.bin', data: raw }]);
|
|
12
|
+
const headerSize = 0x5f90;
|
|
13
|
+
const payload = packageData.subarray(headerSize);
|
|
14
|
+
const packageView = new DataView(
|
|
15
|
+
packageData.buffer,
|
|
16
|
+
packageData.byteOffset,
|
|
17
|
+
packageData.byteLength
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
expect(packageView.getUint32(0, true)).toBe(0x50504b4f);
|
|
21
|
+
expect(packageView.getUint32(4, true)).toBe(1);
|
|
22
|
+
expect(packageView.getUint32(8, true)).toBe(0x43534552);
|
|
23
|
+
expect(packageView.getUint32(0x0c, true)).toBe(headerSize);
|
|
24
|
+
expect(packageView.getUint32(0x10, true)).toBe(1);
|
|
25
|
+
expect(packageView.getUint32(0x14, true)).toBe(payload.byteLength);
|
|
26
|
+
expect(packageData.subarray(0x200, 0x240)).toEqual(sha3_512(payload));
|
|
27
|
+
expect(packageData.subarray(0x240, 0x280)).toEqual(sha3_512(packageData.subarray(0, 0x240)));
|
|
28
|
+
expect(packageData[0x400]).toBe(0);
|
|
29
|
+
expect(packageView.getUint32(0x408, true)).toBe(0x71717171);
|
|
30
|
+
|
|
31
|
+
const archiveView = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);
|
|
32
|
+
expect(archiveView.getUint32(0, true)).toBe(0x52414b4f);
|
|
33
|
+
expect(archiveView.getUint32(4, true)).toBe(1);
|
|
34
|
+
expect(archiveView.getUint16(8, true)).toBe(1);
|
|
35
|
+
expect(new TextDecoder().decode(payload.subarray(43, 56))).toBe('wallpaper.bin');
|
|
36
|
+
expect(archiveView.getUint32(42 + 0x100, true)).toBe(340);
|
|
37
|
+
expect(archiveView.getUint32(42 + 0x104, true)).toBe(raw.byteLength);
|
|
38
|
+
expect(archiveView.getUint32(42 + 0x10c, true)).toBe(0xcbf43926);
|
|
39
|
+
expect(payload[42 + 0x114]).toBe(1);
|
|
40
|
+
|
|
41
|
+
const compressedOffset = archiveView.getUint32(42 + 0x100, true);
|
|
42
|
+
expect(archiveView.getUint16(compressedOffset, true)).toBe(1);
|
|
43
|
+
expect(archiveView.getUint16(compressedOffset + 2, true)).toBe(12);
|
|
44
|
+
expect(archiveView.getUint32(compressedOffset + 4, true)).toBe(0);
|
|
45
|
+
expect(archiveView.getUint32(compressedOffset + 8, true)).toBe(10);
|
|
46
|
+
expect(payload.subarray(compressedOffset + 12)).toEqual(new Uint8Array([0x90, ...raw]));
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test.each([
|
|
50
|
+
['1.0.0', false],
|
|
51
|
+
['1.0.1-beta.1', false],
|
|
52
|
+
['1.0.1', true],
|
|
53
|
+
['1.1.0', true],
|
|
54
|
+
[undefined, false],
|
|
55
|
+
])('selects package uploads for firmware %s', (firmwareVersion, expected) => {
|
|
56
|
+
expect(supportsPro2HostAssetPackage(firmwareVersion)).toBe(expected);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -254,6 +254,52 @@ describe('DeviceUploadWallpaper', () => {
|
|
|
254
254
|
});
|
|
255
255
|
});
|
|
256
256
|
|
|
257
|
+
test('uploads and applies the fixed wallpaper package on firmware 1.0.1', async () => {
|
|
258
|
+
const typedCall = jest.fn().mockImplementation((request, _response, params) => {
|
|
259
|
+
if (request === 'FilesystemDirMake') return { message: {} };
|
|
260
|
+
if (request === 'FilesystemFileWrite') {
|
|
261
|
+
const file = params.file as { data: Uint8Array; offset: number };
|
|
262
|
+
return { message: { processed_byte: file.offset + file.data.byteLength } };
|
|
263
|
+
}
|
|
264
|
+
if (request === 'DeviceSettingsSet') {
|
|
265
|
+
return { message: { message: 'wallpaper applied' } };
|
|
266
|
+
}
|
|
267
|
+
throw new Error(`Unexpected request: ${request}`);
|
|
268
|
+
});
|
|
269
|
+
const method = new DeviceUploadWallpaper({
|
|
270
|
+
id: 1,
|
|
271
|
+
payload: {
|
|
272
|
+
method: 'deviceUploadWallpaper',
|
|
273
|
+
jpegBase64: createJpegBase64(604, 1024),
|
|
274
|
+
},
|
|
275
|
+
});
|
|
276
|
+
const device = stubWallpaperDevice({
|
|
277
|
+
commands: { typedCall },
|
|
278
|
+
getCurrentFirmwareVersionString: jest.fn(() => '1.0.1'),
|
|
279
|
+
});
|
|
280
|
+
(method as any).device = device;
|
|
281
|
+
method.postMessage = jest.fn();
|
|
282
|
+
|
|
283
|
+
method.init();
|
|
284
|
+
const result = await method.run();
|
|
285
|
+
|
|
286
|
+
const fileWrites = typedCall.mock.calls.filter(call => call[0] === 'FilesystemFileWrite');
|
|
287
|
+
expect(new Set(fileWrites.map(call => call[2].file.path))).toEqual(
|
|
288
|
+
new Set(['vol1:/wallpapers/wallpaper.okpkg'])
|
|
289
|
+
);
|
|
290
|
+
expect(fileWrites[0][2].file.data.subarray(0, 4)).toEqual(
|
|
291
|
+
new Uint8Array([0x4f, 0x4b, 0x50, 0x50])
|
|
292
|
+
);
|
|
293
|
+
expect(typedCall).toHaveBeenLastCalledWith('DeviceSettingsSet', 'Success', {
|
|
294
|
+
settings: { wallpaper_path: 'vol1:/wallpapers/wallpaper.okpkg' },
|
|
295
|
+
});
|
|
296
|
+
expect(result).toMatchObject({
|
|
297
|
+
path: 'vol1:/wallpapers/wallpaper.okpkg',
|
|
298
|
+
colorFormat: 'RGB565',
|
|
299
|
+
message: 'wallpaper applied',
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
|
|
257
303
|
test('文件上传失败时不修改 wallpaper_path', async () => {
|
|
258
304
|
const typedCall = jest.fn().mockImplementation(request => {
|
|
259
305
|
if (request === 'FilesystemDirMake') return { message: {} };
|
|
@@ -5686,7 +5732,6 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
5686
5732
|
);
|
|
5687
5733
|
expect(typedCall).not.toHaveBeenCalledWith('DeviceFirmwareUpdateRequest', 'Success', {});
|
|
5688
5734
|
expect((method as any).protocolV2InstallNeedsReconnect).toBe(true);
|
|
5689
|
-
expect((method as any).protocolV2InstallDisconnectObserved).toBe(true);
|
|
5690
5735
|
});
|
|
5691
5736
|
|
|
5692
5737
|
test.each([
|
|
@@ -18,7 +18,6 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
18
18
|
private protocolV2LatestFinalDeviceInfo?;
|
|
19
19
|
private protocolV2InstallBaselineVersions;
|
|
20
20
|
private protocolV2InstallNeedsReconnect;
|
|
21
|
-
private protocolV2InstallDisconnectObserved;
|
|
22
21
|
private protocolV2InstallTerminalSuccessObserved;
|
|
23
22
|
private protocolV2LastRuntimeProbeFeatures?;
|
|
24
23
|
private protocolV2LastTransferProgress?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirmwareUpdateV4.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV4.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAMZ,MAAM,qBAAqB,CAAC;AA0B7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAiC/E,OAAO,KAAK,EAEV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C;CAClB,CAAC;AAUF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU,CAAC,sBAAsB,CAAC;IAC9E,qBAAqB;IAIrB,IAAI;IAuCE,mBAAmB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,aAAa,GACd,EAAE;QACD,SAAS,EAAE,SAAS,CAAC;QACrB,QAAQ,EAAE,4BAA4B,CAAC,0BAA0B,CAAC,CAAC;QACnE,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;QACtC,aAAa,EAAE,OAAO,CAAC;KACxB;;;;IAoKK,aAAa;;;;IAgCnB,aAAa,CAAC,EACZ,SAAS,EACT,QAAQ,EACR,OAAO,EACP,UAAU,EACV,WAAW,GACZ,EAAE;QACD,SAAS,EAAE,SAAS,CAAC;QACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;QAC5B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;QAC/B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;KACjC;IAuBD,eAAe;;;;;IAQf,aAAa,CAAC,IAAI,EAAE,4BAA4B,CAAC,0BAA0B,CAAC;IAwB5E,eAAe,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO;IA8BnC,yCAAyC,CACvC,IAAI,EAAE,4BAA4B,CAAC,0BAA0B,CAAC;IAuIhE,gBAAgB;IAcV,GAAG;CAgFV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceUploadNft.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/DeviceUploadNft.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeviceUploadNft.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/DeviceUploadNft.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,MAAM,MAAM,qBAAqB,GAAG;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAOF,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU,CAAC,qBAAqB,CAAC;IAC5E,OAAO,CAAC,MAAM,CAAC,CAAgB;IAE/B,qBAAqB;IAIrB,IAAI;YAgFU,kBAAkB;YAiBlB,qBAAqB;YAwBrB,SAAS;IASjB,GAAG,IAAI,OAAO,CAAC,uBAAuB,CAAC;CA0E9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceUploadWallpaper.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/DeviceUploadWallpaper.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,OAAO,EAGL,KAAK,wBAAwB,EAE9B,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"DeviceUploadWallpaper.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/DeviceUploadWallpaper.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,OAAO,EAGL,KAAK,wBAAwB,EAE9B,MAAM,2BAA2B,CAAC;AAMnC,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,wBAAwB,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAqBF,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,UAAU,CAAC,2BAA2B,CAAC;IACxF,qBAAqB;IAIrB,OAAO,CAAC,OAAO,CAAC,CAA8D;IAE9E,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,IAAI,CAAM;IAElB,IAAI;YA2BU,kBAAkB;YAgBlB,eAAe;YAaf,MAAM;IAsBd,GAAG,IAAI,OAAO,CAAC,6BAA6B,CAAC;CAgCpD"}
|