@onekeyfe/hd-core 1.0.0-alpha.11 → 1.0.0-alpha.12
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 +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;AAS3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,aAAa,CAAC;AAEzD,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;
|
|
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;AAS3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,aAAa,CAAC;AAEzD,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;IA+BzD,GAAG;CAWV"}
|
package/dist/index.js
CHANGED
|
@@ -26599,30 +26599,26 @@ class DeviceUpdateBootloader extends BaseMethod {
|
|
|
26599
26599
|
this.skipForceUpdateCheck = true;
|
|
26600
26600
|
}
|
|
26601
26601
|
updateTouchBootloader(device, features) {
|
|
26602
|
-
var _a;
|
|
26603
26602
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26604
26603
|
if (features && !features.bootloader_mode) {
|
|
26605
|
-
|
|
26606
|
-
if (
|
|
26607
|
-
|
|
26608
|
-
|
|
26609
|
-
|
|
26610
|
-
|
|
26611
|
-
|
|
26612
|
-
|
|
26613
|
-
|
|
26614
|
-
|
|
26615
|
-
if (resource) {
|
|
26616
|
-
binary = resource.binary;
|
|
26617
|
-
}
|
|
26604
|
+
let { binary } = this.payload;
|
|
26605
|
+
if (!binary) {
|
|
26606
|
+
this.postTipMessage('CheckLatestUiResource');
|
|
26607
|
+
const resourceUrl = DataManager.getBootloaderResource(features);
|
|
26608
|
+
if (resourceUrl) {
|
|
26609
|
+
this.postTipMessage('DownloadLatestBootloaderResource');
|
|
26610
|
+
const resource = yield getSysResourceBinary(resourceUrl);
|
|
26611
|
+
this.postTipMessage('DownloadLatestBootloaderResourceSuccess');
|
|
26612
|
+
if (resource) {
|
|
26613
|
+
binary = resource.binary;
|
|
26618
26614
|
}
|
|
26619
26615
|
}
|
|
26620
|
-
if (!checkBootloaderLength(binary)) {
|
|
26621
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CheckDownloadFileError);
|
|
26622
|
-
}
|
|
26623
|
-
yield updateBootloader(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.postMessage, device, binary);
|
|
26624
|
-
return Promise.resolve(true);
|
|
26625
26616
|
}
|
|
26617
|
+
if (!checkBootloaderLength(binary)) {
|
|
26618
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CheckDownloadFileError);
|
|
26619
|
+
}
|
|
26620
|
+
yield updateBootloader(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.postMessage, device, binary);
|
|
26621
|
+
return Promise.resolve(true);
|
|
26626
26622
|
}
|
|
26627
26623
|
return Promise.resolve(true);
|
|
26628
26624
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.12",
|
|
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": "^1.0.0-alpha.
|
|
29
|
-
"@onekeyfe/hd-transport": "^1.0.0-alpha.
|
|
28
|
+
"@onekeyfe/hd-shared": "^1.0.0-alpha.12",
|
|
29
|
+
"@onekeyfe/hd-transport": "^1.0.0-alpha.12",
|
|
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": "
|
|
47
|
+
"gitHead": "6d0a628ca0e177cdb2052b8c141cb94cf0875d7a"
|
|
48
48
|
}
|
|
@@ -35,34 +35,30 @@ export default class DeviceUpdateBootloader extends BaseMethod {
|
|
|
35
35
|
|
|
36
36
|
async updateTouchBootloader(device: Device, features?: Features) {
|
|
37
37
|
if (features && !features.bootloader_mode) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (
|
|
43
|
-
this.postTipMessage('
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
this.postTipMessage('DownloadLatestBootloaderResourceSuccess');
|
|
49
|
-
if (resource) {
|
|
50
|
-
binary = resource.binary;
|
|
51
|
-
}
|
|
38
|
+
let { binary } = this.payload;
|
|
39
|
+
if (!binary) {
|
|
40
|
+
this.postTipMessage('CheckLatestUiResource');
|
|
41
|
+
const resourceUrl = DataManager.getBootloaderResource(features);
|
|
42
|
+
if (resourceUrl) {
|
|
43
|
+
this.postTipMessage('DownloadLatestBootloaderResource');
|
|
44
|
+
const resource = await getSysResourceBinary(resourceUrl);
|
|
45
|
+
this.postTipMessage('DownloadLatestBootloaderResourceSuccess');
|
|
46
|
+
if (resource) {
|
|
47
|
+
binary = resource.binary;
|
|
52
48
|
}
|
|
53
49
|
}
|
|
50
|
+
}
|
|
54
51
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
await updateBootloader(
|
|
59
|
-
this.device.getCommands().typedCall.bind(this.device.getCommands()),
|
|
60
|
-
this.postMessage,
|
|
61
|
-
device,
|
|
62
|
-
binary
|
|
63
|
-
);
|
|
64
|
-
return Promise.resolve(true);
|
|
52
|
+
if (!checkBootloaderLength(binary)) {
|
|
53
|
+
throw ERRORS.TypedError(HardwareErrorCode.CheckDownloadFileError);
|
|
65
54
|
}
|
|
55
|
+
await updateBootloader(
|
|
56
|
+
this.device.getCommands().typedCall.bind(this.device.getCommands()),
|
|
57
|
+
this.postMessage,
|
|
58
|
+
device,
|
|
59
|
+
binary
|
|
60
|
+
);
|
|
61
|
+
return Promise.resolve(true);
|
|
66
62
|
}
|
|
67
63
|
|
|
68
64
|
return Promise.resolve(true);
|