@onekeyfe/hd-core 1.2.0-alpha.12 → 1.2.0-alpha.13

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 (42) hide show
  1. package/__tests__/protocol-v2-bootloader-mode.test.ts +37 -0
  2. package/__tests__/protocol-v2.test.ts +126 -52
  3. package/__tests__/protocolV2FileWrite.test.ts +12 -0
  4. package/dist/api/FirmwareUpdateV4.d.ts +2 -0
  5. package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
  6. package/dist/api/helpers/protocolV2FileWrite.d.ts.map +1 -1
  7. package/dist/api/index.d.ts +0 -1
  8. package/dist/api/index.d.ts.map +1 -1
  9. package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts.map +1 -1
  10. package/dist/api/protocol-v2/helpers.d.ts.map +1 -1
  11. package/dist/device/Device.d.ts.map +1 -1
  12. package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +1 -1
  13. package/dist/index.d.ts +4 -8
  14. package/dist/index.js +481 -145
  15. package/dist/inject.d.ts.map +1 -1
  16. package/dist/types/api/index.d.ts +1 -2
  17. package/dist/types/api/index.d.ts.map +1 -1
  18. package/dist/types/api/protocolV2.d.ts +0 -4
  19. package/dist/types/api/protocolV2.d.ts.map +1 -1
  20. package/dist/types/device.d.ts +2 -1
  21. package/dist/types/device.d.ts.map +1 -1
  22. package/dist/utils/patch.d.ts +1 -1
  23. package/dist/utils/patch.d.ts.map +1 -1
  24. package/package.json +4 -4
  25. package/src/api/FirmwareUpdateV4.ts +46 -6
  26. package/src/api/cardano/CardanoSignMessage.ts +1 -1
  27. package/src/api/cardano/CardanoSignTransaction.ts +1 -1
  28. package/src/api/helpers/protocolV2FileWrite.ts +10 -6
  29. package/src/api/index.ts +0 -1
  30. package/src/api/protocol-v2/DeviceUploadWallpaper.ts +9 -3
  31. package/src/api/protocol-v2/helpers.ts +0 -3
  32. package/src/data/messages/messages-protocol-v2.json +422 -16
  33. package/src/data/messages/messages.json +0 -8
  34. package/src/device/Device.ts +7 -17
  35. package/src/deviceProfile/buildDeviceFeatures.ts +8 -0
  36. package/src/inject.ts +0 -2
  37. package/src/types/api/index.ts +0 -2
  38. package/src/types/api/protocolV2.ts +0 -6
  39. package/src/types/device.ts +5 -1
  40. package/dist/api/protocol-v2/FilesystemDiskControl.d.ts +0 -13
  41. package/dist/api/protocol-v2/FilesystemDiskControl.d.ts.map +0 -1
  42. package/src/api/protocol-v2/FilesystemDiskControl.ts +0 -50
@@ -379,6 +379,25 @@ const parseProtocolV2OkppHeader = (bytes: Uint8Array): ProtocolV2OkppHeader | nu
379
379
  };
380
380
  };
381
381
 
382
+ export const assertProtocolV2ReconnectIdentity = (
383
+ expectedDeviceId?: string,
384
+ actualDeviceId?: string
385
+ ) => {
386
+ if (!expectedDeviceId) return;
387
+ if (!actualDeviceId) {
388
+ throw ERRORS.TypedError(
389
+ HardwareErrorCode.DeviceNotFound,
390
+ 'Protocol V2 reconnect identity unavailable'
391
+ );
392
+ }
393
+ if (actualDeviceId !== expectedDeviceId) {
394
+ throw ERRORS.TypedError(
395
+ HardwareErrorCode.DeviceNotFound,
396
+ `Protocol V2 reconnect identity mismatch: expected ${expectedDeviceId}, received ${actualDeviceId}`
397
+ );
398
+ }
399
+ };
400
+
382
401
  /**
383
402
  * FirmwareUpdateV4 is the complete Protocol V2 firmware update flow.
384
403
  *
@@ -388,6 +407,8 @@ const parseProtocolV2OkppHeader = (bytes: Uint8Array): ProtocolV2OkppHeader | nu
388
407
  * - completion waits for target status to finish, reboots to normal, then polls DeviceInfo
389
408
  */
390
409
  export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareUpdateV4Params> {
410
+ private protocolV2ExpectedDeviceId?: string;
411
+
391
412
  init() {
392
413
  this.allowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.NOT_INITIALIZE];
393
414
  this.requireDeviceMode = [];
@@ -476,6 +497,7 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
476
497
 
477
498
  private async runProtocolV2() {
478
499
  const deviceFeatures = await this.getProtocolV2DeviceFeatures();
500
+ this.protocolV2ExpectedDeviceId = deviceFeatures.deviceId ?? undefined;
479
501
  const deviceFirmwareType = getFirmwareType(deviceFeatures);
480
502
  const firmwareType = this.params.firmwareType ?? deviceFirmwareType;
481
503
 
@@ -917,6 +939,10 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
917
939
  timeoutMs: PROTOCOL_V2_SHORT_RESPONSE_TIMEOUT,
918
940
  });
919
941
  const features = this.device.updateProtocolV2Features(deviceInfo);
942
+ assertProtocolV2ReconnectIdentity(
943
+ this.protocolV2ExpectedDeviceId,
944
+ features.deviceId ?? undefined
945
+ );
920
946
  if (features?.bootloaderMode) {
921
947
  return features;
922
948
  }
@@ -1134,6 +1160,10 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
1134
1160
  request: PROTOCOL_V2_VERSIONS_DEVICE_INFO_REQUEST,
1135
1161
  });
1136
1162
  const features = this.device.updateProtocolV2Features(deviceInfo);
1163
+ assertProtocolV2ReconnectIdentity(
1164
+ this.protocolV2ExpectedDeviceId,
1165
+ features.deviceId ?? undefined
1166
+ );
1137
1167
  if (this.isProtocolV2NormalModeFeatures(features)) {
1138
1168
  Log.log('Protocol V2 firmware install finished; device is back in normal mode');
1139
1169
  return true;
@@ -1288,6 +1318,10 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
1288
1318
  request: PROTOCOL_V2_VERSIONS_DEVICE_INFO_REQUEST,
1289
1319
  });
1290
1320
  const features = this.device.updateProtocolV2Features(deviceInfo);
1321
+ assertProtocolV2ReconnectIdentity(
1322
+ this.protocolV2ExpectedDeviceId,
1323
+ features.deviceId ?? undefined
1324
+ );
1291
1325
  if (features.bootloaderMode || features.mode === 'bootloader') {
1292
1326
  throw ERRORS.TypedError(
1293
1327
  HardwareErrorCode.DeviceNotFound,
@@ -1334,6 +1368,10 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
1334
1368
  this.device.commands.disposed = false;
1335
1369
  this.device.getCommands().mainId = this.device.mainId ?? '';
1336
1370
  await this.device.initialize();
1371
+ assertProtocolV2ReconnectIdentity(
1372
+ this.protocolV2ExpectedDeviceId,
1373
+ this.device.getCurrentDeviceId()
1374
+ );
1337
1375
  return;
1338
1376
  }
1339
1377
 
@@ -1355,6 +1393,10 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
1355
1393
  this.device.commands.disposed = false;
1356
1394
  this.device.getCommands().mainId = this.device.mainId ?? '';
1357
1395
  await this.device.initialize();
1396
+ assertProtocolV2ReconnectIdentity(
1397
+ this.protocolV2ExpectedDeviceId,
1398
+ this.device.getCurrentDeviceId()
1399
+ );
1358
1400
  }
1359
1401
 
1360
1402
  private async protocolV2CommonUpdateProcess(params: ProtocolV2FileTransferParams) {
@@ -1416,12 +1458,10 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
1416
1458
  overwrite,
1417
1459
  progress
1418
1460
  );
1419
- const processedByte = Number(writeRes.message.processed_byte);
1420
- const nextOffset =
1421
- Number.isFinite(processedByte) && processedByte > offset
1422
- ? processedByte
1423
- : offset + chunkLength;
1424
- if (nextOffset <= offset || nextOffset > payload.byteLength) {
1461
+ const rawProcessedByte = writeRes.message.processed_byte;
1462
+ const processedByte = Number(rawProcessedByte);
1463
+ const nextOffset = rawProcessedByte === undefined ? offset + chunkLength : processedByte;
1464
+ if (!Number.isFinite(nextOffset) || nextOffset <= offset || nextOffset > chunkEnd) {
1425
1465
  throw ERRORS.TypedError(
1426
1466
  HardwareErrorCode.EmmcFileWriteFirmwareError,
1427
1467
  `invalid processed_byte ${writeRes.message.processed_byte} for offset ${offset}`
@@ -14,7 +14,7 @@ export default class CardanoSignMessage extends BaseMethod<CardanoSignMessagePar
14
14
  init() {
15
15
  this.checkDeviceId = true;
16
16
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
17
- this.allowUsePreInitialize = true;
17
+ this.allowUsePreInitialize = false;
18
18
 
19
19
  const { payload } = this;
20
20
  validateParams(payload, [
@@ -48,7 +48,7 @@ export default class CardanoSignTransaction extends BaseMethod<any> {
48
48
  init() {
49
49
  this.checkDeviceId = true;
50
50
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
51
- this.allowUsePreInitialize = true;
51
+ this.allowUsePreInitialize = false;
52
52
 
53
53
  this.hasBundle = !!this.payload?.bundle;
54
54
 
@@ -129,17 +129,21 @@ export async function writeProtocolV2File(options: ProtocolV2FileWriteOptions) {
129
129
  );
130
130
  options.throwIfAborted?.();
131
131
  lastMessage = response.message;
132
- const processedByte = Number(response.message?.processed_byte);
133
- written =
134
- Number.isFinite(processedByte) && processedByte > offset
135
- ? processedByte - startOffset
136
- : written + chunk.byteLength;
137
- if (written > dataLength) {
132
+ const rawProcessedByte = response.message?.processed_byte;
133
+ const processedByte = Number(rawProcessedByte);
134
+ if (
135
+ rawProcessedByte !== undefined &&
136
+ (!Number.isFinite(processedByte) ||
137
+ processedByte <= offset ||
138
+ processedByte > offset + chunk.byteLength)
139
+ ) {
138
140
  throw ERRORS.TypedError(
139
141
  HardwareErrorCode.RuntimeError,
140
142
  `FilesystemFileWrite invalid processed_byte ${processedByte}`
141
143
  );
142
144
  }
145
+ written =
146
+ rawProcessedByte === undefined ? written + chunk.byteLength : processedByte - startOffset;
143
147
  chunks += 1;
144
148
  const elapsedMs = Date.now() - startTime;
145
149
  const transferredBytes = Math.min(written, dataLength);
package/src/api/index.ts CHANGED
@@ -61,7 +61,6 @@ export { default as deviceSettingsPageShow } from './protocol-v2/DeviceSettingsP
61
61
  export { default as deviceUploadWallpaper } from './protocol-v2/DeviceUploadWallpaper';
62
62
  export { default as filesystemPermissionFix } from './protocol-v2/FilesystemPermissionFix';
63
63
  export { default as filesystemFormat } from './protocol-v2/FilesystemFormat';
64
- export { default as filesystemDiskControl } from './protocol-v2/FilesystemDiskControl';
65
64
  export { default as fileRead } from './FileRead';
66
65
  export { default as fileWrite } from './FileWrite';
67
66
  export { default as fileDelete } from './FileDelete';
@@ -4,11 +4,12 @@ import { bytesToHex } from '@noble/hashes/utils';
4
4
  import { BaseMethod } from '../BaseMethod';
5
5
  import { invalidParameter } from '../helpers/filesystemValidation';
6
6
  import { writeProtocolV2File } from '../helpers/protocolV2FileWrite';
7
+ import { UI_REQUEST, createUiMessage } from '../../events/ui-request';
7
8
  import {
8
- encodePro2Wallpaper,
9
9
  PRO2_WALLPAPER_HEIGHT,
10
10
  PRO2_WALLPAPER_WIDTH,
11
11
  type Pro2WallpaperColorFormat,
12
+ encodePro2Wallpaper,
12
13
  } from '../../utils/pro2Wallpaper';
13
14
 
14
15
  export type DeviceUploadWallpaperParams = {
@@ -90,7 +91,7 @@ export default class DeviceUploadWallpaper extends BaseMethod<DeviceUploadWallpa
90
91
 
91
92
  private async upload() {
92
93
  if (this.uploaded) return;
93
- const encoded = this.encoded;
94
+ const { encoded } = this;
94
95
  if (!encoded) throw invalidParameter('Wallpaper data has not been initialized.');
95
96
 
96
97
  await writeProtocolV2File({
@@ -102,12 +103,17 @@ export default class DeviceUploadWallpaper extends BaseMethod<DeviceUploadWallpa
102
103
  overwrite: true,
103
104
  append: false,
104
105
  throwIfAborted: () => this.throwIfAborted(),
106
+ onProgress: payload => {
107
+ if (typeof this.postMessage === 'function') {
108
+ this.postMessage(createUiMessage(UI_REQUEST.DEVICE_PROGRESS, payload));
109
+ }
110
+ },
105
111
  });
106
112
  this.uploaded = true;
107
113
  }
108
114
 
109
115
  async run(): Promise<DeviceUploadWallpaperResponse> {
110
- const encoded = this.encoded;
116
+ const { encoded } = this;
111
117
  if (!encoded) throw invalidParameter('Wallpaper data has not been initialized.');
112
118
  await this.ensureDirectory();
113
119
  await this.upload();
@@ -118,9 +118,6 @@ export const isProtocolV2DeviceDisconnectedError = (error: unknown) => {
118
118
  message.includes('connection has timed out unexpectedly') ||
119
119
  message.includes('connection error has occured') ||
120
120
  message.includes('connection error has occurred') ||
121
- message.includes('transferIn') ||
122
- message.includes('transferin') ||
123
- message.includes('usbdevice') ||
124
121
  message.includes('multiplatformbleadapter') ||
125
122
  message.includes('multipalformebleadapter') ||
126
123
  compactMessage.includes('rxerrorerror6') ||
@@ -485,7 +485,6 @@
485
485
  "MessageType_DeviceSessionGet": 60606,
486
486
  "MessageType_DeviceSession": 60607,
487
487
  "MessageType_DeviceSessionAskPin": 60608,
488
- "MessageType_DeviceSessionPinResult": 60609,
489
488
  "MessageType_FilesystemPermissionFix": 60800,
490
489
  "MessageType_FilesystemPathInfo": 60801,
491
490
  "MessageType_FilesystemPathInfoQuery": 60802,
@@ -6161,6 +6160,33 @@
6161
6160
  "PromptTemporarily": 2
6162
6161
  }
6163
6162
  },
6163
+ "Initialize": {
6164
+ "fields": {
6165
+ "session_id": {
6166
+ "type": "bytes",
6167
+ "id": 1
6168
+ },
6169
+ "_skip_passphrase": {
6170
+ "type": "bool",
6171
+ "id": 2,
6172
+ "options": {
6173
+ "deprecated": true
6174
+ }
6175
+ },
6176
+ "derive_cardano": {
6177
+ "type": "bool",
6178
+ "id": 3
6179
+ },
6180
+ "passphrase_state": {
6181
+ "type": "string",
6182
+ "id": 8000
6183
+ },
6184
+ "is_contains_attach": {
6185
+ "type": "bool",
6186
+ "id": 8001
6187
+ }
6188
+ }
6189
+ },
6164
6190
  "StartSession": {
6165
6191
  "fields": {
6166
6192
  "session_id": {
@@ -6183,6 +6209,12 @@
6183
6209
  "EndSession": {
6184
6210
  "fields": {}
6185
6211
  },
6212
+ "GetFeatures": {
6213
+ "fields": {}
6214
+ },
6215
+ "OnekeyGetFeatures": {
6216
+ "fields": {}
6217
+ },
6186
6218
  "OneKeyDeviceType": {
6187
6219
  "values": {
6188
6220
  "CLASSIC": 0,
@@ -6204,6 +6236,388 @@
6204
6236
  "APP": 1
6205
6237
  }
6206
6238
  },
6239
+ "Features": {
6240
+ "fields": {
6241
+ "vendor": {
6242
+ "type": "string",
6243
+ "id": 1
6244
+ },
6245
+ "major_version": {
6246
+ "rule": "required",
6247
+ "type": "uint32",
6248
+ "id": 2
6249
+ },
6250
+ "minor_version": {
6251
+ "rule": "required",
6252
+ "type": "uint32",
6253
+ "id": 3
6254
+ },
6255
+ "patch_version": {
6256
+ "rule": "required",
6257
+ "type": "uint32",
6258
+ "id": 4
6259
+ },
6260
+ "bootloader_mode": {
6261
+ "type": "bool",
6262
+ "id": 5
6263
+ },
6264
+ "device_id": {
6265
+ "type": "string",
6266
+ "id": 6
6267
+ },
6268
+ "pin_protection": {
6269
+ "type": "bool",
6270
+ "id": 7
6271
+ },
6272
+ "passphrase_protection": {
6273
+ "type": "bool",
6274
+ "id": 8
6275
+ },
6276
+ "language": {
6277
+ "type": "string",
6278
+ "id": 9
6279
+ },
6280
+ "label": {
6281
+ "type": "string",
6282
+ "id": 10
6283
+ },
6284
+ "initialized": {
6285
+ "type": "bool",
6286
+ "id": 12
6287
+ },
6288
+ "revision": {
6289
+ "type": "bytes",
6290
+ "id": 13
6291
+ },
6292
+ "bootloader_hash": {
6293
+ "type": "bytes",
6294
+ "id": 14
6295
+ },
6296
+ "imported": {
6297
+ "type": "bool",
6298
+ "id": 15
6299
+ },
6300
+ "unlocked": {
6301
+ "type": "bool",
6302
+ "id": 16
6303
+ },
6304
+ "_passphrase_cached": {
6305
+ "type": "bool",
6306
+ "id": 17,
6307
+ "options": {
6308
+ "deprecated": true
6309
+ }
6310
+ },
6311
+ "firmware_present": {
6312
+ "type": "bool",
6313
+ "id": 18
6314
+ },
6315
+ "needs_backup": {
6316
+ "type": "bool",
6317
+ "id": 19
6318
+ },
6319
+ "flags": {
6320
+ "type": "uint32",
6321
+ "id": 20
6322
+ },
6323
+ "model": {
6324
+ "type": "string",
6325
+ "id": 21
6326
+ },
6327
+ "fw_major": {
6328
+ "type": "uint32",
6329
+ "id": 22
6330
+ },
6331
+ "fw_minor": {
6332
+ "type": "uint32",
6333
+ "id": 23
6334
+ },
6335
+ "fw_patch": {
6336
+ "type": "uint32",
6337
+ "id": 24
6338
+ },
6339
+ "fw_vendor": {
6340
+ "type": "string",
6341
+ "id": 25
6342
+ },
6343
+ "unfinished_backup": {
6344
+ "type": "bool",
6345
+ "id": 27
6346
+ },
6347
+ "no_backup": {
6348
+ "type": "bool",
6349
+ "id": 28
6350
+ },
6351
+ "recovery_mode": {
6352
+ "type": "bool",
6353
+ "id": 29
6354
+ },
6355
+ "capabilities": {
6356
+ "rule": "repeated",
6357
+ "type": "Capability",
6358
+ "id": 30,
6359
+ "options": {
6360
+ "packed": false
6361
+ }
6362
+ },
6363
+ "backup_type": {
6364
+ "type": "BackupType",
6365
+ "id": 31
6366
+ },
6367
+ "sd_card_present": {
6368
+ "type": "bool",
6369
+ "id": 32
6370
+ },
6371
+ "sd_protection": {
6372
+ "type": "bool",
6373
+ "id": 33
6374
+ },
6375
+ "wipe_code_protection": {
6376
+ "type": "bool",
6377
+ "id": 34
6378
+ },
6379
+ "session_id": {
6380
+ "type": "bytes",
6381
+ "id": 35
6382
+ },
6383
+ "passphrase_always_on_device": {
6384
+ "type": "bool",
6385
+ "id": 36
6386
+ },
6387
+ "safety_checks": {
6388
+ "type": "SafetyCheckLevel",
6389
+ "id": 37
6390
+ },
6391
+ "auto_lock_delay_ms": {
6392
+ "type": "uint32",
6393
+ "id": 38
6394
+ },
6395
+ "display_rotation": {
6396
+ "type": "uint32",
6397
+ "id": 39
6398
+ },
6399
+ "experimental_features": {
6400
+ "type": "bool",
6401
+ "id": 40
6402
+ },
6403
+ "offset": {
6404
+ "type": "uint32",
6405
+ "id": 500
6406
+ },
6407
+ "coprocessor_bt_name": {
6408
+ "type": "string",
6409
+ "id": 501
6410
+ },
6411
+ "coprocessor_version": {
6412
+ "type": "string",
6413
+ "id": 502
6414
+ },
6415
+ "coprocessor_bt_enable": {
6416
+ "type": "bool",
6417
+ "id": 503
6418
+ },
6419
+ "se_enable": {
6420
+ "type": "bool",
6421
+ "id": 504
6422
+ },
6423
+ "se_ver": {
6424
+ "type": "string",
6425
+ "id": 506
6426
+ },
6427
+ "backup_only": {
6428
+ "type": "bool",
6429
+ "id": 507
6430
+ },
6431
+ "onekey_version": {
6432
+ "type": "string",
6433
+ "id": 508
6434
+ },
6435
+ "onekey_serial": {
6436
+ "type": "string",
6437
+ "id": 509
6438
+ },
6439
+ "bootloader_version": {
6440
+ "type": "string",
6441
+ "id": 510
6442
+ },
6443
+ "serial_no": {
6444
+ "type": "string",
6445
+ "id": 511
6446
+ },
6447
+ "spi_flash": {
6448
+ "type": "string",
6449
+ "id": 512
6450
+ },
6451
+ "initstates": {
6452
+ "type": "uint32",
6453
+ "id": 513
6454
+ },
6455
+ "NFT_voucher": {
6456
+ "type": "bytes",
6457
+ "id": 514
6458
+ },
6459
+ "cpu_info": {
6460
+ "type": "string",
6461
+ "id": 515
6462
+ },
6463
+ "pre_firmware": {
6464
+ "type": "string",
6465
+ "id": 516
6466
+ },
6467
+ "coin_switch": {
6468
+ "type": "uint32",
6469
+ "id": 517
6470
+ },
6471
+ "build_id": {
6472
+ "type": "bytes",
6473
+ "id": 518
6474
+ },
6475
+ "romloader_version": {
6476
+ "type": "string",
6477
+ "id": 519
6478
+ },
6479
+ "busy": {
6480
+ "type": "bool",
6481
+ "id": 41
6482
+ },
6483
+ "onekey_device_type": {
6484
+ "type": "OneKeyDeviceType",
6485
+ "id": 600
6486
+ },
6487
+ "onekey_se_type": {
6488
+ "type": "OneKeySeType",
6489
+ "id": 601
6490
+ },
6491
+ "onekey_romloader_version": {
6492
+ "type": "string",
6493
+ "id": 602
6494
+ },
6495
+ "onekey_romloader_hash": {
6496
+ "type": "bytes",
6497
+ "id": 603
6498
+ },
6499
+ "onekey_bootloader_version": {
6500
+ "type": "string",
6501
+ "id": 604
6502
+ },
6503
+ "onekey_bootloader_hash": {
6504
+ "type": "bytes",
6505
+ "id": 605
6506
+ },
6507
+ "onekey_se01_version": {
6508
+ "type": "string",
6509
+ "id": 606
6510
+ },
6511
+ "onekey_se01_hash": {
6512
+ "type": "bytes",
6513
+ "id": 607
6514
+ },
6515
+ "onekey_se01_build_id": {
6516
+ "type": "string",
6517
+ "id": 608
6518
+ },
6519
+ "onekey_firmware_version": {
6520
+ "type": "string",
6521
+ "id": 609
6522
+ },
6523
+ "onekey_firmware_hash": {
6524
+ "type": "bytes",
6525
+ "id": 610
6526
+ },
6527
+ "onekey_firmware_build_id": {
6528
+ "type": "string",
6529
+ "id": 611
6530
+ },
6531
+ "onekey_serial_no": {
6532
+ "type": "string",
6533
+ "id": 612
6534
+ },
6535
+ "onekey_bootloader_build_id": {
6536
+ "type": "string",
6537
+ "id": 613
6538
+ },
6539
+ "onekey_coprocessor_bt_name": {
6540
+ "type": "string",
6541
+ "id": 614
6542
+ },
6543
+ "onekey_coprocessor_version": {
6544
+ "type": "string",
6545
+ "id": 615
6546
+ },
6547
+ "onekey_coprocessor_build_id": {
6548
+ "type": "string",
6549
+ "id": 616
6550
+ },
6551
+ "onekey_coprocessor_hash": {
6552
+ "type": "bytes",
6553
+ "id": 617
6554
+ },
6555
+ "onekey_se02_version": {
6556
+ "type": "string",
6557
+ "id": 618
6558
+ },
6559
+ "onekey_se03_version": {
6560
+ "type": "string",
6561
+ "id": 619
6562
+ },
6563
+ "onekey_se04_version": {
6564
+ "type": "string",
6565
+ "id": 620
6566
+ },
6567
+ "onekey_se01_state": {
6568
+ "type": "OneKeySEState",
6569
+ "id": 621
6570
+ },
6571
+ "onekey_se02_state": {
6572
+ "type": "OneKeySEState",
6573
+ "id": 622
6574
+ },
6575
+ "onekey_se03_state": {
6576
+ "type": "OneKeySEState",
6577
+ "id": 623
6578
+ },
6579
+ "onekey_se04_state": {
6580
+ "type": "OneKeySEState",
6581
+ "id": 624
6582
+ },
6583
+ "attach_to_pin_user": {
6584
+ "type": "bool",
6585
+ "id": 625
6586
+ },
6587
+ "unlocked_attach_pin": {
6588
+ "type": "bool",
6589
+ "id": 626
6590
+ }
6591
+ },
6592
+ "nested": {
6593
+ "Capability": {
6594
+ "options": {
6595
+ "(has_bitcoin_only_values)": true
6596
+ },
6597
+ "values": {
6598
+ "Capability_Bitcoin": 1,
6599
+ "Capability_Bitcoin_like": 2,
6600
+ "Capability_Binance": 3,
6601
+ "Capability_Cardano": 4,
6602
+ "Capability_Crypto": 5,
6603
+ "Capability_EOS": 6,
6604
+ "Capability_Ethereum": 7,
6605
+ "Capability_Lisk": 8,
6606
+ "Capability_Monero": 9,
6607
+ "Capability_NEM": 10,
6608
+ "Capability_Ripple": 11,
6609
+ "Capability_Stellar": 12,
6610
+ "Capability_Tezos": 13,
6611
+ "Capability_U2F": 14,
6612
+ "Capability_Shamir": 15,
6613
+ "Capability_ShamirGroups": 16,
6614
+ "Capability_PassphraseEntry": 17,
6615
+ "Capability_AttachToPin": 18,
6616
+ "Capability_EthereumTypedData": 1000
6617
+ }
6618
+ }
6619
+ }
6620
+ },
6207
6621
  "OnekeyFeatures": {
6208
6622
  "fields": {
6209
6623
  "onekey_device_type": {
@@ -11169,7 +11583,10 @@
11169
11583
  "ViewSignLayout": {
11170
11584
  "values": {
11171
11585
  "LayoutDefault": 0,
11172
- "LayoutSafeTxCreate": 1
11586
+ "LayoutSafeTxCreate": 1,
11587
+ "LayoutFinalConfirm": 2,
11588
+ "Layout7702": 3,
11589
+ "LayoutFlat": 4
11173
11590
  }
11174
11591
  },
11175
11592
  "ViewSignPage": {
@@ -12024,20 +12441,9 @@
12024
12441
  "DeviceSessionAskPin": {
12025
12442
  "fields": {}
12026
12443
  },
12027
- "DeviceSessionPinResult": {
12028
- "fields": {
12029
- "unlocked": {
12030
- "type": "bool",
12031
- "id": 1
12032
- },
12033
- "unlocked_attach_pin": {
12034
- "type": "bool",
12035
- "id": 2
12036
- },
12037
- "passphrase_protection": {
12038
- "type": "bool",
12039
- "id": 3
12040
- }
12444
+ "DeviceSessionAskPin_FailureSubCodes": {
12445
+ "values": {
12446
+ "UserCancel": 1
12041
12447
  }
12042
12448
  },
12043
12449
  "DeviceStatus": {