@onekeyfe/hd-core 0.3.47 → 0.3.48

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.
@@ -1,6 +1,6 @@
1
1
  import { Deferred } from '@onekeyfe/hd-shared';
2
2
  import { BaseMethod } from '../BaseMethod';
3
- import type { Features } from '../../types';
3
+ import { type Features } from '../../types';
4
4
  import type { Device } from '../../device/Device';
5
5
  export default class DeviceUpdateBootloader extends BaseMethod {
6
6
  checkPromise: Deferred<any> | null;
@@ -1 +1 @@
1
- {"version":3,"file":"DeviceUpdateBootloader.d.ts","sourceRoot":"","sources":["../../../src/api/device/DeviceUpdateBootloader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA6B,MAAM,qBAAqB,CAAC;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,aAAa,CAAC;AAGzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,UAAU;IAC5D,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAE1C,IAAI;IAOJ,cAAc,YAAa,MAAM,UAS/B;IAEI,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAsCzD,GAAG;CAWV"}
1
+ {"version":3,"file":"DeviceUpdateBootloader.d.ts","sourceRoot":"","sources":["../../../src/api/device/DeviceUpdateBootloader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA6B,MAAM,qBAAqB,CAAC;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,EAAsB,KAAK,QAAQ,EAAoB,MAAM,aAAa,CAAC;AAGlF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,UAAU;IAC5D,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAE1C,IAAI;IAOJ,cAAc,YAAa,MAAM,UAS/B;IAEI,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAsCzD,GAAG;CAWV"}
package/dist/index.js CHANGED
@@ -22955,7 +22955,7 @@ function isEnteredManuallyBoot(features, updateType) {
22955
22955
 
22956
22956
  function checkNeedUpdateBootForTouch(features) {
22957
22957
  const deviceType = getDeviceType(features);
22958
- if (deviceType !== 'touch')
22958
+ if (!DeviceModelToTypes.model_touch.includes(deviceType))
22959
22959
  return false;
22960
22960
  const currentVersion = getDeviceFirmwareVersion(features).join('.');
22961
22961
  const bootloaderVersion = getDeviceBootloaderVersion(features).join('.');
@@ -26271,7 +26271,7 @@ class DeviceUpdateBootloader extends BaseMethod {
26271
26271
  const { device } = this;
26272
26272
  const { features } = device;
26273
26273
  const deviceType = getDeviceType(features);
26274
- if (deviceType === 'touch') {
26274
+ if (DeviceModelToTypes.model_touch.includes(deviceType)) {
26275
26275
  return this.updateTouchBootloader(device, features);
26276
26276
  }
26277
26277
  return Promise.resolve(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "0.3.47",
3
+ "version": "0.3.48",
4
4
  "description": "> TODO: description",
5
5
  "author": "OneKey",
6
6
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
@@ -25,8 +25,8 @@
25
25
  "url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
26
26
  },
27
27
  "dependencies": {
28
- "@onekeyfe/hd-shared": "^0.3.47",
29
- "@onekeyfe/hd-transport": "^0.3.47",
28
+ "@onekeyfe/hd-shared": "^0.3.48",
29
+ "@onekeyfe/hd-transport": "^0.3.48",
30
30
  "axios": "^0.27.2",
31
31
  "bignumber.js": "^9.0.2",
32
32
  "bytebuffer": "^5.0.1",
@@ -44,5 +44,5 @@
44
44
  "@types/semver": "^7.3.9",
45
45
  "ripple-keypairs": "^1.1.4"
46
46
  },
47
- "gitHead": "d29985a973f53c8f793ec27451b00081ac657d5b"
47
+ "gitHead": "5ee8db3ca72369e98470809b1a56acfb575b61b7"
48
48
  }
@@ -4,7 +4,7 @@ import { BaseMethod } from '../BaseMethod';
4
4
  import { getSysResourceBinary } from '../firmware/getBinary';
5
5
  import { updateBootloader } from '../firmware/uploadFirmware';
6
6
  import { createUiMessage } from '../../events/ui-request';
7
- import type { Features, KnownDevice } from '../../types';
7
+ import { DeviceModelToTypes, type Features, type KnownDevice } from '../../types';
8
8
  import { DataManager } from '../../data-manager';
9
9
  import { checkBootloaderLength, checkNeedUpdateBootForTouch } from '../firmware/updateBootloader';
10
10
  import type { Device } from '../../device/Device';
@@ -74,7 +74,7 @@ export default class DeviceUpdateBootloader extends BaseMethod {
74
74
  const { features } = device;
75
75
 
76
76
  const deviceType = getDeviceType(features);
77
- if (deviceType === 'touch') {
77
+ if (DeviceModelToTypes.model_touch.includes(deviceType)) {
78
78
  return this.updateTouchBootloader(device, features);
79
79
  }
80
80
 
@@ -11,7 +11,7 @@ import { shouldUpdateBootloaderForClassicAndMini } from './bootloaderHelper';
11
11
 
12
12
  export function checkNeedUpdateBootForTouch(features: Features) {
13
13
  const deviceType = getDeviceType(features);
14
- if (deviceType !== 'touch') return false;
14
+ if (!DeviceModelToTypes.model_touch.includes(deviceType)) return false;
15
15
  const currentVersion = getDeviceFirmwareVersion(features).join('.');
16
16
  const bootloaderVersion = getDeviceBootloaderVersion(features).join('.');
17
17
  const targetBootloaderVersion = DataManager.getBootloaderTargetVersion(features);