@onekeyfe/hd-core 1.2.0-alpha.0 → 1.2.0-alpha.10
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__/connectSettings.test.ts +19 -0
- package/__tests__/device-wallet-session-store.test.ts +131 -0
- package/__tests__/preInitialize.test.ts +33 -0
- package/__tests__/protocol-v2-firmware-targets.test.ts +19 -0
- package/__tests__/protocol-v2.test.ts +1930 -765
- package/dist/api/ClearSessionCache.d.ts +9 -0
- package/dist/api/ClearSessionCache.d.ts.map +1 -0
- package/dist/api/FileRead.d.ts.map +1 -1
- package/dist/api/FileWrite.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV4.d.ts +26 -5
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/api/GetDeviceInfo.d.ts.map +1 -1
- package/dist/api/GetFeatures.d.ts +1 -1
- package/dist/api/GetOnekeyFeatures.d.ts.map +1 -1
- package/dist/api/GetPassphraseState.d.ts +4 -4
- package/dist/api/GetPassphraseState.d.ts.map +1 -1
- package/dist/api/device/DeviceUnlock.d.ts +1 -1
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts +1 -0
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
- package/dist/api/firmware/bootloaderHelper.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/firmware/progressThrottle.d.ts +3 -0
- package/dist/api/firmware/progressThrottle.d.ts.map +1 -0
- package/dist/api/firmware/uploadFirmware.d.ts.map +1 -1
- package/dist/api/index.d.ts +8 -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 +3 -2
- package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts.map +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/DeviceSessionGet.d.ts +9 -0
- package/dist/api/protocol-v2/DeviceSessionGet.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceStatusGet.d.ts +6 -0
- package/dist/api/protocol-v2/DeviceStatusGet.d.ts.map +1 -0
- package/dist/api/protocol-v2/FilesystemFormat.d.ts.map +1 -1
- 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 +27 -19
- 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/api/tron/TronSignMessage.d.ts +0 -1
- package/dist/api/tron/TronSignMessage.d.ts.map +1 -1
- package/dist/api/tron/TronSignTransaction.d.ts +0 -1
- package/dist/api/tron/TronSignTransaction.d.ts.map +1 -1
- package/dist/constants/index.d.ts +2 -1
- package/dist/constants/index.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 +17 -18
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/device/DeviceWalletSessionStore.d.ts +15 -0
- package/dist/device/DeviceWalletSessionStore.d.ts.map +1 -0
- package/dist/deviceProfile/buildDeviceFeatures.d.ts +6 -0
- package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +1 -0
- package/dist/deviceProfile/buildDeviceProfile.d.ts +3 -4
- package/dist/deviceProfile/buildDeviceProfile.d.ts.map +1 -1
- package/dist/deviceProfile/index.d.ts +1 -1
- package/dist/deviceProfile/index.d.ts.map +1 -1
- package/dist/index.d.ts +657 -539
- package/dist/index.js +2579 -2161
- 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 +11 -9
- package/dist/protocols/protocol-v2/firmware.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/index.d.ts +1 -0
- package/dist/protocols/protocol-v2/index.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/walletSession.d.ts +13 -0
- package/dist/protocols/protocol-v2/walletSession.d.ts.map +1 -0
- package/dist/types/api/firmwareUpdate.d.ts +4 -6
- package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
- package/dist/types/api/getDeviceInfo.d.ts +4 -2
- package/dist/types/api/getDeviceInfo.d.ts.map +1 -1
- package/dist/types/api/getPassphraseState.d.ts +4 -4
- package/dist/types/api/getPassphraseState.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +11 -11
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/protocolV2.d.ts +16 -17
- package/dist/types/api/protocolV2.d.ts.map +1 -1
- package/dist/types/api/sessionCache.d.ts +10 -0
- package/dist/types/api/sessionCache.d.ts.map +1 -0
- package/dist/types/device.d.ts +88 -8
- 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 +21 -1
- package/dist/types/settings.d.ts.map +1 -1
- package/dist/utils/capabilitieUtils.d.ts.map +1 -1
- package/dist/utils/deviceFeaturesUtils.d.ts +2 -0
- package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
- package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
- package/dist/utils/deviceVersionUtils.d.ts.map +1 -1
- package/dist/utils/findDefectiveBatchDevice.d.ts +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/ClearSessionCache.ts +28 -0
- package/src/api/FileRead.ts +16 -3
- package/src/api/FileWrite.ts +14 -1
- package/src/api/FirmwareUpdateV2.ts +9 -2
- package/src/api/FirmwareUpdateV3.ts +2 -1
- package/src/api/FirmwareUpdateV4.ts +1089 -285
- package/src/api/GetDeviceInfo.ts +6 -13
- package/src/api/GetOnekeyFeatures.ts +3 -14
- package/src/api/GetPassphraseState.ts +7 -4
- package/src/api/device/DeviceRebootToBoardloader.ts +4 -4
- package/src/api/device/DeviceRebootToBootloader.ts +4 -4
- package/src/api/firmware/FirmwareUpdateBaseMethod.ts +18 -4
- package/src/api/firmware/bootloaderHelper.ts +3 -2
- package/src/api/firmware/getBinary.ts +1 -1
- package/src/api/firmware/progressThrottle.ts +44 -0
- package/src/api/firmware/releaseHelper.ts +3 -3
- package/src/api/firmware/uploadFirmware.ts +5 -2
- package/src/api/index.ts +8 -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 +39 -5
- package/src/api/protocol-v2/{DeviceGetDeviceInfo.ts → DeviceInfoGet.ts} +52 -22
- package/src/api/protocol-v2/DeviceReboot.ts +2 -2
- package/src/api/protocol-v2/DeviceSessionGet.ts +26 -0
- package/src/api/protocol-v2/DeviceStatusGet.ts +14 -0
- package/src/api/protocol-v2/FilesystemFormat.ts +4 -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 +58 -59
- package/src/api/ton/TonSignData.ts +1 -5
- package/src/api/tron/TronSignMessage.ts +0 -1
- package/src/api/tron/TronSignTransaction.ts +0 -1
- package/src/constants/index.ts +10 -1
- package/src/core/index.ts +22 -10
- package/src/data/messages/messages-protocol-v2.json +992 -1420
- package/src/data/messages/messages.json +8 -0
- package/src/data-manager/DataManager.ts +11 -4
- package/src/data-manager/connectSettings.ts +4 -0
- package/src/device/Device.ts +158 -294
- package/src/device/DevicePool.ts +9 -9
- package/src/device/DeviceWalletSessionStore.ts +78 -0
- package/src/deviceProfile/buildDeviceFeatures.ts +365 -0
- package/src/deviceProfile/buildDeviceProfile.ts +165 -200
- package/src/deviceProfile/index.ts +4 -1
- package/src/inject.ts +13 -16
- package/src/protocols/protocol-v2/features.ts +28 -67
- package/src/protocols/protocol-v2/firmware.ts +12 -36
- package/src/protocols/protocol-v2/index.ts +1 -0
- package/src/protocols/protocol-v2/walletSession.ts +83 -0
- package/src/types/api/firmwareUpdate.ts +16 -20
- package/src/types/api/getDeviceInfo.ts +4 -2
- package/src/types/api/getPassphraseState.ts +4 -4
- package/src/types/api/index.ts +17 -20
- package/src/types/api/protocolV2.ts +35 -40
- package/src/types/api/sessionCache.ts +14 -0
- package/src/types/device.ts +98 -34
- package/src/types/params.ts +4 -0
- package/src/types/settings.ts +42 -30
- package/src/utils/capabilitieUtils.ts +1 -2
- package/src/utils/deviceFeaturesUtils.ts +54 -29
- package/src/utils/deviceInfoUtils.ts +11 -29
- package/src/utils/deviceVersionUtils.ts +7 -25
- package/src/utils/findDefectiveBatchDevice.ts +6 -6
- 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/dist/deviceProfile/legacyFeaturesView.d.ts +0 -5
- package/dist/deviceProfile/legacyFeaturesView.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
- package/src/deviceProfile/legacyFeaturesView.ts +0 -123
|
@@ -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,5 +0,0 @@
|
|
|
1
|
-
import type { Features } from '../types';
|
|
2
|
-
import type { DeviceProfile } from '../types/api/getDeviceInfo';
|
|
3
|
-
import type { ProtocolV2DeviceInfo } from '@onekeyfe/hd-transport';
|
|
4
|
-
export declare const buildProtocolV2GetFeaturesPayload: (profile: DeviceProfile, deviceInfo?: ProtocolV2DeviceInfo) => Features;
|
|
5
|
-
//# sourceMappingURL=legacyFeaturesView.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacyFeaturesView.d.ts","sourceRoot":"","sources":["../../src/deviceProfile/legacyFeaturesView.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAmBnE,eAAO,MAAM,iCAAiC,YACnC,aAAa,eACT,oBAAoB,KAChC,QA8FF,CAAC"}
|
|
@@ -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
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { EDeviceType } from '@onekeyfe/hd-shared';
|
|
2
|
-
|
|
3
|
-
import { getProtocolV2SeState, getProtocolV2SeType } from '../protocols/protocol-v2/features';
|
|
4
|
-
|
|
5
|
-
import type { Features } from '../types';
|
|
6
|
-
import type { DeviceProfile } from '../types/api/getDeviceInfo';
|
|
7
|
-
import type { ProtocolV2DeviceInfo } from '@onekeyfe/hd-transport';
|
|
8
|
-
|
|
9
|
-
const parseProtocolV2Version = (version?: string | null): [number, number, number] => {
|
|
10
|
-
if (!version) return [0, 0, 0];
|
|
11
|
-
const [major = 0, minor = 0, patch = 0] = version.split('.').map(part => Number(part) || 0);
|
|
12
|
-
return [major, minor, patch];
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Protocol V2 的 legacy `Features` 兼容视图。
|
|
17
|
-
*
|
|
18
|
-
* SDK 内部标准模型是 DeviceProfile;该函数只为 getFeatures() 等旧 API
|
|
19
|
-
* 临时合成 Features 形状的数据,不应被内部逻辑消费。
|
|
20
|
-
*
|
|
21
|
-
* 注意:以下字段在 V2 协议中没有等价信息,使用保守占位值——
|
|
22
|
-
* bootloader_mode/firmware_present 恒 false、unlocked 恒 false、
|
|
23
|
-
* capabilities 恒空、pin_protection/safety_checks 等恒 null。
|
|
24
|
-
* 内部判断请使用 device.profile / getCurrent* accessor,而不是这些占位值。
|
|
25
|
-
*/
|
|
26
|
-
export const buildProtocolV2GetFeaturesPayload = (
|
|
27
|
-
profile: DeviceProfile,
|
|
28
|
-
deviceInfo?: ProtocolV2DeviceInfo
|
|
29
|
-
): Features => {
|
|
30
|
-
const firmwareVersion = profile.versions.firmware;
|
|
31
|
-
const [fwMajor, fwMinor, fwPatch] = parseProtocolV2Version(firmwareVersion);
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
vendor: 'onekey.so',
|
|
35
|
-
major_version: fwMajor,
|
|
36
|
-
minor_version: fwMinor,
|
|
37
|
-
patch_version: fwPatch,
|
|
38
|
-
bootloader_mode: false,
|
|
39
|
-
device_id: profile.deviceId,
|
|
40
|
-
pin_protection: null,
|
|
41
|
-
passphrase_protection: profile.status.passphraseProtection,
|
|
42
|
-
language: profile.status.language,
|
|
43
|
-
label: profile.label,
|
|
44
|
-
initialized: profile.status.initialized ?? false,
|
|
45
|
-
revision: null,
|
|
46
|
-
bootloader_hash: null,
|
|
47
|
-
imported: null,
|
|
48
|
-
unlocked: false,
|
|
49
|
-
firmware_present: false,
|
|
50
|
-
needs_backup: profile.status.backupRequired,
|
|
51
|
-
flags: null,
|
|
52
|
-
model: 'pro2',
|
|
53
|
-
fw_major: fwMajor,
|
|
54
|
-
fw_minor: fwMinor,
|
|
55
|
-
fw_patch: fwPatch,
|
|
56
|
-
fw_vendor: null,
|
|
57
|
-
unfinished_backup: null,
|
|
58
|
-
no_backup: null,
|
|
59
|
-
recovery_mode: null,
|
|
60
|
-
capabilities: [],
|
|
61
|
-
backup_type: null,
|
|
62
|
-
sd_card_present: null,
|
|
63
|
-
sd_protection: null,
|
|
64
|
-
wipe_code_protection: null,
|
|
65
|
-
session_id: null,
|
|
66
|
-
passphrase_always_on_device: null,
|
|
67
|
-
safety_checks: null,
|
|
68
|
-
auto_lock_delay_ms: null,
|
|
69
|
-
display_rotation: null,
|
|
70
|
-
experimental_features: null,
|
|
71
|
-
protocol_version: deviceInfo?.protocol_version ?? null,
|
|
72
|
-
onekey_device_type: EDeviceType.Pro2,
|
|
73
|
-
onekey_serial_no: profile.serialNo,
|
|
74
|
-
serial_no: profile.serialNo,
|
|
75
|
-
ble_enable: profile.status.bleEnabled ?? undefined,
|
|
76
|
-
onekey_ble_name: profile.bleName ?? undefined,
|
|
77
|
-
ble_name: profile.bleName ?? undefined,
|
|
78
|
-
onekey_firmware_version: firmwareVersion ?? undefined,
|
|
79
|
-
onekey_firmware_build_id: profile.verify?.firmwareBuildId,
|
|
80
|
-
onekey_firmware_hash: profile.verify?.firmwareHash,
|
|
81
|
-
onekey_boot_version: profile.versions.bootloader ?? undefined,
|
|
82
|
-
bootloader_version: profile.versions.bootloader ?? undefined,
|
|
83
|
-
onekey_boot_build_id: profile.verify?.bootloaderBuildId,
|
|
84
|
-
onekey_boot_hash: profile.verify?.bootloaderHash,
|
|
85
|
-
onekey_board_version: profile.versions.board ?? undefined,
|
|
86
|
-
onekey_board_build_id: profile.verify?.boardBuildId,
|
|
87
|
-
onekey_board_hash: profile.verify?.boardHash,
|
|
88
|
-
onekey_ble_version: profile.versions.ble ?? undefined,
|
|
89
|
-
ble_ver: profile.versions.ble ?? undefined,
|
|
90
|
-
onekey_ble_build_id: profile.verify?.bleBuildId,
|
|
91
|
-
onekey_ble_hash: profile.verify?.bleHash,
|
|
92
|
-
// Pro2 的 SE 类型在 DevGetDeviceInfo 的 se1.type 上报(如 THD89)
|
|
93
|
-
onekey_se_type: getProtocolV2SeType(deviceInfo?.se1),
|
|
94
|
-
onekey_se01_version: profile.versions.se01 ?? undefined,
|
|
95
|
-
onekey_se01_hash: profile.verify?.se01Hash,
|
|
96
|
-
onekey_se01_build_id: profile.verify?.se01BuildId,
|
|
97
|
-
onekey_se01_boot_version: profile.versions.se01Boot ?? undefined,
|
|
98
|
-
onekey_se01_boot_hash: profile.verify?.se01BootHash,
|
|
99
|
-
onekey_se01_boot_build_id: profile.verify?.se01BootBuildId,
|
|
100
|
-
onekey_se01_state: getProtocolV2SeState(deviceInfo?.se1),
|
|
101
|
-
onekey_se02_version: profile.versions.se02 ?? undefined,
|
|
102
|
-
onekey_se02_hash: profile.verify?.se02Hash,
|
|
103
|
-
onekey_se02_build_id: profile.verify?.se02BuildId,
|
|
104
|
-
onekey_se02_boot_version: profile.versions.se02Boot ?? undefined,
|
|
105
|
-
onekey_se02_boot_hash: profile.verify?.se02BootHash,
|
|
106
|
-
onekey_se02_boot_build_id: profile.verify?.se02BootBuildId,
|
|
107
|
-
onekey_se02_state: getProtocolV2SeState(deviceInfo?.se2),
|
|
108
|
-
onekey_se03_version: profile.versions.se03 ?? undefined,
|
|
109
|
-
onekey_se03_hash: profile.verify?.se03Hash,
|
|
110
|
-
onekey_se03_build_id: profile.verify?.se03BuildId,
|
|
111
|
-
onekey_se03_boot_version: profile.versions.se03Boot ?? undefined,
|
|
112
|
-
onekey_se03_boot_hash: profile.verify?.se03BootHash,
|
|
113
|
-
onekey_se03_boot_build_id: profile.verify?.se03BootBuildId,
|
|
114
|
-
onekey_se03_state: getProtocolV2SeState(deviceInfo?.se3),
|
|
115
|
-
onekey_se04_version: profile.versions.se04 ?? undefined,
|
|
116
|
-
onekey_se04_hash: profile.verify?.se04Hash,
|
|
117
|
-
onekey_se04_build_id: profile.verify?.se04BuildId,
|
|
118
|
-
onekey_se04_boot_version: profile.versions.se04Boot ?? undefined,
|
|
119
|
-
onekey_se04_boot_hash: profile.verify?.se04BootHash,
|
|
120
|
-
onekey_se04_boot_build_id: profile.verify?.se04BootBuildId,
|
|
121
|
-
onekey_se04_state: getProtocolV2SeState(deviceInfo?.se4),
|
|
122
|
-
};
|
|
123
|
-
};
|