@onekeyfe/hd-core 1.2.0-alpha.105 → 1.2.0-alpha.107
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__/DeviceCommands.test.ts +2 -10
- package/__tests__/check-all-firmware-release-protocol-v2.test.ts +0 -2
- package/__tests__/device-lifecycle-events.test.ts +2 -113
- package/__tests__/device-pool-state.test.ts +0 -29
- package/__tests__/deviceUploadNft.test.ts +4 -33
- package/__tests__/get-device-state.test.ts +13 -52
- package/__tests__/protocol-v2.test.ts +18 -330
- package/__tests__/refresh-device-state.test.ts +1 -4
- package/__tests__/search-devices.test.ts +38 -34
- package/dist/api/FirmwareUpdateV4.d.ts +0 -3
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/api/GetDeviceState.d.ts.map +1 -1
- package/dist/api/SearchDevices.d.ts.map +1 -1
- package/dist/api/UploadPortfolio.d.ts +1 -1
- package/dist/api/UploadPortfolio.d.ts.map +1 -1
- package/dist/api/firmware/protocolV2Release.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceUploadNft.d.ts +3 -2
- package/dist/api/protocol-v2/DeviceUploadNft.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts +3 -2
- package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts.map +1 -1
- package/dist/api/ton/TonSignMessage.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/device/Device.d.ts +2 -10
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/device/DevicePool.d.ts +1 -1
- package/dist/device/DevicePool.d.ts.map +1 -1
- package/dist/index.d.ts +16 -18
- package/dist/index.js +99 -277
- package/dist/protocols/protocol-v2/features.d.ts +0 -8
- package/dist/protocols/protocol-v2/features.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/index.d.ts +2 -2
- package/dist/protocols/protocol-v2/index.d.ts.map +1 -1
- package/dist/types/api/getDeviceState.d.ts +0 -1
- package/dist/types/api/getDeviceState.d.ts.map +1 -1
- package/dist/types/api/protocolV2.d.ts +1 -1
- package/dist/types/api/protocolV2.d.ts.map +1 -1
- package/dist/types/device.d.ts.map +1 -1
- package/dist/utils/pro2Nft.d.ts +0 -7
- package/dist/utils/pro2Nft.d.ts.map +1 -1
- package/package.json +4 -6
- package/src/api/FirmwareUpdateV4.ts +24 -72
- package/src/api/GetDeviceState.ts +0 -1
- package/src/api/SearchDevices.ts +2 -4
- package/src/api/UploadPortfolio.ts +2 -9
- package/src/api/firmware/protocolV2Release.ts +0 -1
- package/src/api/protocol-v2/DeviceUploadNft.ts +8 -56
- package/src/api/protocol-v2/DeviceUploadWallpaper.ts +18 -37
- package/src/api/ton/TonSignMessage.ts +3 -5
- package/src/core/index.ts +0 -4
- package/src/device/Device.ts +31 -90
- package/src/device/DevicePool.ts +5 -17
- package/src/protocols/protocol-v2/features.ts +0 -10
- package/src/protocols/protocol-v2/index.ts +0 -2
- package/src/types/api/getDeviceState.ts +0 -2
- package/src/types/api/protocolV2.ts +1 -1
- package/src/types/device.ts +2 -1
- package/src/utils/pro2Nft.ts +8 -31
- package/__tests__/base64Data.test.ts +0 -70
- package/__tests__/protocol-v2-legacy-recovery.test.ts +0 -29
- package/__tests__/resourceBase64Boundary.test.ts +0 -48
- package/__tests__/ton-sign-message.test.ts +0 -84
- package/dist/api/helpers/base64Data.d.ts +0 -16
- package/dist/api/helpers/base64Data.d.ts.map +0 -1
- package/dist/core/protocolV2LegacyRecovery.d.ts +0 -5
- package/dist/core/protocolV2LegacyRecovery.d.ts.map +0 -1
- package/src/api/helpers/base64Data.ts +0 -85
- package/src/core/protocolV2LegacyRecovery.ts +0 -12
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { Buffer } from 'buffer';
|
|
2
1
|
import { EFirmwareType, ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
3
2
|
import { sha256 } from '@noble/hashes/sha256';
|
|
4
3
|
import { bytesToHex } from '@noble/hashes/utils';
|
|
5
4
|
import JSZip from 'jszip';
|
|
6
|
-
import { encode as encodeJpeg } from 'jpeg-js';
|
|
7
5
|
import {
|
|
8
6
|
DeviceRebootType,
|
|
9
7
|
DeviceSessionPinType,
|
|
@@ -125,18 +123,6 @@ jest.mock('../src/data/config', () => ({
|
|
|
125
123
|
DEFAULT_DOMAIN: 'https://jssdk.onekey.so/1.0.0/',
|
|
126
124
|
}));
|
|
127
125
|
|
|
128
|
-
const jpegBase64Cache = new Map<string, string>();
|
|
129
|
-
|
|
130
|
-
const createJpegBase64 = (width: number, height: number) => {
|
|
131
|
-
const key = `${width}x${height}`;
|
|
132
|
-
const cached = jpegBase64Cache.get(key);
|
|
133
|
-
if (cached) return cached;
|
|
134
|
-
const rgba = new Uint8Array(width * height * 4).fill(0xff);
|
|
135
|
-
const value = encodeJpeg({ width, height, data: rgba }, 80).data.toString('base64');
|
|
136
|
-
jpegBase64Cache.set(key, value);
|
|
137
|
-
return value;
|
|
138
|
-
};
|
|
139
|
-
|
|
140
126
|
const createProtocolV2OkppBinary = ({
|
|
141
127
|
version = [1, 2, 3],
|
|
142
128
|
payloadHashByte = 0x11,
|
|
@@ -174,18 +160,8 @@ const createWalletSessionTypedCall = (
|
|
|
174
160
|
});
|
|
175
161
|
|
|
176
162
|
describe('DeviceUploadWallpaper', () => {
|
|
177
|
-
const wallpaperProtocolInfo = {
|
|
178
|
-
version: 2,
|
|
179
|
-
supported_messages: [60412, 60805, 60809],
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
const stubWallpaperDevice = <T extends Record<string, any>>(device: T) =>
|
|
183
|
-
stubDevice({
|
|
184
|
-
...device,
|
|
185
|
-
ensureProtocolV2RuntimeContext: jest.fn().mockResolvedValue(wallpaperProtocolInfo),
|
|
186
|
-
});
|
|
187
|
-
|
|
188
163
|
test('encodes, uploads and applies a Pro2 wallpaper', async () => {
|
|
164
|
+
const rgba = new Uint8Array(604 * 1024 * 4).fill(255);
|
|
189
165
|
const typedCall = jest.fn().mockImplementation((request, _response, params) => {
|
|
190
166
|
if (request === 'FilesystemDirMake') return { message: { message: 'directory ready' } };
|
|
191
167
|
if (request === 'FilesystemFileWrite') {
|
|
@@ -199,12 +175,9 @@ describe('DeviceUploadWallpaper', () => {
|
|
|
199
175
|
});
|
|
200
176
|
const method = new DeviceUploadWallpaper({
|
|
201
177
|
id: 1,
|
|
202
|
-
payload: {
|
|
203
|
-
method: 'deviceUploadWallpaper',
|
|
204
|
-
jpegBase64: createJpegBase64(604, 1024),
|
|
205
|
-
},
|
|
178
|
+
payload: { method: 'deviceUploadWallpaper', width: 604, height: 1024, rgba },
|
|
206
179
|
});
|
|
207
|
-
(method as any).device =
|
|
180
|
+
(method as any).device = stubDevice({ commands: { typedCall } });
|
|
208
181
|
method.postMessage = jest.fn();
|
|
209
182
|
|
|
210
183
|
method.init();
|
|
@@ -252,10 +225,12 @@ describe('DeviceUploadWallpaper', () => {
|
|
|
252
225
|
id: 1,
|
|
253
226
|
payload: {
|
|
254
227
|
method: 'deviceUploadWallpaper',
|
|
255
|
-
|
|
228
|
+
width: 604,
|
|
229
|
+
height: 1024,
|
|
230
|
+
rgba: new Uint8Array(604 * 1024 * 4),
|
|
256
231
|
},
|
|
257
232
|
});
|
|
258
|
-
(method as any).device =
|
|
233
|
+
(method as any).device = stubDevice({ commands: { typedCall } });
|
|
259
234
|
method.init();
|
|
260
235
|
|
|
261
236
|
await expect(method.run()).rejects.toThrow('write failed');
|
|
@@ -267,37 +242,15 @@ describe('DeviceUploadWallpaper', () => {
|
|
|
267
242
|
id: 1,
|
|
268
243
|
payload: {
|
|
269
244
|
method: 'deviceUploadWallpaper',
|
|
270
|
-
|
|
245
|
+
width: 604,
|
|
246
|
+
height: 1024,
|
|
247
|
+
rgba: new Uint8Array(604 * 1024 * 4),
|
|
271
248
|
fileName: '../wallpaper.bin',
|
|
272
249
|
},
|
|
273
250
|
});
|
|
274
251
|
|
|
275
252
|
expect(() => method.init()).toThrow('fileName');
|
|
276
253
|
});
|
|
277
|
-
|
|
278
|
-
test('rejects unsupported firmware before creating or writing files', async () => {
|
|
279
|
-
const typedCall = jest.fn();
|
|
280
|
-
const method = new DeviceUploadWallpaper({
|
|
281
|
-
id: 1,
|
|
282
|
-
payload: {
|
|
283
|
-
method: 'deviceUploadWallpaper',
|
|
284
|
-
jpegBase64: createJpegBase64(604, 1024),
|
|
285
|
-
},
|
|
286
|
-
});
|
|
287
|
-
(method as any).device = stubDevice({
|
|
288
|
-
commands: { typedCall },
|
|
289
|
-
ensureProtocolV2RuntimeContext: jest.fn().mockResolvedValue({
|
|
290
|
-
version: 2,
|
|
291
|
-
supported_messages: [60805, 60809],
|
|
292
|
-
}),
|
|
293
|
-
});
|
|
294
|
-
method.init();
|
|
295
|
-
|
|
296
|
-
await expect(method.run()).rejects.toMatchObject({
|
|
297
|
-
errorCode: HardwareErrorCode.DeviceNotSupportMethod,
|
|
298
|
-
});
|
|
299
|
-
expect(typedCall).not.toHaveBeenCalled();
|
|
300
|
-
});
|
|
301
254
|
});
|
|
302
255
|
|
|
303
256
|
describe('UploadPortfolio', () => {
|
|
@@ -313,6 +266,7 @@ describe('UploadPortfolio', () => {
|
|
|
313
266
|
});
|
|
314
267
|
|
|
315
268
|
test('writes and applies the portfolio while the device is locked without unlocking', async () => {
|
|
269
|
+
const packageBytes = new Uint8Array([1, 2, 3]);
|
|
316
270
|
const typedCall = jest
|
|
317
271
|
.fn()
|
|
318
272
|
.mockResolvedValueOnce({ message: { processed_byte: 3 } })
|
|
@@ -328,7 +282,7 @@ describe('UploadPortfolio', () => {
|
|
|
328
282
|
id: 1,
|
|
329
283
|
payload: {
|
|
330
284
|
method: 'uploadPortfolio',
|
|
331
|
-
|
|
285
|
+
packageBytes,
|
|
332
286
|
},
|
|
333
287
|
});
|
|
334
288
|
(method as any).device = device;
|
|
@@ -360,7 +314,7 @@ describe('UploadPortfolio', () => {
|
|
|
360
314
|
id: 1,
|
|
361
315
|
payload: {
|
|
362
316
|
method: 'uploadPortfolio',
|
|
363
|
-
|
|
317
|
+
packageBytes,
|
|
364
318
|
},
|
|
365
319
|
});
|
|
366
320
|
(method as any).device = stubPortfolioDevice({ commands: { typedCall } });
|
|
@@ -408,7 +362,7 @@ describe('UploadPortfolio', () => {
|
|
|
408
362
|
id: 1,
|
|
409
363
|
payload: {
|
|
410
364
|
method: 'uploadPortfolio',
|
|
411
|
-
|
|
365
|
+
packageBytes: new Uint8Array([1]),
|
|
412
366
|
},
|
|
413
367
|
});
|
|
414
368
|
(method as any).device = stubPortfolioDevice({ commands: { typedCall } });
|
|
@@ -430,7 +384,7 @@ describe('UploadPortfolio', () => {
|
|
|
430
384
|
id: 1,
|
|
431
385
|
payload: {
|
|
432
386
|
method: 'uploadPortfolio',
|
|
433
|
-
|
|
387
|
+
packageBytes,
|
|
434
388
|
},
|
|
435
389
|
});
|
|
436
390
|
method.abortSignal = abortController.signal;
|
|
@@ -451,7 +405,7 @@ describe('UploadPortfolio', () => {
|
|
|
451
405
|
id: 1,
|
|
452
406
|
payload: {
|
|
453
407
|
method: 'uploadPortfolio',
|
|
454
|
-
|
|
408
|
+
packageBytes: new Uint8Array([1]),
|
|
455
409
|
},
|
|
456
410
|
});
|
|
457
411
|
(method as any).device = stubDevice({
|
|
@@ -469,18 +423,6 @@ describe('UploadPortfolio', () => {
|
|
|
469
423
|
});
|
|
470
424
|
expect(typedCall).not.toHaveBeenCalled();
|
|
471
425
|
});
|
|
472
|
-
|
|
473
|
-
test('rejects non-canonical Base64 before device communication', () => {
|
|
474
|
-
const method = new UploadPortfolio({
|
|
475
|
-
id: 1,
|
|
476
|
-
payload: {
|
|
477
|
-
method: 'uploadPortfolio',
|
|
478
|
-
packageBase64: 'data:application/octet-stream;base64,AQID',
|
|
479
|
-
},
|
|
480
|
-
});
|
|
481
|
-
|
|
482
|
-
expect(() => method.init()).toThrow('canonical Base64');
|
|
483
|
-
});
|
|
484
426
|
});
|
|
485
427
|
|
|
486
428
|
const descriptor = {
|
|
@@ -2755,35 +2697,19 @@ describe('Protocol V2 feature adapter', () => {
|
|
|
2755
2697
|
});
|
|
2756
2698
|
});
|
|
2757
2699
|
|
|
2758
|
-
test('syncs Protocol V2 cached features
|
|
2759
|
-
const typedCall = jest.fn().mockResolvedValue({ message: protocolV2ApplicationInfo });
|
|
2700
|
+
test('syncs Protocol V2 cached features without cached profile', () => {
|
|
2760
2701
|
const cached = Device.fromDescriptor({ ...descriptor, protocolType: 'V2' } as any);
|
|
2761
2702
|
(cached as any).features = {
|
|
2762
2703
|
...normalizeProtocolV2Features({ ...descriptor, protocolType: 'V2' } as any),
|
|
2763
2704
|
deviceId: null,
|
|
2764
2705
|
serialNo: 'CACHED-SERIAL',
|
|
2765
2706
|
};
|
|
2766
|
-
(cached as any).commands = { typedCall };
|
|
2767
2707
|
|
|
2768
2708
|
const current = Device.fromDescriptor({ ...descriptor, protocolType: 'V2' } as any);
|
|
2769
|
-
current.updateState(
|
|
2770
|
-
{
|
|
2771
|
-
raw: { protocolV2ProtocolInfo: protocolV2BootloaderInfo },
|
|
2772
|
-
status: { mode: 'bootloader' },
|
|
2773
|
-
},
|
|
2774
|
-
'initialize'
|
|
2775
|
-
);
|
|
2776
2709
|
current.updateFromCache(cached);
|
|
2777
2710
|
|
|
2778
|
-
await expect(current.ensureProtocolV2RuntimeContext()).resolves.toEqual(
|
|
2779
|
-
protocolV2ApplicationInfo
|
|
2780
|
-
);
|
|
2781
|
-
|
|
2782
2711
|
expect(current.getCurrentDeviceId()).toBeUndefined();
|
|
2783
2712
|
expect(current.getCurrentSerialNo()).toBe('CACHED-SERIAL');
|
|
2784
|
-
expect(typedCall).toHaveBeenCalledWith('ProtocolInfoRequest', 'ProtocolInfo', {
|
|
2785
|
-
eventless_wallet_session: true,
|
|
2786
|
-
});
|
|
2787
2713
|
expect(current.toMessageObject()).toMatchObject({
|
|
2788
2714
|
serialNo: 'CACHED-SERIAL',
|
|
2789
2715
|
uuid: 'CACHED-SERIAL',
|
|
@@ -3268,125 +3194,6 @@ describe('Protocol V2 feature adapter', () => {
|
|
|
3268
3194
|
expect(typedCall).toHaveBeenCalledTimes(1);
|
|
3269
3195
|
});
|
|
3270
3196
|
|
|
3271
|
-
test('rejects a cached legacy ProtocolInfo outside discovery and firmware recovery', async () => {
|
|
3272
|
-
const device = Device.fromDescriptor({
|
|
3273
|
-
path: 'usb-path',
|
|
3274
|
-
protocolType: 'V2',
|
|
3275
|
-
} as any);
|
|
3276
|
-
const typedCall = jest.fn().mockResolvedValue({
|
|
3277
|
-
type: 'ProtocolInfo',
|
|
3278
|
-
message: {
|
|
3279
|
-
version: 1,
|
|
3280
|
-
build_fingerprint: '',
|
|
3281
|
-
supported_messages: [],
|
|
3282
|
-
protobuf_definition: null,
|
|
3283
|
-
},
|
|
3284
|
-
});
|
|
3285
|
-
(device as any).commands = { typedCall };
|
|
3286
|
-
|
|
3287
|
-
await expect(
|
|
3288
|
-
device.probeProtocolV2RuntimeState({
|
|
3289
|
-
hw: { Device_type: DeviceType.PRO2, serial_no: 'PR2SERIAL' },
|
|
3290
|
-
fw: { application: { version: '1.2.3' } },
|
|
3291
|
-
})
|
|
3292
|
-
).rejects.toMatchObject({ errorCode: HardwareErrorCode.DeviceInitializeFailed });
|
|
3293
|
-
|
|
3294
|
-
expect(typedCall).toHaveBeenCalledTimes(1);
|
|
3295
|
-
});
|
|
3296
|
-
|
|
3297
|
-
test('uses DeviceStatusGet to identify App mode for an allowed legacy ProtocolInfo', async () => {
|
|
3298
|
-
const device = Device.fromDescriptor({
|
|
3299
|
-
path: 'usb-path',
|
|
3300
|
-
protocolType: 'V2',
|
|
3301
|
-
} as any);
|
|
3302
|
-
const typedCall = jest
|
|
3303
|
-
.fn()
|
|
3304
|
-
.mockResolvedValueOnce({
|
|
3305
|
-
type: 'ProtocolInfo',
|
|
3306
|
-
message: {
|
|
3307
|
-
version: 1,
|
|
3308
|
-
build_fingerprint: '',
|
|
3309
|
-
supported_messages: [],
|
|
3310
|
-
protobuf_definition: null,
|
|
3311
|
-
},
|
|
3312
|
-
})
|
|
3313
|
-
.mockResolvedValueOnce({
|
|
3314
|
-
type: 'DeviceStatus',
|
|
3315
|
-
message: { init_states: true, unlocked: true },
|
|
3316
|
-
});
|
|
3317
|
-
(device as any).commands = { typedCall };
|
|
3318
|
-
|
|
3319
|
-
await device.probeProtocolV2RuntimeState(
|
|
3320
|
-
{
|
|
3321
|
-
hw: { Device_type: DeviceType.PRO2, serial_no: 'PR2SERIAL' },
|
|
3322
|
-
fw: { application: { version: '1.2.3' } },
|
|
3323
|
-
},
|
|
3324
|
-
5000,
|
|
3325
|
-
{ allowLegacyProtocolV2ProtocolInfo: true }
|
|
3326
|
-
);
|
|
3327
|
-
|
|
3328
|
-
expect(typedCall).toHaveBeenNthCalledWith(
|
|
3329
|
-
1,
|
|
3330
|
-
'ProtocolInfoRequest',
|
|
3331
|
-
'ProtocolInfo',
|
|
3332
|
-
{ eventless_wallet_session: true },
|
|
3333
|
-
{ timeoutMs: 5000 }
|
|
3334
|
-
);
|
|
3335
|
-
expect(typedCall).toHaveBeenNthCalledWith(
|
|
3336
|
-
2,
|
|
3337
|
-
'DeviceStatusGet',
|
|
3338
|
-
'DeviceStatus',
|
|
3339
|
-
{},
|
|
3340
|
-
{ timeoutMs: 5000 }
|
|
3341
|
-
);
|
|
3342
|
-
expect(device.features).toMatchObject({
|
|
3343
|
-
mode: 'normal',
|
|
3344
|
-
bootloaderMode: false,
|
|
3345
|
-
initialized: true,
|
|
3346
|
-
unlocked: true,
|
|
3347
|
-
});
|
|
3348
|
-
});
|
|
3349
|
-
|
|
3350
|
-
test('maps an allowed legacy loader to bootloader only after an explicit unsupported status', async () => {
|
|
3351
|
-
const device = Device.fromDescriptor({
|
|
3352
|
-
path: 'usb-path',
|
|
3353
|
-
protocolType: 'V2',
|
|
3354
|
-
} as any);
|
|
3355
|
-
const typedCall = jest
|
|
3356
|
-
.fn()
|
|
3357
|
-
.mockResolvedValueOnce({
|
|
3358
|
-
type: 'ProtocolInfo',
|
|
3359
|
-
message: {
|
|
3360
|
-
version: 1,
|
|
3361
|
-
build_fingerprint: '',
|
|
3362
|
-
supported_messages: [],
|
|
3363
|
-
protobuf_definition: null,
|
|
3364
|
-
},
|
|
3365
|
-
})
|
|
3366
|
-
.mockRejectedValueOnce(new Error('Failure_UnexpectedMessage,Unknown message'));
|
|
3367
|
-
(device as any).commands = { typedCall };
|
|
3368
|
-
|
|
3369
|
-
await device.probeProtocolV2RuntimeState(
|
|
3370
|
-
{
|
|
3371
|
-
hw: { Device_type: DeviceType.NEO, serial_no: 'NEOSERIAL' },
|
|
3372
|
-
fw: { bootloader: { version: '0.2.0' } },
|
|
3373
|
-
},
|
|
3374
|
-
undefined,
|
|
3375
|
-
{ allowLegacyProtocolV2ProtocolInfo: true }
|
|
3376
|
-
);
|
|
3377
|
-
|
|
3378
|
-
expect(typedCall).toHaveBeenNthCalledWith(1, 'ProtocolInfoRequest', 'ProtocolInfo', {
|
|
3379
|
-
eventless_wallet_session: true,
|
|
3380
|
-
});
|
|
3381
|
-
expect(typedCall).toHaveBeenNthCalledWith(2, 'DeviceStatusGet', 'DeviceStatus', {});
|
|
3382
|
-
expect(device.features).toMatchObject({
|
|
3383
|
-
deviceType: 'neo',
|
|
3384
|
-
mode: 'bootloader',
|
|
3385
|
-
bootloaderMode: true,
|
|
3386
|
-
initialized: null,
|
|
3387
|
-
});
|
|
3388
|
-
});
|
|
3389
|
-
|
|
3390
3197
|
test('does not reinterpret a state update error as runtime detection failure', async () => {
|
|
3391
3198
|
const device = Device.fromDescriptor({
|
|
3392
3199
|
path: 'usb-path',
|
|
@@ -4442,43 +4249,6 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4442
4249
|
expect(method.postTipMessage).toHaveBeenCalledWith('GoToBootloaderSuccess');
|
|
4443
4250
|
});
|
|
4444
4251
|
|
|
4445
|
-
test('keeps an ambiguous legacy runtime on the direct loader update path', async () => {
|
|
4446
|
-
const method = new FirmwareUpdateV4({
|
|
4447
|
-
id: 1,
|
|
4448
|
-
payload: {
|
|
4449
|
-
method: 'firmwareUpdateV4',
|
|
4450
|
-
},
|
|
4451
|
-
});
|
|
4452
|
-
(method as any).device = stubDevice({
|
|
4453
|
-
originalDescriptor: { id: 'usb-id', path: 'legacy-path', protocolType: 'V2' },
|
|
4454
|
-
state: {
|
|
4455
|
-
raw: {
|
|
4456
|
-
protocolV2ProtocolInfo: {
|
|
4457
|
-
version: 1,
|
|
4458
|
-
build_fingerprint: '',
|
|
4459
|
-
supported_messages: [],
|
|
4460
|
-
protobuf_definition: null,
|
|
4461
|
-
},
|
|
4462
|
-
},
|
|
4463
|
-
},
|
|
4464
|
-
features: {
|
|
4465
|
-
deviceType: 'pro2',
|
|
4466
|
-
mode: 'bootloader',
|
|
4467
|
-
bootloaderMode: true,
|
|
4468
|
-
capabilities: [],
|
|
4469
|
-
},
|
|
4470
|
-
isBootloader: () => true,
|
|
4471
|
-
isRomloader: () => false,
|
|
4472
|
-
});
|
|
4473
|
-
(method as any).protocolV2Reboot = jest.fn();
|
|
4474
|
-
method.postTipMessage = jest.fn();
|
|
4475
|
-
|
|
4476
|
-
await expect((method as any).enterProtocolV2BootloaderMode()).resolves.toBe(false);
|
|
4477
|
-
|
|
4478
|
-
expect((method as any).protocolV2LegacyDirectUpdate).toBe(true);
|
|
4479
|
-
expect((method as any).protocolV2Reboot).not.toHaveBeenCalled();
|
|
4480
|
-
});
|
|
4481
|
-
|
|
4482
4252
|
test('keeps Protocol V2 romloader active before firmware transfer', async () => {
|
|
4483
4253
|
const method = new FirmwareUpdateV4({
|
|
4484
4254
|
id: 1,
|
|
@@ -5111,86 +4881,6 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
5111
4881
|
expect(method.postProgressMessage).not.toHaveBeenCalled();
|
|
5112
4882
|
});
|
|
5113
4883
|
|
|
5114
|
-
test('reboots a legacy App only after the direct update endpoint is explicitly unavailable', async () => {
|
|
5115
|
-
const method = new FirmwareUpdateV4({
|
|
5116
|
-
id: 1,
|
|
5117
|
-
payload: {
|
|
5118
|
-
method: 'firmwareUpdateV4',
|
|
5119
|
-
},
|
|
5120
|
-
});
|
|
5121
|
-
const targets = [{ target_id: 4, path: 'vol0:/application_p1.bin' }];
|
|
5122
|
-
const appTypedCall = jest
|
|
5123
|
-
.fn()
|
|
5124
|
-
.mockRejectedValueOnce(new Error('Failure_InvalidMessage,Handler not registered'));
|
|
5125
|
-
const bootloaderTypedCall = jest
|
|
5126
|
-
.fn()
|
|
5127
|
-
.mockResolvedValueOnce({ type: 'Success', message: { message: '' } });
|
|
5128
|
-
let activeCommands = { typedCall: appTypedCall };
|
|
5129
|
-
|
|
5130
|
-
(method as any).device = stubDevice({
|
|
5131
|
-
getCommands: () => activeCommands,
|
|
5132
|
-
});
|
|
5133
|
-
(method as any).protocolV2LegacyDirectUpdate = true;
|
|
5134
|
-
(method as any).rebootProtocolV2ToBootloader = jest.fn().mockImplementation(() => {
|
|
5135
|
-
activeCommands = { typedCall: bootloaderTypedCall };
|
|
5136
|
-
return Promise.resolve(true);
|
|
5137
|
-
});
|
|
5138
|
-
method.postTipMessage = jest.fn();
|
|
5139
|
-
method.postProgressMessage = jest.fn();
|
|
5140
|
-
|
|
5141
|
-
await expect((method as any).protocolV2StartFirmwareUpdate({ targets })).resolves.toEqual({
|
|
5142
|
-
type: 'Success',
|
|
5143
|
-
message: { message: '' },
|
|
5144
|
-
});
|
|
5145
|
-
|
|
5146
|
-
expect(appTypedCall).toHaveBeenCalledTimes(1);
|
|
5147
|
-
expect(appTypedCall).toHaveBeenCalledWith(
|
|
5148
|
-
'DeviceFirmwareUpdateRequest',
|
|
5149
|
-
'Success',
|
|
5150
|
-
{ targets },
|
|
5151
|
-
{ timeoutMs: 180000 }
|
|
5152
|
-
);
|
|
5153
|
-
expect(bootloaderTypedCall).toHaveBeenCalledTimes(1);
|
|
5154
|
-
expect(bootloaderTypedCall).toHaveBeenCalledWith(
|
|
5155
|
-
'DeviceFirmwareUpdateRequest',
|
|
5156
|
-
'Success',
|
|
5157
|
-
{ targets },
|
|
5158
|
-
{ timeoutMs: 180000 }
|
|
5159
|
-
);
|
|
5160
|
-
expect((method as any).rebootProtocolV2ToBootloader).toHaveBeenCalledTimes(1);
|
|
5161
|
-
expect(method.postTipMessage).toHaveBeenCalledWith('FirmwareUpdating');
|
|
5162
|
-
expect(method.postProgressMessage).toHaveBeenCalledWith(0, 'installingFirmware');
|
|
5163
|
-
});
|
|
5164
|
-
|
|
5165
|
-
test('does not replay a legacy direct update after a link failure', async () => {
|
|
5166
|
-
const method = new FirmwareUpdateV4({
|
|
5167
|
-
id: 1,
|
|
5168
|
-
payload: {
|
|
5169
|
-
method: 'firmwareUpdateV4',
|
|
5170
|
-
},
|
|
5171
|
-
});
|
|
5172
|
-
const typedCall = jest.fn().mockRejectedValue(new Error('LIBUSB_TRANSFER_TIMED_OUT'));
|
|
5173
|
-
|
|
5174
|
-
(method as any).device = stubDevice({
|
|
5175
|
-
getCommands: () => ({ typedCall }),
|
|
5176
|
-
});
|
|
5177
|
-
(method as any).protocolV2LegacyDirectUpdate = true;
|
|
5178
|
-
(method as any).rebootProtocolV2ToBootloader = jest.fn();
|
|
5179
|
-
method.postTipMessage = jest.fn();
|
|
5180
|
-
method.postProgressMessage = jest.fn();
|
|
5181
|
-
|
|
5182
|
-
await expect(
|
|
5183
|
-
(method as any).protocolV2StartFirmwareUpdate({
|
|
5184
|
-
targets: [{ target_id: 4, path: 'vol0:/application_p1.bin' }],
|
|
5185
|
-
})
|
|
5186
|
-
).rejects.toThrow('LIBUSB_TRANSFER_TIMED_OUT');
|
|
5187
|
-
|
|
5188
|
-
expect(typedCall).toHaveBeenCalledTimes(1);
|
|
5189
|
-
expect((method as any).rebootProtocolV2ToBootloader).not.toHaveBeenCalled();
|
|
5190
|
-
expect(method.postTipMessage).not.toHaveBeenCalled();
|
|
5191
|
-
expect(method.postProgressMessage).not.toHaveBeenCalled();
|
|
5192
|
-
});
|
|
5193
|
-
|
|
5194
4884
|
test('polls only firmware status while Protocol V2 bootloader is installing', async () => {
|
|
5195
4885
|
const method = new FirmwareUpdateV4({
|
|
5196
4886
|
id: 1,
|
|
@@ -5319,9 +5009,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
5319
5009
|
(method as any).device = stubDevice({ probeProtocolV2RuntimeState });
|
|
5320
5010
|
|
|
5321
5011
|
await expect((method as any).probeProtocolV2NormalMode(deviceInfo)).resolves.toBe(expected);
|
|
5322
|
-
expect(probeProtocolV2RuntimeState).toHaveBeenCalledWith(deviceInfo, 5000
|
|
5323
|
-
allowLegacyProtocolV2ProtocolInfo: true,
|
|
5324
|
-
});
|
|
5012
|
+
expect(probeProtocolV2RuntimeState).toHaveBeenCalledWith(deviceInfo, 5000);
|
|
5325
5013
|
});
|
|
5326
5014
|
|
|
5327
5015
|
test('keeps polling when the firmware status handler is missing in loader mode', async () => {
|
|
@@ -48,10 +48,7 @@ describe('live device state reads', () => {
|
|
|
48
48
|
|
|
49
49
|
await method.run();
|
|
50
50
|
|
|
51
|
-
expect(getDeviceState).toHaveBeenCalledWith({
|
|
52
|
-
refreshSections: [...refreshSections],
|
|
53
|
-
...(scope === 'firmware' ? { allowLegacyProtocolV2ProtocolInfo: true } : {}),
|
|
54
|
-
});
|
|
51
|
+
expect(getDeviceState).toHaveBeenCalledWith({ refreshSections: [...refreshSections] });
|
|
55
52
|
});
|
|
56
53
|
|
|
57
54
|
test.each(['bootloader', 'romloader'] as const)(
|
|
@@ -94,7 +94,6 @@ describe('SearchDevices', () => {
|
|
|
94
94
|
connectProtocol: undefined,
|
|
95
95
|
forceProtocolDetection: true,
|
|
96
96
|
refreshRuntimeState: true,
|
|
97
|
-
allowLegacyProtocolV2ProtocolInfo: true,
|
|
98
97
|
}
|
|
99
98
|
);
|
|
100
99
|
expect(mockGetDevices).toHaveBeenNthCalledWith(
|
|
@@ -105,43 +104,48 @@ describe('SearchDevices', () => {
|
|
|
105
104
|
connectProtocol: undefined,
|
|
106
105
|
forceProtocolDetection: true,
|
|
107
106
|
refreshRuntimeState: true,
|
|
108
|
-
allowLegacyProtocolV2ProtocolInfo: true,
|
|
109
107
|
}
|
|
110
108
|
);
|
|
111
109
|
});
|
|
112
110
|
|
|
113
|
-
test(
|
|
114
|
-
|
|
111
|
+
test.each([
|
|
112
|
+
['OneKey Pro', 'pro'],
|
|
113
|
+
['OneKey Pro 2', 'pro2'],
|
|
114
|
+
])(
|
|
115
|
+
'BLE discovery keeps the %s transport identity separate from device identity',
|
|
116
|
+
async (name, deviceType) => {
|
|
117
|
+
mockIsBleConnect.mockReturnValue(true);
|
|
115
118
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
119
|
+
const descriptor = {
|
|
120
|
+
id: 'ble-peripheral-id',
|
|
121
|
+
path: 'ble-peripheral-id',
|
|
122
|
+
name,
|
|
123
|
+
commType: 'ble',
|
|
124
|
+
};
|
|
125
|
+
const method = new SearchDevices({
|
|
126
|
+
id: 1,
|
|
127
|
+
payload: {
|
|
128
|
+
method: 'searchDevices',
|
|
129
|
+
},
|
|
130
|
+
} as any);
|
|
131
|
+
method.init();
|
|
132
|
+
method.connector = {
|
|
133
|
+
enumerate: jest.fn().mockResolvedValue({
|
|
134
|
+
descriptors: [descriptor],
|
|
135
|
+
}),
|
|
136
|
+
} as any;
|
|
134
137
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
138
|
+
await expect(method.run()).resolves.toEqual([
|
|
139
|
+
{
|
|
140
|
+
...descriptor,
|
|
141
|
+
connectId: 'ble-peripheral-id',
|
|
142
|
+
serialNo: null,
|
|
143
|
+
uuid: '',
|
|
144
|
+
deviceId: null,
|
|
145
|
+
deviceType,
|
|
146
|
+
},
|
|
147
|
+
]);
|
|
148
|
+
expect(mockGetDevices).not.toHaveBeenCalled();
|
|
149
|
+
}
|
|
150
|
+
);
|
|
147
151
|
});
|
|
@@ -11,7 +11,6 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
11
11
|
getSupportedProtocols(): readonly ["V2"];
|
|
12
12
|
private protocolV2PreparedSources;
|
|
13
13
|
private protocolV2ExecutionInLoader;
|
|
14
|
-
private protocolV2LegacyDirectUpdate;
|
|
15
14
|
private protocolV2BootResourceStagingSafe;
|
|
16
15
|
private protocolV2CompletedTargetVersions;
|
|
17
16
|
private protocolV2LatestFinalFeatures?;
|
|
@@ -59,8 +58,6 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
59
58
|
private isProtocolV2ResourceBundleUpToDate;
|
|
60
59
|
private isProtocolV2BootloaderMode;
|
|
61
60
|
private isProtocolV2RomloaderMode;
|
|
62
|
-
private isLegacyProtocolV2Runtime;
|
|
63
|
-
private rebootProtocolV2ToBootloader;
|
|
64
61
|
enterProtocolV2BootloaderMode(): Promise<boolean>;
|
|
65
62
|
private waitForProtocolV2BootloaderMode;
|
|
66
63
|
private collectExplicitTargetBinaries;
|
|
@@ -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;AAyBlG,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"FirmwareUpdateV4.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,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AM,cAAc,CAAC;AAG1C,OAAO,KAAK,EAAoB,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAU1F,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CACpD,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,CAC9C;IACC,qBAAqB;IAIrB,IAAI;IAmBE,GAAG;
|
|
1
|
+
{"version":3,"file":"GetDeviceState.d.ts","sourceRoot":"","sources":["../../src/api/GetDeviceState.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,KAAK,EAAoB,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAU1F,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CACpD,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,CAC9C;IACC,qBAAqB;IAIrB,IAAI;IAmBE,GAAG;CAgBV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchDevices.d.ts","sourceRoot":"","sources":["../../src/api/SearchDevices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,OAAO,KAAK,eAAe,MAAM,2BAA2B,CAAC;AAI7D,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU;IACnD,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B,IAAI;IAME,GAAG;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"SearchDevices.d.ts","sourceRoot":"","sources":["../../src/api/SearchDevices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,OAAO,KAAK,eAAe,MAAM,2BAA2B,CAAC;AAI7D,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU;IACnD,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B,IAAI;IAME,GAAG;;;;;;;;;;;;;;;CA8DV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadPortfolio.d.ts","sourceRoot":"","sources":["../../src/api/UploadPortfolio.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UploadPortfolio.d.ts","sourceRoot":"","sources":["../../src/api/UploadPortfolio.ts"],"names":[],"mappings":"AAGA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,EAAE,WAAW,GAAG,UAAU,GAAG,IAAI,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B,CAAC;AAOF,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,SAAS;IACpD,IAAI;IAmBE,GAAG;;;;;;;;CAsBV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocolV2Release.d.ts","sourceRoot":"","sources":["../../../src/api/firmware/protocolV2Release.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA6B,MAAM,qBAAqB,CAAC;AAI/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EACV,WAAW,EACX,QAAQ,EACR,oBAAoB,EACpB,kCAAkC,EACnC,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,0BAA0B,EAC1B,8BAA8B,EAE/B,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAEhF,eAAO,MAAM,iCAAiC,EAAE,SAAS,kCAAkC,EAO1F,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,SAAS,kCAAkC,EAEhF,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,SAAS,kCAAkC,EAEvF,CAAC;AAEF,MAAM,MAAM,gCAA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2NftImage } from '../../utils/pro2Nft';
|
|
1
2
|
import { BaseMethod } from '../BaseMethod';
|
|
2
3
|
export type DeviceUploadNftParams = {
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
image: Pro2NftImage;
|
|
5
|
+
thumbnail: Pro2NftImage;
|
|
5
6
|
title: string;
|
|
6
7
|
subtitle: string;
|
|
7
8
|
timestampMs?: number;
|
|
@@ -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":"AAIA,OAAO,EASL,KAAK,YAAY,EAGlB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,YAAY,CAAC;IACxB,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;YAkCU,kBAAkB;YAiBlB,qBAAqB;YAwBrB,SAAS;IASjB,GAAG,IAAI,OAAO,CAAC,uBAAuB,CAAC;CA0D9C"}
|