Skip to content

Commit 82b21e5

Browse files
committed
fix: sdk url
1 parent 32feb83 commit 82b21e5

File tree

12 files changed

+453
-56
lines changed

12 files changed

+453
-56
lines changed

packages/connect-examples/expo-example/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939
"buffer": "^6.0.3",
4040
"compressorjs": "^1.1.1",
4141
"elliptic": "^6.5.5",
42-
"expo": "^50.0.6",
42+
"expo": "^50.0.19",
4343
"expo-clipboard": "~5.0.0",
4444
"expo-document-picker": "~11.10.1",
4545
"expo-image-manipulator": "~11.8.0",
4646
"expo-image-picker": "~14.7.1",
4747
"expo-linking": "~6.2.2",
48-
"expo-localization": "~14.8.3",
49-
"expo-splash-screen": "~0.26.4",
48+
"expo-localization": "~14.8.4",
49+
"expo-splash-screen": "~0.26.5",
5050
"expo-status-bar": "~1.11.1",
5151
"jotai": "^2.6.4",
5252
"levelup": "^5.1.1",
@@ -57,7 +57,7 @@
5757
"react": "18.2.0",
5858
"react-dom": "18.2.0",
5959
"react-intl": "^6.6.2",
60-
"react-native": "0.73.4",
60+
"react-native": "0.73.6",
6161
"react-native-ble-manager": "^8.3.0",
6262
"react-native-crypto": "^2.2.0",
6363
"react-native-get-random-values": "^1.10.0",
@@ -84,7 +84,7 @@
8484
"@types/react-native": "~0.73.0",
8585
"@types/w3c-web-usb": "^1.0.6",
8686
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
87-
"typescript": "5.1.6"
87+
"typescript": "5.3.2"
8888
},
8989
"private": true
9090
}

packages/connect-examples/expo-example/src/components/ui/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const HeaderView = () => {
6464
>
6565
{intl.formatMessage({ id: 'tab__address_test' })}
6666
</Button>
67-
</Group.Item>{' '}
67+
</Group.Item>
6868
<Group.Item>
6969
<Button
7070
variant={route.name === Routes.SecurityCheck ? 'primary' : 'secondary'}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export const CONNECT_SRC = 'https://jssdk.onekey.so/1.0.1/';
1+
export const CONNECT_SRC = 'https://jssdk.onekeytest.com/';
22
// export const CONNECT_SRC = 'https://localhost:8087/';

packages/connect-examples/expo-example/src/data/basic.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@ const api: PlaygroundProps[] = [
103103
description: 'get logs',
104104
noDeviceIdReq: true,
105105
noConnIdReq: true,
106+
expect: {
107+
common: {
108+
normal: {
109+
success: true,
110+
},
111+
bootloader: {
112+
success: true,
113+
},
114+
},
115+
},
106116
},
107117
];
108118

packages/connect-examples/expo-example/src/data/device.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,23 @@ const api: PlaygroundProps[] = [
531531
method: 'deviceUpdateBootloader',
532532
description: 'Touch、Pro Update bootloader of a device',
533533
noDeviceIdReq: true,
534+
expect: {
535+
mini: {
536+
normal: {
537+
success: true,
538+
},
539+
},
540+
classic: {
541+
normal: {
542+
success: true,
543+
},
544+
},
545+
classic1s: {
546+
normal: {
547+
success: true,
548+
},
549+
},
550+
},
534551
},
535552
{
536553
method: 'firmwareUpdateV2',
@@ -552,6 +569,23 @@ const api: PlaygroundProps[] = [
552569
},
553570
},
554571
],
572+
expect: {
573+
mini: {
574+
normal: {
575+
requestButton: true,
576+
},
577+
},
578+
classic: {
579+
normal: {
580+
requestButton: true,
581+
},
582+
},
583+
classic1s: {
584+
normal: {
585+
requestButton: true,
586+
},
587+
},
588+
},
555589
},
556590
];
557591

packages/connect-examples/expo-example/src/data/ethereum.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ const api: PlaygroundProps[] = [
103103
},
104104
],
105105
deprecated: true,
106+
expect: {
107+
common: {
108+
normal: {
109+
unknownMessage: true,
110+
},
111+
},
112+
},
106113
},
107114
{
108115
method: 'evmSignTransaction',

packages/connect-examples/expo-example/src/testTools/securityCheckTest/apiExportTest/TestApiExport.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,11 @@ function ExecuteView() {
354354
item.presupposes.forEach((presuppose, index) => {
355355
const key = `${item.method}-${presuppose.title}-${index}`;
356356

357-
const expect = getExpectResult(deviceType, currentTestClass, presuppose.expect);
357+
const expect = getExpectResult(
358+
deviceType,
359+
currentTestClass,
360+
presuppose.expect || item.expect
361+
);
358362

359363
if (!expect) {
360364
return;

packages/connect-examples/expo-example/src/views/FirmwareScreen/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ function FirmwareUpdate({
376376
<PanelView title={intl.formatMessage({ id: 'title__device_advanced_info' })}>
377377
<XStack padding="$2" alignItems="center" gap="$8">
378378
<Text color="$text" fontSize={18} fontWeight="bold">
379-
{intl.formatMessage({ id: 'label__device_info_update_time' })}:{' '}
379+
{intl.formatMessage({ id: 'label__device_info_update_time' })}:
380380
{formatCurrentTime(Date.now())}
381381
</Text>
382382
<Button variant="primary" size="medium" onPress={onReconnectDevice}>

packages/core/src/api/FirmwareUpdate.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,13 @@ export default class FirmwareUpdate extends BaseMethod<Params> {
142142
// auto go to bootloader mode
143143
try {
144144
this.postTipMessage('AutoRebootToBootloader');
145-
const bootRes = await commands.typedCall('DeviceBackToBoot', 'Success');
145+
let bootRes;
146+
if (DeviceModelToTypes.model_mini.includes(deviceType)) {
147+
// @ts-expect-error
148+
bootRes = await commands.typedCall('BixinReboot', 'Success');
149+
} else {
150+
bootRes = await commands.typedCall('DeviceBackToBoot', 'Success');
151+
}
146152
// @ts-expect-error
147153
if (bootRes.type === 'CallMethodError') {
148154
throw ERRORS.TypedError(HardwareErrorCode.FirmwareUpdateAutoEnterBootFailure);

packages/core/src/api/FirmwareUpdateV2.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,14 @@ export default class FirmwareUpdateV2 extends BaseMethod<Params> {
234234
// auto go to bootloader mode
235235
try {
236236
this.postTipMessage('AutoRebootToBootloader');
237-
const bootRes = await commands.typedCall('DeviceBackToBoot', 'Success');
237+
let bootRes;
238+
if (DeviceModelToTypes.model_mini.includes(deviceType)) {
239+
// @ts-expect-error
240+
bootRes = await commands.typedCall('BixinReboot', 'Success');
241+
} else {
242+
bootRes = await commands.typedCall('DeviceBackToBoot', 'Success');
243+
}
244+
238245
// @ts-expect-error
239246
if (bootRes.type === 'CallMethodError') {
240247
throw ERRORS.TypedError(HardwareErrorCode.FirmwareUpdateAutoEnterBootFailure);

packages/core/src/api/device/DeviceUpdateReboot.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default class DeviceUpdateReboot extends BaseMethod<DeviceBackToBoot> {
1414
const deviceType = getDeviceType(this.device.features);
1515
let res;
1616
if (DeviceModelToTypes.model_mini.includes(deviceType)) {
17+
// @ts-expect-error
1718
res = await this.device.commands.typedCall('BixinReboot', 'Success');
1819
} else {
1920
res = await this.device.commands.typedCall('DeviceBackToBoot', 'Success');

0 commit comments

Comments
 (0)