@onekeyfe/hd-core 1.2.0-alpha.132 → 1.2.0-alpha.133
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.133",
|
|
4
4
|
"description": "Core processes and APIs for communicating with OneKey hardware devices.",
|
|
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.2.0-alpha.
|
|
29
|
-
"@onekeyfe/hd-transport": "1.2.0-alpha.
|
|
28
|
+
"@onekeyfe/hd-shared": "1.2.0-alpha.133",
|
|
29
|
+
"@onekeyfe/hd-transport": "1.2.0-alpha.133",
|
|
30
30
|
"axios": "1.15.2",
|
|
31
31
|
"bignumber.js": "^9.0.2",
|
|
32
32
|
"buffer": "^6.0.3",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"@types/w3c-web-usb": "^1.0.10",
|
|
47
47
|
"@types/web-bluetooth": "^0.0.21"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "b6d3307b47c535c876655afd99a6681399453508"
|
|
50
50
|
}
|
|
@@ -8,6 +8,7 @@ import { invalidParameter } from '../helpers/filesystemValidation';
|
|
|
8
8
|
import { writeProtocolV2File } from '../helpers/protocolV2FileWrite';
|
|
9
9
|
import { UI_REQUEST, createUiMessage } from '../../events/ui-request';
|
|
10
10
|
import { supportsProtocolV2Message } from '../../protocols/protocol-v2/features';
|
|
11
|
+
import { LoggerNames, getLogger } from '../../utils';
|
|
11
12
|
import {
|
|
12
13
|
PRO2_WALLPAPER_HEIGHT,
|
|
13
14
|
PRO2_WALLPAPER_WIDTH,
|
|
@@ -33,6 +34,7 @@ const SAFE_FILE_NAME = /^[A-Za-z0-9_-]+(?:\.bin)?$/;
|
|
|
33
34
|
const DEVICE_SETTINGS_SET_MESSAGE_TYPE = 60412;
|
|
34
35
|
const FILESYSTEM_FILE_WRITE_MESSAGE_TYPE = 60805;
|
|
35
36
|
const FILESYSTEM_DIR_MAKE_MESSAGE_TYPE = 60809;
|
|
37
|
+
const Log = getLogger(LoggerNames.Method);
|
|
36
38
|
|
|
37
39
|
function normalizeFileName(fileName: string | undefined, data: Uint8Array): string {
|
|
38
40
|
if (fileName !== undefined && (!fileName || !SAFE_FILE_NAME.test(fileName))) {
|
|
@@ -143,7 +145,15 @@ export default class DeviceUploadWallpaper extends BaseMethod<DeviceUploadWallpa
|
|
|
143
145
|
const response = await this.device.commands.typedCall('DeviceSettingsSet', 'Success', {
|
|
144
146
|
settings: { wallpaper_path: this.path },
|
|
145
147
|
});
|
|
146
|
-
|
|
148
|
+
try {
|
|
149
|
+
await this.device.refreshProtocolV2SettingsAfterMutation();
|
|
150
|
+
} catch (error) {
|
|
151
|
+
// The wallpaper is already applied. A transient read-back failure must not
|
|
152
|
+
// make callers retry the completed file upload.
|
|
153
|
+
Log.warn('Protocol V2 wallpaper settings refresh failed after apply', {
|
|
154
|
+
error: error instanceof Error ? error.message : String(error),
|
|
155
|
+
});
|
|
156
|
+
}
|
|
147
157
|
return {
|
|
148
158
|
path: this.path,
|
|
149
159
|
size: encoded.data.byteLength,
|