@onekeyfe/hd-core 1.2.0-alpha.47 → 1.2.0-alpha.49

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.
Files changed (62) hide show
  1. package/__tests__/check-all-firmware-release-protocol-v2.test.ts +110 -15
  2. package/__tests__/device-lifecycle-events.test.ts +105 -3
  3. package/__tests__/method-protocol-support.test.ts +19 -0
  4. package/__tests__/protocol-binding.test.ts +89 -0
  5. package/__tests__/protocol-v2-resources.test.ts +87 -42
  6. package/__tests__/protocol-v2.test.ts +347 -40
  7. package/__tests__/search-devices.test.ts +12 -3
  8. package/dist/api/CheckAllFirmwareRelease.d.ts.map +1 -1
  9. package/dist/api/DetectDeviceConnectProtocol.d.ts +7 -0
  10. package/dist/api/DetectDeviceConnectProtocol.d.ts.map +1 -0
  11. package/dist/api/FirmwareUpdate.d.ts.map +1 -1
  12. package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
  13. package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
  14. package/dist/api/FirmwareUpdateV4.d.ts +1 -0
  15. package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
  16. package/dist/api/SearchDevices.d.ts.map +1 -1
  17. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
  18. package/dist/api/firmware/uploadFirmware.d.ts.map +1 -1
  19. package/dist/api/index.d.ts +1 -0
  20. package/dist/api/index.d.ts.map +1 -1
  21. package/dist/core/index.d.ts.map +1 -1
  22. package/dist/device/Device.d.ts +5 -1
  23. package/dist/device/Device.d.ts.map +1 -1
  24. package/dist/device/DevicePool.d.ts.map +1 -1
  25. package/dist/index.d.ts +20 -3
  26. package/dist/index.js +361 -203
  27. package/dist/inject.d.ts +6 -1
  28. package/dist/inject.d.ts.map +1 -1
  29. package/dist/lowLevelInject.d.ts.map +1 -1
  30. package/dist/protocols/protocol-v2/resources.d.ts +4 -4
  31. package/dist/protocols/protocol-v2/resources.d.ts.map +1 -1
  32. package/dist/topLevelInject.d.ts.map +1 -1
  33. package/dist/types/api/detectDeviceConnectProtocol.d.ts +4 -0
  34. package/dist/types/api/detectDeviceConnectProtocol.d.ts.map +1 -0
  35. package/dist/types/api/index.d.ts +4 -0
  36. package/dist/types/api/index.d.ts.map +1 -1
  37. package/dist/types/params.d.ts +1 -0
  38. package/dist/types/params.d.ts.map +1 -1
  39. package/dist/utils/patch.d.ts +1 -1
  40. package/dist/utils/patch.d.ts.map +1 -1
  41. package/package.json +4 -4
  42. package/src/api/CheckAllFirmwareRelease.ts +10 -9
  43. package/src/api/DetectDeviceConnectProtocol.ts +18 -0
  44. package/src/api/FirmwareUpdate.ts +6 -2
  45. package/src/api/FirmwareUpdateV2.ts +5 -2
  46. package/src/api/FirmwareUpdateV3.ts +6 -2
  47. package/src/api/FirmwareUpdateV4.ts +73 -43
  48. package/src/api/SearchDevices.ts +3 -1
  49. package/src/api/firmware/FirmwareUpdateBaseMethod.ts +15 -4
  50. package/src/api/firmware/uploadFirmware.ts +17 -4
  51. package/src/api/index.ts +1 -0
  52. package/src/core/index.ts +11 -2
  53. package/src/data/messages/messages-protocol-v2.json +0 -43
  54. package/src/device/Device.ts +53 -15
  55. package/src/device/DevicePool.ts +7 -2
  56. package/src/inject.ts +57 -2
  57. package/src/lowLevelInject.ts +6 -3
  58. package/src/protocols/protocol-v2/resources.ts +150 -56
  59. package/src/topLevelInject.ts +6 -3
  60. package/src/types/api/detectDeviceConnectProtocol.ts +7 -0
  61. package/src/types/api/index.ts +11 -0
  62. package/src/types/params.ts +7 -1
@@ -76,6 +76,7 @@ import {
76
76
  requestProtocolV2ProtocolInfo,
77
77
  supportsProtocolV2Message,
78
78
  } from '../src/protocols/protocol-v2/features';
79
+ import { PROTOCOL_V2_RESOURCE_DEVICE_PATHS } from '../src/protocols/protocol-v2/resources';
79
80
  import {
80
81
  getProtocolV2WalletSession,
81
82
  refreshProtocolV2DeviceStatus,
@@ -3922,6 +3923,68 @@ describe('Protocol V2 firmware update targets', () => {
3922
3923
  });
3923
3924
  });
3924
3925
 
3926
+ test('enters Protocol V2 bootloader before reading and downloading remote resources', async () => {
3927
+ const method = new FirmwareUpdateV4({
3928
+ id: 1,
3929
+ payload: {
3930
+ method: 'firmwareUpdateV4',
3931
+ platform: 'web',
3932
+ targetsToUpdate: ['resource'],
3933
+ },
3934
+ });
3935
+ method.init();
3936
+
3937
+ (method as any).device = stubDevice({
3938
+ originalDescriptor: { id: 'usb-id', path: 'app-path', protocolType: 'V2' },
3939
+ features: {
3940
+ deviceType: 'pro2',
3941
+ firmwareVersion: '1.0.0',
3942
+ mode: 'normal',
3943
+ bootloaderMode: false,
3944
+ capabilities: [],
3945
+ },
3946
+ isBootloader: () => false,
3947
+ isRomloader: () => false,
3948
+ });
3949
+ (method as any).captureProtocolV2PhysicalIdentity = jest.fn().mockResolvedValue(undefined);
3950
+ (method as any).prepareRemoteProtocolV2Binaries = jest.fn().mockResolvedValue({
3951
+ bootloaderBinary: null,
3952
+ fwBinaryMap: [],
3953
+ installItems: [],
3954
+ });
3955
+
3956
+ const order: string[] = [];
3957
+ (method as any).enterProtocolV2BootloaderMode = jest.fn().mockImplementation(() => {
3958
+ order.push('enter-bootloader');
3959
+ return Promise.resolve(true);
3960
+ });
3961
+ (method as any).prepareProtocolV2ResourceBundles = jest.fn().mockImplementation(() => {
3962
+ order.push('prepare-resources');
3963
+ return Promise.resolve([
3964
+ {
3965
+ name: 'images.okpkg',
3966
+ binary: new Uint8Array([1]).buffer,
3967
+ devicePath: 'vol0:/bundles/images/images.okpkg',
3968
+ },
3969
+ ]);
3970
+ });
3971
+ (method as any).executeProtocolV2Update = jest.fn().mockImplementation(() => {
3972
+ order.push('execute-update');
3973
+ return Promise.resolve();
3974
+ });
3975
+ (method as any).exitProtocolV2BootloaderToNormal = jest.fn().mockResolvedValue(undefined);
3976
+ (method as any).waitForProtocolV2FinalFeatures = jest.fn().mockResolvedValue({
3977
+ bootloaderVersion: '1.0.0',
3978
+ bleVersion: '1.0.0',
3979
+ firmwareVersion: '1.0.0',
3980
+ });
3981
+ method.postTipMessage = jest.fn();
3982
+
3983
+ await method.run();
3984
+
3985
+ expect(order).toEqual(['enter-bootloader', 'prepare-resources', 'execute-update']);
3986
+ });
3987
+
3925
3988
  test('reboots Protocol V2 normal-mode device to bootloader before transfer', async () => {
3926
3989
  const method = new FirmwareUpdateV4({
3927
3990
  id: 1,
@@ -3971,6 +4034,33 @@ describe('Protocol V2 firmware update targets', () => {
3971
4034
  expect(reconnectProtocolV2Device).toHaveBeenCalledTimes(1);
3972
4035
  });
3973
4036
 
4037
+ test('keeps Protocol V2 bootloader active before firmware transfer', async () => {
4038
+ const method = new FirmwareUpdateV4({
4039
+ id: 1,
4040
+ payload: {
4041
+ method: 'firmwareUpdateV4',
4042
+ },
4043
+ });
4044
+ (method as any).device = stubDevice({
4045
+ originalDescriptor: { id: 'usb-id', path: 'bootloader-path', protocolType: 'V2' },
4046
+ features: {
4047
+ deviceType: 'pro2',
4048
+ mode: 'bootloader',
4049
+ bootloaderMode: true,
4050
+ capabilities: [],
4051
+ },
4052
+ isBootloader: () => true,
4053
+ isRomloader: () => false,
4054
+ });
4055
+ (method as any).protocolV2Reboot = jest.fn();
4056
+ method.postTipMessage = jest.fn();
4057
+
4058
+ await expect((method as any).enterProtocolV2BootloaderMode()).resolves.toBe(false);
4059
+
4060
+ expect((method as any).protocolV2Reboot).not.toHaveBeenCalled();
4061
+ expect(method.postTipMessage).not.toHaveBeenCalledWith('AutoRebootToBootloader');
4062
+ });
4063
+
3974
4064
  test('keeps Protocol V2 romloader active before firmware transfer', async () => {
3975
4065
  const method = new FirmwareUpdateV4({
3976
4066
  id: 1,
@@ -4038,7 +4128,7 @@ describe('Protocol V2 firmware update targets', () => {
4038
4128
 
4039
4129
  await method.run();
4040
4130
 
4041
- expect(prepareResourceBundles).toHaveBeenCalledWith(true);
4131
+ expect(prepareResourceBundles).not.toHaveBeenCalled();
4042
4132
  expect((method as any).protocolV2Reboot).not.toHaveBeenCalled();
4043
4133
  expect((method as any).executeProtocolV2Update).toHaveBeenCalledWith({
4044
4134
  bootloaderBinary: null,
@@ -4121,7 +4211,10 @@ describe('Protocol V2 firmware update targets', () => {
4121
4211
  getCommands: () => commands,
4122
4212
  mainId: 'usb-path',
4123
4213
  });
4124
- const cachedDevice = { getConnectId: () => 'usb-path' };
4214
+ const cachedDevice = {
4215
+ getConnectId: () => 'usb-path',
4216
+ getCurrentSerialNo: () => '',
4217
+ };
4125
4218
  const getDevices = jest.spyOn(DevicePool, 'getDevices').mockResolvedValue({
4126
4219
  devices: {},
4127
4220
  deviceList: [cachedDevice],
@@ -4138,6 +4231,182 @@ describe('Protocol V2 firmware update targets', () => {
4138
4231
  expect(initialize).not.toHaveBeenCalled();
4139
4232
  });
4140
4233
 
4234
+ test('selects the matching physical device from multiple Protocol V2 USB reconnect candidates', async () => {
4235
+ const method = new FirmwareUpdateV4({
4236
+ id: 1,
4237
+ payload: {
4238
+ method: 'firmwareUpdateV4',
4239
+ },
4240
+ });
4241
+ const commands = { disposed: true, mainId: '' };
4242
+ const updateFromCache = jest.fn();
4243
+ const device = stubDevice({
4244
+ originalDescriptor: { id: 'old-usb-id', path: 'old-usb-path', protocolType: 'V2' },
4245
+ deviceConnector: {
4246
+ enumerate: jest.fn().mockResolvedValue({
4247
+ descriptors: [
4248
+ { id: 'usb-a', path: 'usb-a', protocolType: 'V2' },
4249
+ { id: 'usb-b', path: 'usb-b', protocolType: 'V2' },
4250
+ ],
4251
+ }),
4252
+ },
4253
+ updateFromCache,
4254
+ hasDeviceAcquire: jest.fn(() => false),
4255
+ acquire: jest.fn().mockResolvedValue(undefined),
4256
+ commands,
4257
+ getCommands: () => commands,
4258
+ mainId: 'old-usb-path',
4259
+ });
4260
+ const otherDevice = {
4261
+ getConnectId: () => 'usb-a',
4262
+ getCurrentSerialNo: () => 'PRO2-PHYSICAL-A',
4263
+ };
4264
+ const expectedDevice = {
4265
+ getConnectId: () => 'usb-b',
4266
+ getCurrentSerialNo: () => 'PRO2-PHYSICAL-B',
4267
+ };
4268
+ const getDevices = jest.spyOn(DevicePool, 'getDevices').mockResolvedValue({
4269
+ devices: {},
4270
+ deviceList: [otherDevice, expectedDevice],
4271
+ } as any);
4272
+ (method as any).device = device;
4273
+ (method as any).protocolV2ExpectedSerialNumber = 'PRO2-PHYSICAL-B';
4274
+
4275
+ try {
4276
+ await (method as any).reconnectProtocolV2Device();
4277
+ } finally {
4278
+ getDevices.mockRestore();
4279
+ }
4280
+
4281
+ expect(updateFromCache).toHaveBeenCalledWith(expectedDevice);
4282
+ });
4283
+
4284
+ test('rejects ambiguous Protocol V2 USB reconnect candidates without an identity match', async () => {
4285
+ const method = new FirmwareUpdateV4({
4286
+ id: 1,
4287
+ payload: {
4288
+ method: 'firmwareUpdateV4',
4289
+ },
4290
+ });
4291
+ const updateFromCache = jest.fn();
4292
+ const device = stubDevice({
4293
+ originalDescriptor: { id: 'old-usb-id', path: 'old-usb-path', protocolType: 'V2' },
4294
+ deviceConnector: {
4295
+ enumerate: jest.fn().mockResolvedValue({
4296
+ descriptors: [
4297
+ { id: 'usb-a', path: 'usb-a', protocolType: 'V2' },
4298
+ { id: 'usb-b', path: 'usb-b', protocolType: 'V2' },
4299
+ ],
4300
+ }),
4301
+ },
4302
+ updateFromCache,
4303
+ });
4304
+ const getDevices = jest.spyOn(DevicePool, 'getDevices').mockResolvedValue({
4305
+ devices: {},
4306
+ deviceList: [
4307
+ {
4308
+ getConnectId: () => 'usb-a',
4309
+ getCurrentSerialNo: () => 'PRO2-PHYSICAL-A',
4310
+ },
4311
+ {
4312
+ getConnectId: () => 'usb-b',
4313
+ getCurrentSerialNo: () => 'PRO2-PHYSICAL-B',
4314
+ },
4315
+ ],
4316
+ } as any);
4317
+ (method as any).device = device;
4318
+ (method as any).protocolV2ExpectedSerialNumber = 'PRO2-PHYSICAL-C';
4319
+
4320
+ try {
4321
+ await expect((method as any).reconnectProtocolV2Device()).rejects.toBeDefined();
4322
+ } finally {
4323
+ getDevices.mockRestore();
4324
+ }
4325
+
4326
+ expect(updateFromCache).not.toHaveBeenCalled();
4327
+ });
4328
+
4329
+ test('allows a single Protocol V2 USB reconnect candidate when its physical serial is unavailable', async () => {
4330
+ const method = new FirmwareUpdateV4({
4331
+ id: 1,
4332
+ payload: {
4333
+ method: 'firmwareUpdateV4',
4334
+ },
4335
+ });
4336
+ const commands = { disposed: true, mainId: '' };
4337
+ const updateFromCache = jest.fn();
4338
+ const device = stubDevice({
4339
+ originalDescriptor: { id: 'old-usb-id', path: 'old-usb-path', protocolType: 'V2' },
4340
+ deviceConnector: {
4341
+ enumerate: jest.fn().mockResolvedValue({
4342
+ descriptors: [{ id: 'usb-a', path: 'usb-a', protocolType: 'V2' }],
4343
+ }),
4344
+ },
4345
+ updateFromCache,
4346
+ hasDeviceAcquire: jest.fn(() => false),
4347
+ acquire: jest.fn().mockResolvedValue(undefined),
4348
+ commands,
4349
+ getCommands: () => commands,
4350
+ mainId: 'old-usb-path',
4351
+ });
4352
+ const candidate = {
4353
+ getConnectId: () => 'usb-a',
4354
+ getCurrentSerialNo: () => '',
4355
+ };
4356
+ const getDevices = jest.spyOn(DevicePool, 'getDevices').mockResolvedValue({
4357
+ devices: {},
4358
+ deviceList: [candidate],
4359
+ } as any);
4360
+ (method as any).device = device;
4361
+ (method as any).protocolV2ExpectedSerialNumber = 'PRO2-PHYSICAL-A';
4362
+
4363
+ try {
4364
+ await (method as any).reconnectProtocolV2Device();
4365
+ } finally {
4366
+ getDevices.mockRestore();
4367
+ }
4368
+
4369
+ expect(updateFromCache).toHaveBeenCalledWith(candidate);
4370
+ });
4371
+
4372
+ test('rejects a single Protocol V2 USB reconnect candidate with a different physical serial', async () => {
4373
+ const method = new FirmwareUpdateV4({
4374
+ id: 1,
4375
+ payload: {
4376
+ method: 'firmwareUpdateV4',
4377
+ },
4378
+ });
4379
+ const updateFromCache = jest.fn();
4380
+ const device = stubDevice({
4381
+ originalDescriptor: { id: 'old-usb-id', path: 'old-usb-path', protocolType: 'V2' },
4382
+ deviceConnector: {
4383
+ enumerate: jest.fn().mockResolvedValue({
4384
+ descriptors: [{ id: 'usb-a', path: 'usb-a', protocolType: 'V2' }],
4385
+ }),
4386
+ },
4387
+ updateFromCache,
4388
+ });
4389
+ const getDevices = jest.spyOn(DevicePool, 'getDevices').mockResolvedValue({
4390
+ devices: {},
4391
+ deviceList: [
4392
+ {
4393
+ getConnectId: () => 'usb-a',
4394
+ getCurrentSerialNo: () => 'PRO2-PHYSICAL-A',
4395
+ },
4396
+ ],
4397
+ } as any);
4398
+ (method as any).device = device;
4399
+ (method as any).protocolV2ExpectedSerialNumber = 'PRO2-PHYSICAL-B';
4400
+
4401
+ try {
4402
+ await expect((method as any).reconnectProtocolV2Device()).rejects.toBeDefined();
4403
+ } finally {
4404
+ getDevices.mockRestore();
4405
+ }
4406
+
4407
+ expect(updateFromCache).not.toHaveBeenCalled();
4408
+ });
4409
+
4141
4410
  test('reuses an acquired Protocol V2 USB session while polling reconnect readiness', async () => {
4142
4411
  const method = new FirmwareUpdateV4({
4143
4412
  id: 1,
@@ -5789,6 +6058,64 @@ describe('Protocol V2 firmware update method', () => {
5789
6058
  });
5790
6059
 
5791
6060
  describe('Protocol V2 firmware reconnect identity', () => {
6061
+ const createResourceFilesystemTypedCall = (
6062
+ stable: Array<{ type: string; size: number; headerHash: string }>,
6063
+ missingTypes: string[] = []
6064
+ ) => {
6065
+ const missing = new Set(missingTypes);
6066
+ const resourceByPath = new Map(
6067
+ stable.map(resource => [
6068
+ PROTOCOL_V2_RESOURCE_DEVICE_PATHS[
6069
+ resource.type as keyof typeof PROTOCOL_V2_RESOURCE_DEVICE_PATHS
6070
+ ],
6071
+ resource,
6072
+ ])
6073
+ );
6074
+ return jest.fn((requestType: string, _responseType: string, payload: Record<string, any>) => {
6075
+ if (requestType === 'ResourceInventoryGet') {
6076
+ throw new Error('ResourceInventoryGet is unavailable on released firmware');
6077
+ }
6078
+ if (requestType === 'FilesystemPathInfoQuery') {
6079
+ const resource = resourceByPath.get(payload.path);
6080
+ const exists = Boolean(resource && !missing.has(resource.type));
6081
+ return {
6082
+ message: {
6083
+ exist: exists,
6084
+ directory: false,
6085
+ size: exists ? resource?.size : 0,
6086
+ },
6087
+ };
6088
+ }
6089
+ if (requestType === 'FilesystemFileRead') {
6090
+ const resource = resourceByPath.get(payload.file.path);
6091
+ if (!resource || missing.has(resource.type)) throw new Error('missing resource');
6092
+ const header = new Uint8Array(0x52a0);
6093
+ const view = new DataView(header.buffer);
6094
+ 'OKPP'.split('').forEach((char, index) => {
6095
+ header[index] = char.charCodeAt(0);
6096
+ });
6097
+ 'RESC'.split('').forEach((char, index) => {
6098
+ header[0x08 + index] = char.charCodeAt(0);
6099
+ });
6100
+ view.setUint32(0x0c, header.byteLength, true);
6101
+ for (let index = 0; index < resource.headerHash.length / 2; index++) {
6102
+ header[0x240 + index] = Number.parseInt(
6103
+ resource.headerHash.slice(index * 2, index * 2 + 2),
6104
+ 16
6105
+ );
6106
+ }
6107
+ const offset = Number(payload.file.offset);
6108
+ const chunkLength = Number(payload.chunk_len);
6109
+ return {
6110
+ message: {
6111
+ data: header.slice(offset, offset + chunkLength),
6112
+ },
6113
+ };
6114
+ }
6115
+ throw new Error(`Unexpected request: ${requestType}`);
6116
+ });
6117
+ };
6118
+
5792
6119
  test('rejects a different physical serial before firmware transfer resumes', () => {
5793
6120
  expect(() => assertProtocolV2ReconnectIdentity('expected-serial', 'other-serial')).toThrow(
5794
6121
  'identity mismatch'
@@ -5851,7 +6178,7 @@ describe('Protocol V2 firmware reconnect identity', () => {
5851
6178
  expect((method as any).protocolV2ExpectedSerialNumber).toBeUndefined();
5852
6179
  });
5853
6180
 
5854
- test('uses ResourceInventory instead of host-side FileRead for resource comparison', async () => {
6181
+ test('uses filesystem reads instead of ResourceInventoryGet for resource comparison', async () => {
5855
6182
  const method = new FirmwareUpdateV4({
5856
6183
  id: 1,
5857
6184
  payload: {
@@ -5865,20 +6192,12 @@ describe('Protocol V2 firmware reconnect identity', () => {
5865
6192
  (type, index) => ({
5866
6193
  type,
5867
6194
  url: `https://example.com/${type}.okpkg`,
5868
- size: index + 1,
6195
+ size: 0x52a0 + index + 1,
5869
6196
  fileHash: 'a'.repeat(64),
5870
6197
  headerHash: index.toString(16).padStart(128, '0'),
5871
6198
  })
5872
6199
  );
5873
- const typedCall = jest.fn().mockResolvedValue({
5874
- message: {
5875
- items: stable.map(item => ({
5876
- type: item.type.toUpperCase(),
5877
- size: item.size,
5878
- header_hash: item.headerHash,
5879
- })),
5880
- },
5881
- });
6200
+ const typedCall = createResourceFilesystemTypedCall(stable);
5882
6201
  (method as any).device = stubDevice({
5883
6202
  getCommands: () => ({ typedCall }),
5884
6203
  });
@@ -5887,19 +6206,14 @@ describe('Protocol V2 firmware reconnect identity', () => {
5887
6206
  .mockReturnValue(stable as any);
5888
6207
  (method as any).downloadProtocolV2Resource = jest.fn();
5889
6208
 
5890
- await expect((method as any).prepareProtocolV2ResourceBundles(false)).resolves.toEqual([]);
5891
- expect(typedCall).toHaveBeenCalledWith(
5892
- 'ResourceInventoryGet',
5893
- 'ResourceInventory',
5894
- {},
5895
- { timeoutMs: 5000 }
5896
- );
5897
- expect(typedCall.mock.calls.some(call => call[0] === 'FilesystemFileRead')).toBe(false);
6209
+ await expect((method as any).prepareProtocolV2ResourceBundles()).resolves.toEqual([]);
6210
+ expect(typedCall.mock.calls.some(call => call[0] === 'ResourceInventoryGet')).toBe(false);
6211
+ expect(typedCall.mock.calls.some(call => call[0] === 'FilesystemFileRead')).toBe(true);
5898
6212
  expect((method as any).downloadProtocolV2Resource).not.toHaveBeenCalled();
5899
6213
  resourcesSpy.mockRestore();
5900
6214
  });
5901
6215
 
5902
- test('downloads only changed resources in Application mode', async () => {
6216
+ test('downloads only changed resources from loader inventory', async () => {
5903
6217
  const method = new FirmwareUpdateV4({
5904
6218
  id: 1,
5905
6219
  payload: { method: 'firmwareUpdateV4', platform: 'web', targetsToUpdate: ['resource'] },
@@ -5909,20 +6223,12 @@ describe('Protocol V2 firmware reconnect identity', () => {
5909
6223
  (type, index) => ({
5910
6224
  type,
5911
6225
  url: `https://example.com/${type}.okpkg`,
5912
- size: index + 1,
6226
+ size: 0x52a0 + index + 1,
5913
6227
  fileHash: 'a'.repeat(64),
5914
6228
  headerHash: index.toString(16).padStart(128, '0'),
5915
6229
  })
5916
6230
  );
5917
- const typedCall = jest.fn().mockResolvedValue({
5918
- message: {
5919
- items: stable.slice(1).map(item => ({
5920
- type: item.type.toUpperCase(),
5921
- size: item.size,
5922
- header_hash: item.headerHash,
5923
- })),
5924
- },
5925
- });
6231
+ const typedCall = createResourceFilesystemTypedCall(stable, ['images']);
5926
6232
  (method as any).device = stubDevice({ getCommands: () => ({ typedCall }) });
5927
6233
  const resourcesSpy = jest
5928
6234
  .spyOn(DataManager, 'getProtocolV2Resources')
@@ -5935,14 +6241,14 @@ describe('Protocol V2 firmware reconnect identity', () => {
5935
6241
  })
5936
6242
  );
5937
6243
 
5938
- const bundles = await (method as any).prepareProtocolV2ResourceBundles(false);
6244
+ const bundles = await (method as any).prepareProtocolV2ResourceBundles();
5939
6245
 
5940
6246
  expect(bundles).toHaveLength(1);
5941
6247
  expect((method as any).downloadProtocolV2Resource).toHaveBeenCalledWith(stable[0]);
5942
6248
  resourcesSpy.mockRestore();
5943
6249
  });
5944
6250
 
5945
- test('downloads all six resources in Bootloader recovery without inventory RPC', async () => {
6251
+ test('uses filesystem inventory for incremental Bootloader recovery', async () => {
5946
6252
  const method = new FirmwareUpdateV4({
5947
6253
  id: 1,
5948
6254
  payload: { method: 'firmwareUpdateV4', platform: 'web', targetsToUpdate: ['resource'] },
@@ -5952,12 +6258,12 @@ describe('Protocol V2 firmware reconnect identity', () => {
5952
6258
  (type, index) => ({
5953
6259
  type,
5954
6260
  url: `https://example.com/${type}.okpkg`,
5955
- size: index + 1,
6261
+ size: 0x52a0 + index + 1,
5956
6262
  fileHash: 'a'.repeat(64),
5957
6263
  headerHash: index.toString(16).padStart(128, '0'),
5958
6264
  })
5959
6265
  );
5960
- const typedCall = jest.fn();
6266
+ const typedCall = createResourceFilesystemTypedCall(stable, ['images']);
5961
6267
  (method as any).device = stubDevice({ getCommands: () => ({ typedCall }) });
5962
6268
  const resourcesSpy = jest
5963
6269
  .spyOn(DataManager, 'getProtocolV2Resources')
@@ -5970,11 +6276,12 @@ describe('Protocol V2 firmware reconnect identity', () => {
5970
6276
  })
5971
6277
  );
5972
6278
 
5973
- const bundles = await (method as any).prepareProtocolV2ResourceBundles(true);
6279
+ const bundles = await (method as any).prepareProtocolV2ResourceBundles();
5974
6280
 
5975
- expect(bundles).toHaveLength(6);
5976
- expect(typedCall).not.toHaveBeenCalled();
5977
- expect((method as any).downloadProtocolV2Resource).toHaveBeenCalledTimes(6);
6281
+ expect(bundles).toHaveLength(1);
6282
+ expect(typedCall.mock.calls.some(call => call[0] === 'ResourceInventoryGet')).toBe(false);
6283
+ expect(typedCall.mock.calls.some(call => call[0] === 'FilesystemPathInfoQuery')).toBe(true);
6284
+ expect((method as any).downloadProtocolV2Resource).toHaveBeenCalledWith(stable[0]);
5978
6285
  resourcesSpy.mockRestore();
5979
6286
  });
5980
6287
 
@@ -42,7 +42,7 @@ describe('SearchDevices', () => {
42
42
  mockIsBleConnect.mockReturnValue(false);
43
43
  });
44
44
 
45
- test('单个 USB 描述符无响应时跳过该设备并继续搜索', async () => {
45
+ test('搜索忽略调用方协议并主动探测,单个无响应设备不阻断后续结果', async () => {
46
46
  const unresponsiveDescriptor = {
47
47
  path: 'stale-usb-device',
48
48
  id: 'stale-usb-device',
@@ -74,6 +74,7 @@ describe('SearchDevices', () => {
74
74
  id: 1,
75
75
  payload: {
76
76
  method: 'searchDevices',
77
+ connectProtocol: 'V2',
77
78
  },
78
79
  } as any);
79
80
  method.init();
@@ -89,13 +90,21 @@ describe('SearchDevices', () => {
89
90
  1,
90
91
  [unresponsiveDescriptor],
91
92
  unresponsiveDescriptor.path,
92
- { connectProtocol: undefined, refreshRuntimeState: true }
93
+ {
94
+ connectProtocol: undefined,
95
+ forceProtocolDetection: true,
96
+ refreshRuntimeState: true,
97
+ }
93
98
  );
94
99
  expect(mockGetDevices).toHaveBeenNthCalledWith(
95
100
  2,
96
101
  [availableDescriptor],
97
102
  availableDescriptor.path,
98
- { connectProtocol: undefined, refreshRuntimeState: true }
103
+ {
104
+ connectProtocol: undefined,
105
+ forceProtocolDetection: true,
106
+ refreshRuntimeState: true,
107
+ }
99
108
  );
100
109
  });
101
110
 
@@ -1 +1 @@
1
- {"version":3,"file":"CheckAllFirmwareRelease.d.ts","sourceRoot":"","sources":["../../src/api/CheckAllFirmwareRelease.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA6B,MAAM,qBAAqB,CAAC;AAY/E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,OAAO,KAAK,EACV,kBAAkB,EAElB,kCAAkC,EAClC,+BAA+B,EAChC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EAGrB,MAAM,UAAU,CAAC;AA6HlB,KAAK,6BAA6B,GAAG;IACnC,YAAY,EAAE,aAAa,CAAC;IAC5B,MAAM,EAAE,+BAA+B,CAAC;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,mBAAmB,CAAC;IACrC,UAAU,EAAE,kCAAkC,EAAE,CAAC;IACjD,eAAe,EAAE,sBAAsB,EAAE,CAAC;IAC1C,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAC3C,CAAC;AAEF,wBAAgB,8BAA8B,CAAC,EAC7C,eAAe,EACf,mBAAwB,EACxB,mBAAwB,EACxB,YAAY,EACZ,OAAO,GACR,EAAE;IACD,eAAe,EAAE,mBAAmB,CAAC;IACrC,mBAAmB,C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Ae,EAAE,mBAAmB,CAAC;IACrC,mBAAmB,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACpD,mBAAmB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAC9D,YAAY,EAAE,aAAa,CAAC;IAC5B,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAC3C,GAAG,6BAA6B,CAoEhC;AAED,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,UAAU;IAC7D,qBAAqB;IAIrB,IAAI;IAME,GAAG;YAuDK,aAAa;CAqF5B"}
@@ -0,0 +1,7 @@
1
+ import { BaseMethod } from './BaseMethod';
2
+ export default class DetectDeviceConnectProtocol extends BaseMethod {
3
+ init(): void;
4
+ getSupportedProtocols(): readonly ["V1", "V2"];
5
+ run(): Promise<"V1" | "V2">;
6
+ }
7
+ //# sourceMappingURL=DetectDeviceConnectProtocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DetectDeviceConnectProtocol.d.ts","sourceRoot":"","sources":["../../src/api/DetectDeviceConnectProtocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,UAAU;IACjE,IAAI;IAOJ,qBAAqB;IAIrB,GAAG;CAGJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"FirmwareUpdate.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdate.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAW1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,KAAK,MAAM,GAAG;IACZ,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC;CAChC,CAAC;AAIF,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,MAAM,CAAC;IAC5D,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAE1C,IAAI;IAgCJ,cAAc,YAAa,MAAM,UAS/B;IAEF,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS;IAsD/C,GAAG;CA+FV"}
1
+ {"version":3,"file":"FirmwareUpdate.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdate.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAW1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,KAAK,MAAM,GAAG;IACZ,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC;CAChC,CAAC;AAIF,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,MAAM,CAAC;IAC5D,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAE1C,IAAI;IAgCJ,cAAc,YAAa,MAAM,UAS/B;IAEF,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS;IA0D/C,GAAG;CA+FV"}
@@ -1 +1 @@
1
- {"version":3,"file":"FirmwareUpdateV2.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EAEb,KAAK,aAAa,EAKnB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAW1C,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,UAAU,CAAC;AAGtD,KAAK,MAAM,GAAG;IACZ,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,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"],"names":[],"mappings":"AAeA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAK/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAiB,MAAM,qBAAqB,CAAC;AAKnE,eAAO,MAAM,gCAAgC,UAAU,CAAC;AAaxD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,wBAAwB,CAAC,sBAAsB,CAAC;IAC5F,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAE1C,OAAO,CAAC,gBAAgB,CAAS;IAEjC,IAAI;IAmCE,GAAG;;;;;YAQK,aAAa;IA+C3B,OAAO,CAAC,wBAAwB;YAiBlB,qBAAqB;YAoBrB,uBAAuB;YAiBvB,2BAA2B;YAiD3B,aAAa;IA0M3B,OAAO,CAAC,yBAAyB;IAajC,OAAO,CAAC,yBAAyB;IAQjC,OAAO,CAAC,qBAAqB;IAmB7B,OAAO,CAAC,sCAAsC;IAexC,sBAAsB,CAAC,OAAO,EAAE,MAAM;CA2E7C"}
@@ -28,6 +28,7 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
28
28
  private prepareRemoteProtocolV2Binaries;
29
29
  private validateProtocolV2BootResourcesBinary;
30
30
  private prepareProtocolV2BootResources;
31
+ private prepareExplicitProtocolV2ResourceBundles;
31
32
  private prepareProtocolV2ResourceBundles;
32
33
  private downloadProtocolV2Resource;
33
34
  private syncProtocolV2ResourceBundles;
@@ -1 +1 @@
1
- {"version":3,"file":"FirmwareUpdateV4.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV4.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAkB/E,OAAO,KAAK,EAAE,sBAAsB,EAA0B,MAAM,6BAA6B,CAAC;AAiUlG,eAAO,MAAM,oCAAoC,WACvC,WAAW,GA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A+EvC,gCAAgC;YAQhC,yBAAyB;YAQzB,8BAA8B;IAQ5C,OAAO,CAAC,0BAA0B;YAiBpB,qCAAqC;YA2CrC,yBAAyB;YA8DzB,8BAA8B;IAU5C,OAAO,CAAC,kCAAkC;YAI5B,6BAA6B;YAwB7B,wBAAwB;IAoDtC,OAAO,CAAC,sCAAsC;YAchC,cAAc;YA+Bd,6BAA6B;YAW7B,0BAA0B;YAS1B,6BAA6B;YAmB7B,gBAAgB;IAiB9B,OAAO,CAAC,qBAAqB;CAM9B"}
@@ -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;;;;;;;;;;;;;;;CA4DV"}
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":"FirmwareUpdateBaseMethod.d.ts","sourceRoot":"","sources":["../../../src/api/firmware/FirmwareUpdateBaseMethod.ts"],"names":[],"mappings":";AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EACV,2BAA2B,EAC3B,yBAAyB,EAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,E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c,GAAG;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IA4CK,sBAAsB,CAC1B,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,WAAW,GAAG,MAAM,EAC3B,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,MAAM,GAAG,IAAI;IAgFnB,MAAM,CAAC,UAAU,EAAE,UAAU;CAsBpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"uploadFirmware.d.ts","sourceRoot":"","sources":["../../../src/api/firmware/uploadFirmware.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAwB,MAAM,6BAA6B,CAAC;AACnF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAA+B,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAiElD,eAAO,MAAM,cAAc,eAAsB,MAAM,kBAKtD,CAAC;AAEF,eAAO,MAAM,cAAc,eACb,UAAU,GAAG,KAAK,aACnB,SAAS,yBACG,WAAW,KAAK,IAAI,UACnC,MAAM;;wBAOO,OAAO,qBAoJ7B,CAAC;AA+NF,eAAO,MAAM,cAAc,cACd,SAAS,YACV,MAAM,QACV,WAAW,mBACA,MAAM,IAAI,qBAc5B,CAAC;AAEF,eAAO,MAAM,eAAe,cACf,SAAS,yBACG,WAAW,KAAK,IAAI,UACnC,MAAM,UACN,WAAW,qBAwBpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,cAChB,SAAS,yBACG,WAAW,KAAK,IAAI,UACnC,MAAM,UACN,WAAW,qBAUpB,CAAC"}
1
+ {"version":3,"file":"uploadFirmware.d.ts","sourceRoot":"","sources":["../../../src/api/firmware/uploadFirmware.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAwB,MAAM,6BAA6B,CAAC;AACnF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAA+B,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAiElD,eAAO,MAAM,cAAc,eAAsB,MAAM,kBAKtD,CAAC;AAEF,eAAO,MAAM,cAAc,eACb,UAAU,GAAG,KAAK,aACnB,SAAS,yBACG,WAAW,KAAK,IAAI,UACnC,MAAM;;wBAOO,OAAO,qBAoJ7B,CAAC;AA4OF,eAAO,MAAM,cAAc,cACd,SAAS,YACV,MAAM,QACV,WAAW,mBACA,MAAM,IAAI,qBAc5B,CAAC;AAEF,eAAO,MAAM,eAAe,cACf,SAAS,yBACG,WAAW,KAAK,IAAI,UACnC,MAAM,UACN,WAAW,qBAwBpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,cAChB,SAAS,yBACG,WAAW,KAAK,IAAI,UACnC,MAAM,UACN,WAAW,qBAUpB,CAAC"}
@@ -2,6 +2,7 @@ export { default as testInitializeDeviceDuration } from './test/TestInitializeDe
2
2
  export { default as testProtocolV2Ping } from './protocol-v2/Ping';
3
3
  export { default as preInitialize } from './device/PreInitialize';
4
4
  export { default as searchDevices } from './SearchDevices';
5
+ export { default as detectDeviceConnectProtocol } from './DetectDeviceConnectProtocol';
5
6
  export { default as getFeatures } from './GetFeatures';
6
7
  export { default as getDeviceState } from './GetDeviceState';
7
8
  export { default as getOnekeyFeatures } from './GetOnekeyFeatures';