@onekeyfe/hd-core 1.2.0-alpha.3 → 1.2.0-alpha.4
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/__tests__/preInitialize.test.ts +33 -0
- package/__tests__/protocol-v2.test.ts +1377 -480
- package/dist/api/FileRead.d.ts.map +1 -1
- package/dist/api/FileWrite.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV4.d.ts +20 -2
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
- package/dist/api/firmware/getBinary.d.ts +4 -0
- package/dist/api/firmware/getBinary.d.ts.map +1 -1
- package/dist/api/index.d.ts +5 -10
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts +6 -0
- package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts +7 -0
- package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts +1 -1
- package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts +1 -1
- package/dist/api/protocol-v2/{DeviceGetDeviceInfo.d.ts → DeviceInfoGet.d.ts} +10 -10
- package/dist/api/protocol-v2/DeviceInfoGet.d.ts.map +1 -0
- package/dist/api/protocol-v2/{FilesystemFixPermission.d.ts → FilesystemPermissionFix.d.ts} +2 -2
- package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts.map +1 -0
- package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts +6 -0
- package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts.map +1 -0
- package/dist/api/protocol-v2/helpers.d.ts +24 -18
- package/dist/api/protocol-v2/helpers.d.ts.map +1 -1
- package/dist/api/ton/TonSignData.d.ts +1 -5
- package/dist/api/ton/TonSignData.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/data-manager/DataManager.d.ts +1 -1
- package/dist/data-manager/DataManager.d.ts.map +1 -1
- package/dist/data-manager/connectSettings.d.ts.map +1 -1
- package/dist/device/Device.d.ts +4 -1
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +1 -1
- package/dist/deviceProfile/buildDeviceProfile.d.ts.map +1 -1
- package/dist/index.d.ts +79 -54
- package/dist/index.js +1537 -1528
- package/dist/inject.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/features.d.ts +12 -14
- package/dist/protocols/protocol-v2/features.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/firmware.d.ts +10 -9
- package/dist/protocols/protocol-v2/firmware.d.ts.map +1 -1
- package/dist/types/api/firmwareUpdate.d.ts +1 -6
- package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
- package/dist/types/api/getDeviceInfo.d.ts +2 -0
- package/dist/types/api/getDeviceInfo.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +6 -11
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/protocolV2.d.ts +12 -17
- package/dist/types/api/protocolV2.d.ts.map +1 -1
- package/dist/types/device.d.ts +1 -0
- package/dist/types/device.d.ts.map +1 -1
- package/dist/types/params.d.ts +1 -0
- package/dist/types/params.d.ts.map +1 -1
- package/dist/types/settings.d.ts +29 -2
- package/dist/types/settings.d.ts.map +1 -1
- package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
- package/dist/utils/patch.d.ts +1 -1
- package/dist/utils/patch.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/FileRead.ts +14 -1
- package/src/api/FileWrite.ts +14 -1
- package/src/api/FirmwareUpdateV4.ts +933 -197
- package/src/api/GetOnekeyFeatures.ts +1 -1
- package/src/api/device/DeviceRebootToBoardloader.ts +4 -4
- package/src/api/device/DeviceRebootToBootloader.ts +4 -4
- package/src/api/firmware/FirmwareUpdateBaseMethod.ts +11 -4
- package/src/api/index.ts +5 -10
- package/src/api/protocol-v2/{FactoryGetDeviceInfo.ts → DeviceFactoryInfoGet.ts} +3 -3
- package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +32 -0
- package/src/api/protocol-v2/DeviceFirmwareUpdate.ts +3 -5
- package/src/api/protocol-v2/DeviceGetFirmwareUpdateStatus.ts +2 -2
- package/src/api/protocol-v2/{DeviceGetDeviceInfo.ts → DeviceInfoGet.ts} +52 -22
- package/src/api/protocol-v2/DeviceReboot.ts +1 -1
- package/src/api/protocol-v2/{FilesystemFixPermission.ts → FilesystemPermissionFix.ts} +2 -2
- package/src/api/protocol-v2/{GetProtoVersion.ts → ProtocolInfoRequest.ts} +2 -2
- package/src/api/protocol-v2/helpers.ts +59 -43
- package/src/api/ton/TonSignData.ts +1 -5
- package/src/core/index.ts +19 -5
- package/src/data/messages/messages-protocol-v2.json +486 -1072
- package/src/data-manager/DataManager.ts +7 -0
- package/src/data-manager/connectSettings.ts +0 -6
- package/src/device/Device.ts +25 -14
- package/src/deviceProfile/buildDeviceFeatures.ts +60 -63
- package/src/deviceProfile/buildDeviceProfile.ts +77 -58
- package/src/inject.ts +10 -16
- package/src/protocols/protocol-v2/features.ts +26 -63
- package/src/protocols/protocol-v2/firmware.ts +11 -36
- package/src/types/api/firmwareUpdate.ts +10 -20
- package/src/types/api/getDeviceInfo.ts +2 -0
- package/src/types/api/index.ts +10 -20
- package/src/types/api/protocolV2.ts +22 -42
- package/src/types/device.ts +1 -0
- package/src/types/params.ts +4 -0
- package/src/types/settings.ts +44 -35
- package/src/utils/deviceFeaturesUtils.ts +45 -10
- package/dist/api/protocol-v2/DevReboot.d.ts +0 -7
- package/dist/api/protocol-v2/DevReboot.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceGetDeviceInfo.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts +0 -6
- package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts.map +0 -1
- package/dist/api/protocol-v2/FactoryDeviceInfoSettings.d.ts +0 -7
- package/dist/api/protocol-v2/FactoryDeviceInfoSettings.d.ts.map +0 -1
- package/dist/api/protocol-v2/FactoryGetDeviceInfo.d.ts +0 -6
- package/dist/api/protocol-v2/FactoryGetDeviceInfo.d.ts.map +0 -1
- package/dist/api/protocol-v2/FilesystemFixPermission.d.ts.map +0 -1
- package/dist/api/protocol-v2/GetProtoVersion.d.ts +0 -6
- package/dist/api/protocol-v2/GetProtoVersion.d.ts.map +0 -1
- package/src/api/protocol-v2/DevReboot.ts +0 -24
- package/src/api/protocol-v2/DeviceGetOnboardingStatus.ts +0 -16
- package/src/api/protocol-v2/FactoryDeviceInfoSettings.ts +0 -29
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import semver from 'semver';
|
|
2
2
|
import { isNaN } from 'lodash';
|
|
3
3
|
import { EDeviceType, type EFirmwareType, ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
Enum_Capability,
|
|
6
|
+
type DeviceSessionGet,
|
|
7
|
+
type GetPassphraseState,
|
|
8
|
+
} from '@onekeyfe/hd-transport';
|
|
5
9
|
|
|
6
10
|
import { toHardened } from '../api/helpers/pathUtils';
|
|
7
11
|
import { DeviceModelToTypes, DeviceTypeToModels } from '../types';
|
|
@@ -17,9 +21,7 @@ import { existCapability } from './capabilitieUtils';
|
|
|
17
21
|
import type { Device } from '../device/Device';
|
|
18
22
|
import type { Features, IDeviceType, SupportFeatureType } from '../types';
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
// 不再需要手动扩展字段。
|
|
22
|
-
type GetPassphraseStateMessage = GetPassphraseState;
|
|
24
|
+
type DeviceSessionGetMessage = DeviceSessionGet;
|
|
23
25
|
|
|
24
26
|
export const getSupportProtocolV1MessageSchema = (
|
|
25
27
|
features: Features | undefined
|
|
@@ -136,11 +138,14 @@ export const getPassphraseStateWithRefreshDeviceInfo = async (
|
|
|
136
138
|
options?.initSession ? null : device.features?.sessionId
|
|
137
139
|
);
|
|
138
140
|
|
|
139
|
-
return {
|
|
141
|
+
return {
|
|
142
|
+
passphraseState,
|
|
143
|
+
newSession,
|
|
144
|
+
unlockedAttachPin: unlockedAttachPin ?? device.features?.unlockedAttachPin,
|
|
145
|
+
};
|
|
140
146
|
};
|
|
141
147
|
|
|
142
148
|
// 仅适用于 Protocol V1 的 Pro:Pro2 走独立版本线,不能套用 4.15.0 门槛
|
|
143
|
-
// (Pro2 在 getPassphraseState 中通过 isProtocolV2 直接判定支持)。
|
|
144
149
|
const supportProSeriesAttachPinPassphrase = (deviceType: IDeviceType, firmwareVersion: string) =>
|
|
145
150
|
deviceType === EDeviceType.Pro && semver.gte(firmwareVersion, '4.15.0');
|
|
146
151
|
|
|
@@ -166,19 +171,42 @@ export const getPassphraseState = async (
|
|
|
166
171
|
const firmwareVersion = device.getCurrentFirmwareVersionString() ?? '0.0.0';
|
|
167
172
|
const deviceType = device.getCurrentDeviceType();
|
|
168
173
|
|
|
174
|
+
if (device.isProtocolV2()) {
|
|
175
|
+
const payload: DeviceSessionGetMessage = {};
|
|
176
|
+
const cachedSessionId =
|
|
177
|
+
typeof device.getInternalState === 'function' ? device.getInternalState() : undefined;
|
|
178
|
+
if (cachedSessionId) {
|
|
179
|
+
payload.session_id = cachedSessionId;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const { message, type } = await commands.typedCall(
|
|
183
|
+
'DeviceSessionGet',
|
|
184
|
+
'DeviceSession',
|
|
185
|
+
payload
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
// @ts-expect-error
|
|
189
|
+
if (type === 'CallMethodError') {
|
|
190
|
+
throw ERRORS.TypedError(HardwareErrorCode.RuntimeError, 'Get the passphrase state error');
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return {
|
|
194
|
+
passphraseState: message.btc_test_address,
|
|
195
|
+
newSession: message.session_id,
|
|
196
|
+
unlockedAttachPin: features.unlockedAttachPin ?? undefined,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
|
|
169
200
|
const supportAttachPinCapability = existCapability(
|
|
170
201
|
features,
|
|
171
202
|
Enum_Capability.Capability_AttachToPin
|
|
172
203
|
);
|
|
173
|
-
// Pro2 (Protocol V2) 协议自带 GetPassphraseState(10028),固件从首个版本即支持,
|
|
174
|
-
// 不依赖 Pro 系列的 4.15.0 版本线;V2 也没有 GetAddress Testnet 探测这条 legacy 回退路径。
|
|
175
204
|
const supportGetPassphraseState =
|
|
176
|
-
device.isProtocolV2() ||
|
|
177
205
|
supportAttachPinCapability ||
|
|
178
206
|
supportProSeriesAttachPinPassphrase(deviceType, firmwareVersion);
|
|
179
207
|
|
|
180
208
|
if (supportGetPassphraseState) {
|
|
181
|
-
const payload:
|
|
209
|
+
const payload: GetPassphraseState = options?.onlyMainPin
|
|
182
210
|
? { _only_main_pin: true }
|
|
183
211
|
: { passphrase_state: options?.expectPassphraseState };
|
|
184
212
|
if (options?.allowCreateAttachPin) {
|
|
@@ -282,6 +310,9 @@ export const getFirmwareUpdateField = ({
|
|
|
282
310
|
if (deviceType === EDeviceType.Pro) {
|
|
283
311
|
return latestFirmwareField;
|
|
284
312
|
}
|
|
313
|
+
if (deviceType === EDeviceType.Pro2) {
|
|
314
|
+
return 'firmware-v1';
|
|
315
|
+
}
|
|
285
316
|
return 'firmware';
|
|
286
317
|
};
|
|
287
318
|
/**
|
|
@@ -325,6 +356,10 @@ export const getFirmwareUpdateFieldArray = (
|
|
|
325
356
|
return ['firmware-v8'];
|
|
326
357
|
}
|
|
327
358
|
|
|
359
|
+
if (deviceType === 'pro2') {
|
|
360
|
+
return ['firmware-v1'];
|
|
361
|
+
}
|
|
362
|
+
|
|
328
363
|
return ['firmware'];
|
|
329
364
|
};
|
|
330
365
|
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BaseMethod } from '../BaseMethod';
|
|
2
|
-
import type { DeviceRebootParams } from './helpers';
|
|
3
|
-
export default class DevReboot extends BaseMethod<DeviceRebootParams> {
|
|
4
|
-
init(): void;
|
|
5
|
-
run(): Promise<import("packages/hd-transport/dist").Success>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=DevReboot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DevReboot.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/DevReboot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAAU,CAAC,kBAAkB,CAAC;IACnE,IAAI;IAWE,GAAG;CAMV"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceGetDeviceInfo.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/DeviceGetDeviceInfo.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,MAAM,0BAA0B,GAAG;IACvC,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,CAAC,EAAE,0BAA0B,CAAC;IACrC,KAAK,CAAC,EAAE,wBAAwB,CAAC;CAClC,CAAC;AAmDF,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,UAAU,CAAC;IAC1D,OAAO,EAAE,0BAA0B,CAAC;IACpC,KAAK,EAAE,wBAAwB,CAAC;CACjC,CAAC;IACA,IAAI;IAmBE,GAAG;CAgBV"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceGetOnboardingStatus.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/DeviceGetOnboardingStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,UAAU;IAC/D,IAAI;IAQE,GAAG;CAIV"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BaseMethod } from '../BaseMethod';
|
|
2
|
-
import type { FactoryDeviceInfoSettingsParams } from './helpers';
|
|
3
|
-
export default class FactoryDeviceInfoSettings extends BaseMethod<FactoryDeviceInfoSettingsParams> {
|
|
4
|
-
init(): void;
|
|
5
|
-
run(): Promise<import("packages/hd-transport/dist").Success>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=FactoryDeviceInfoSettings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FactoryDeviceInfoSettings.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/FactoryDeviceInfoSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,WAAW,CAAC;AAEjE,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,UAAU,CAAC,+BAA+B,CAAC;IAChG,IAAI;IAeE,GAAG;CAQV"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FactoryGetDeviceInfo.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/FactoryGetDeviceInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,UAAU;IAC1D,IAAI;IAQE,GAAG;CAQV"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FilesystemFixPermission.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/FilesystemFixPermission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,UAAU;IAC7D,IAAI;IAQE,GAAG;CAIV"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetProtoVersion.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/GetProtoVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU;IACrD,IAAI;IAQE,GAAG;CAIV"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { BaseMethod } from '../BaseMethod';
|
|
2
|
-
import { normalizeRebootType } from './helpers';
|
|
3
|
-
|
|
4
|
-
import type { DeviceRebootParams } from './helpers';
|
|
5
|
-
|
|
6
|
-
export default class DevReboot extends BaseMethod<DeviceRebootParams> {
|
|
7
|
-
init() {
|
|
8
|
-
// Protocol V2 (Pro2) 专属方法,core 调度层统一做非 V2 设备守卫
|
|
9
|
-
this.requireProtocolV2 = true;
|
|
10
|
-
this.skipForceUpdateCheck = true;
|
|
11
|
-
this.useDevicePassphraseState = false;
|
|
12
|
-
this.params = {
|
|
13
|
-
rebootType: this.payload.rebootType,
|
|
14
|
-
reboot_type: this.payload.reboot_type,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async run() {
|
|
19
|
-
const res = await this.device.commands.typedCall('DevReboot', 'Success', {
|
|
20
|
-
reboot_type: normalizeRebootType(this.params.reboot_type ?? this.params.rebootType),
|
|
21
|
-
});
|
|
22
|
-
return Promise.resolve(res.message);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { BaseMethod } from '../BaseMethod';
|
|
2
|
-
|
|
3
|
-
export default class DeviceGetOnboardingStatus extends BaseMethod {
|
|
4
|
-
init() {
|
|
5
|
-
// Protocol V2 (Pro2) 专属方法,core 调度层统一做非 V2 设备守卫
|
|
6
|
-
this.requireProtocolV2 = true;
|
|
7
|
-
this.skipForceUpdateCheck = true;
|
|
8
|
-
this.useDevicePassphraseState = false;
|
|
9
|
-
this.params = undefined;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
async run() {
|
|
13
|
-
const res = await this.device.commands.typedCall('GetOnboardingStatus', 'OnboardingStatus', {});
|
|
14
|
-
return Promise.resolve(res.message);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { BaseMethod } from '../BaseMethod';
|
|
2
|
-
|
|
3
|
-
import type { FactoryDeviceInfoSettingsParams } from './helpers';
|
|
4
|
-
|
|
5
|
-
export default class FactoryDeviceInfoSettings extends BaseMethod<FactoryDeviceInfoSettingsParams> {
|
|
6
|
-
init() {
|
|
7
|
-
// Protocol V2 (Pro2) 专属方法,core 调度层统一做非 V2 设备守卫
|
|
8
|
-
this.requireProtocolV2 = true;
|
|
9
|
-
this.skipForceUpdateCheck = true;
|
|
10
|
-
this.useDevicePassphraseState = false;
|
|
11
|
-
this.params = {
|
|
12
|
-
serial_no: this.payload.serial_no,
|
|
13
|
-
serialNo: this.payload.serialNo,
|
|
14
|
-
cpu_info: this.payload.cpu_info,
|
|
15
|
-
cpuInfo: this.payload.cpuInfo,
|
|
16
|
-
pre_firmware: this.payload.pre_firmware,
|
|
17
|
-
preFirmware: this.payload.preFirmware,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async run() {
|
|
22
|
-
const res = await this.device.commands.typedCall('FactoryDeviceInfoSettings', 'Success', {
|
|
23
|
-
serial_no: this.params.serial_no ?? this.params.serialNo,
|
|
24
|
-
cpu_info: this.params.cpu_info ?? this.params.cpuInfo,
|
|
25
|
-
pre_firmware: this.params.pre_firmware ?? this.params.preFirmware,
|
|
26
|
-
});
|
|
27
|
-
return Promise.resolve(res.message);
|
|
28
|
-
}
|
|
29
|
-
}
|