Skip to content

Commit 7f2a218

Browse files
authored
fix: Revert "feat: retry v8 (#916)" (#937)
This reverts commit e24406a. # Conflicts: # packages/app/scripts/eas-build-pre-install.sh
1 parent 46d3222 commit 7f2a218

File tree

11 files changed

+121
-105
lines changed

11 files changed

+121
-105
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
"**/browserslist": "^4",
118118
"**/immer": "^9",
119119
"**/node-fetch": "^2",
120-
"**/metro-react-native-babel-preset": "0.70.0"
120+
"**/metro-react-native-babel-preset": "0.70.0",
121+
"**/jsc-android": "npm:@onekeyfe/jsc-android"
121122
}
122123
}

packages/app/android/app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,10 @@ android {
311311
}
312312

313313

314-
packagingOptions {
315-
// Make sure libjsc.so does not packed in APK
316-
exclude "**/libjsc.so"
317-
}
314+
// packagingOptions {
315+
// // Make sure libjsc.so does not packed in APK
316+
// exclude "**/libjsc.so"
317+
// }
318318
}
319319

320320

packages/app/android/app/src/main/java/so/onekey/app/wallet/MainApplication.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import java.util.List;
3232
import android.webkit.WebView;
3333

34-
import io.csie.kudo.reactnative.v8.executor.V8ExecutorFactory;
34+
// import io.csie.kudo.reactnative.v8.executor.V8ExecutorFactory;
3535

3636
public class MainApplication extends Application implements ReactApplication , ViewModelStoreOwner {
3737
private final ViewModelStore mViewModelStore = new ViewModelStore();
@@ -61,14 +61,14 @@ protected String getJSMainModuleName() {
6161
return "__generated__/AppEntry.js";
6262
}
6363

64-
@Override
65-
protected JavaScriptExecutorFactory getJavaScriptExecutorFactory() {
66-
return new V8ExecutorFactory(
67-
getApplicationContext(),
68-
getPackageName(),
69-
AndroidInfoHelpers.getFriendlyDeviceName(),
70-
getUseDeveloperSupport());
71-
}
64+
// @Override
65+
// protected JavaScriptExecutorFactory getJavaScriptExecutorFactory() {
66+
// return new V8ExecutorFactory(
67+
// getApplicationContext(),
68+
// getPackageName(),
69+
// AndroidInfoHelpers.getFriendlyDeviceName(),
70+
// getUseDeveloperSupport());
71+
// }
7272

7373
});
7474

packages/app/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ PODS:
507507
- RNFBApp
508508
- RNGestureHandler (2.4.2):
509509
- React-Core
510-
- RNReanimated (3.0.0-rc.0):
510+
- RNReanimated (2.8.0):
511511
- DoubleConversion
512512
- FBLazyVector
513513
- FBReactNativeSpec
@@ -910,7 +910,7 @@ SPEC CHECKSUMS:
910910
RNFBApp: ca5f49bbe21f663142320337eb39956b04de4d12
911911
RNFBCrashlytics: 97bf2b05e4a5523c57adc8f9e5bf6e1b17804482
912912
RNGestureHandler: 61628a2c859172551aa2100d3e73d1e57878392f
913-
RNReanimated: 536c4a11a340b5e0e94629b24101decc2df3126e
913+
RNReanimated: 64573e25e078ae6bec03b891586d50b9ec284393
914914
RNScreens: 4d83613b50b74ed277026375dc0810893b0c347f
915915
RNSVG: 302bfc9905bd8122f08966dc2ce2d07b7b52b9f8
916916
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d

packages/app/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"expo-location": "^14.2.2",
4040
"expo-media-library": "^14.1.0",
4141
"expo-splash-screen": "^0.15.1",
42+
"jsc-android": "npm:@onekeyfe/jsc-android",
4243
"lottie-ios": "3.2.3",
4344
"lottie-react": "^2.2.1",
4445
"lottie-react-native": "5.0.1",
@@ -61,20 +62,18 @@
6162
"react-native-keyboard-manager": "^6.5.4-4",
6263
"react-native-pager-view": "5.4.15",
6364
"react-native-randombytes": "^3.6.1",
64-
"react-native-reanimated": "npm:@onekeyfe/react-native-reanimated",
65+
"react-native-reanimated": "^2.8.0",
6566
"react-native-restart": "0.0.24",
6667
"react-native-safe-area-context": "4.2.4",
6768
"react-native-screens": "3.11.1",
6869
"react-native-svg": "^12.3.0",
6970
"react-native-toast-message": "2.1.2",
70-
"react-native-v8": "^1.4.1",
7171
"react-native-vision-camera": "^2.13.3",
7272
"react-native-web": "0.17.7",
7373
"react-native-webview": "11.18.1",
7474
"readable-stream": "^3.6.0",
7575
"realm": "10.20.0-beta.2",
7676
"text-encoding": "^0.7.0",
77-
"v8-android-jit": "^10.100.0",
7877
"vision-camera-code-scanner": "^0.2.0"
7978
},
8079
"devDependencies": {
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
module.exports = {
2-
dependencies: {
3-
// disable frameprocessor and vision-camera-code-scanner
4-
// until reanimated v3 offcially supports v8
5-
'vision-camera-code-scanner': {
6-
platforms: {
7-
android: null, // disable Android platform, other platforms will still autolink if provided
8-
},
9-
},
10-
'react-native-vision-camera': {
11-
platforms: {
12-
android: null, // disable Android platform, other platforms will still autolink if provided
13-
},
14-
},
15-
},
2+
// dependencies: {
3+
// // disable frameprocessor and vision-camera-code-scanner
4+
// // until reanimated v3 offcially supports v8
5+
// 'vision-camera-code-scanner': {
6+
// platforms: {
7+
// android: null, // disable Android platform, other platforms will still autolink if provided
8+
// },
9+
// },
10+
// 'react-native-vision-camera': {
11+
// platforms: {
12+
// android: null, // disable Android platform, other platforms will still autolink if provided
13+
// },
14+
// },
15+
// },
1616
};

packages/kit/src/views/ScanQrcode/ScanCamera.ios.tsx

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import React, { FC } from 'react';
22

3-
import { BarCodeScanner } from 'expo-barcode-scanner';
4-
import { Camera } from 'expo-camera';
3+
import { runOnJS } from 'react-native-reanimated';
4+
import {
5+
Camera,
6+
useCameraDevices,
7+
useFrameProcessor,
8+
} from 'react-native-vision-camera';
9+
import { BarcodeFormat, scanBarcodes } from 'vision-camera-code-scanner';
510

611
import { ScanCameraProps } from './types';
712

@@ -10,19 +15,30 @@ const ScanCamera: FC<ScanCameraProps> = ({
1015
isActive,
1116
children,
1217
onQrcodeScanned,
13-
}) =>
14-
isActive ? (
15-
<Camera
16-
style={style}
17-
onBarCodeScanned={({ data }) => onQrcodeScanned(data)}
18-
barCodeScannerSettings={{
19-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
20-
barCodeTypes: [BarCodeScanner.Constants.BarCodeType.qr],
21-
}}
22-
>
18+
}) => {
19+
const devices = useCameraDevices();
20+
const device = devices.back;
21+
const frameProcessor = useFrameProcessor((frame) => {
22+
'worklet';
23+
24+
const detectedBarcodes = scanBarcodes(frame, [BarcodeFormat.QR_CODE], {
25+
checkInverted: true,
26+
});
27+
runOnJS(onQrcodeScanned)(detectedBarcodes[0]?.rawValue);
28+
}, []);
29+
return device ? (
30+
<>
31+
<Camera
32+
style={style}
33+
device={device}
34+
isActive={isActive}
35+
frameProcessor={frameProcessor}
36+
frameProcessorFps={5}
37+
/>
2338
{children}
24-
</Camera>
39+
</>
2540
) : null;
41+
};
2642
ScanCamera.displayName = 'ScanCamera';
2743

2844
export default ScanCamera;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import React, { FC } from 'react';
2+
3+
import { BarCodeScanner } from 'expo-barcode-scanner';
4+
import { Camera } from 'expo-camera';
5+
6+
import { ScanCameraProps } from './types';
7+
8+
const ScanCamera: FC<ScanCameraProps> = ({
9+
style,
10+
isActive,
11+
children,
12+
onQrcodeScanned,
13+
}) =>
14+
isActive ? (
15+
<Camera
16+
style={style}
17+
onBarCodeScanned={({ data }) => onQrcodeScanned(data)}
18+
barCodeScannerSettings={{
19+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
20+
barCodeTypes: [BarCodeScanner.Constants.BarCodeType.qr],
21+
}}
22+
>
23+
{children}
24+
</Camera>
25+
) : null;
26+
ScanCamera.displayName = 'ScanCamera';
27+
28+
export default ScanCamera;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/node_modules/@starcoin/starcoin/dist/starcoin.js b/node_modules/@starcoin/starcoin/dist/starcoin.js
2+
index cd80f13..80fb4b9 100644
3+
--- a/node_modules/@starcoin/starcoin/dist/starcoin.js
4+
+++ b/node_modules/@starcoin/starcoin/dist/starcoin.js
5+
@@ -438,8 +438,8 @@ var BinarySerializer = /*#__PURE__*/function () {
6+
var low = BigInt(value) & BinarySerializer.BIG_32Fs;
7+
var high = BigInt(value) >> BinarySerializer.BIG_32; // write little endian number
8+
9+
- this.serializeU32(Number(low));
10+
- this.serializeU32(Number(high));
11+
+ this.serializeU32(parseInt(low));
12+
+ this.serializeU32(parseInt(high));
13+
};
14+
15+
_proto.serializeU128 = function serializeU128(value) {
16+
@@ -475,8 +475,8 @@ var BinarySerializer = /*#__PURE__*/function () {
17+
var low = BigInt(value) & BinarySerializer.BIG_32Fs;
18+
var high = BigInt(value) >> BinarySerializer.BIG_32; // write little endian number
19+
20+
- this.serializeI32(Number(low));
21+
- this.serializeI32(Number(high));
22+
+ this.serializeI32(parseInt(low));
23+
+ this.serializeI32(parseInt(high));
24+
};
25+
26+
_proto.serializeI128 = function serializeI128(value) {

0 commit comments

Comments
 (0)