Add react-native-worklets-core for enhanced performance and update imports for AppPinService and AuthManager
This commit is contained in:
@@ -85,6 +85,10 @@ android {
|
|||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildFeatures {
|
||||||
|
prefab true
|
||||||
|
}
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
debug {
|
debug {
|
||||||
storeFile file('debug.keystore')
|
storeFile file('debug.keystore')
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
presets: ['module:@react-native/babel-preset'],
|
presets: ['module:@react-native/babel-preset'],
|
||||||
|
plugins: [
|
||||||
|
'react-native-worklets-core/plugin',
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
20
package-lock.json
generated
20
package-lock.json
generated
@@ -17,6 +17,7 @@
|
|||||||
"react-native-keychain": "^10.0.0",
|
"react-native-keychain": "^10.0.0",
|
||||||
"react-native-safe-area-context": "^5.5.2",
|
"react-native-safe-area-context": "^5.5.2",
|
||||||
"react-native-vision-camera": "^4.7.3",
|
"react-native-vision-camera": "^4.7.3",
|
||||||
|
"react-native-worklets-core": "^1.1.0",
|
||||||
"vision-camera-face-detector": "^0.1.8"
|
"vision-camera-face-detector": "^0.1.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -10161,6 +10162,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/react-native-worklets-core": {
|
||||||
|
"version": "1.6.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-native-worklets-core/-/react-native-worklets-core-1.6.2.tgz",
|
||||||
|
"integrity": "sha512-zw73JfL40ZL/OD2TOil1El4D9ZwS3l6AFPeFfUWXh+V2/dHN8i28jHX8QXlz5DYtAkR+Ju3U1h4yiaODi/igZw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"string-hash-64": "^1.0.3"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": "*",
|
||||||
|
"react-native": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/react-native/node_modules/commander": {
|
"node_modules/react-native/node_modules/commander": {
|
||||||
"version": "12.1.0",
|
"version": "12.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",
|
||||||
@@ -11046,6 +11060,12 @@
|
|||||||
"safe-buffer": "~5.2.0"
|
"safe-buffer": "~5.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/string-hash-64": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-hash-64/-/string-hash-64-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-D5OKWKvDhyVWWn2x5Y9b+37NUllks34q1dCDhk/vYcso9fmhs+Tl3KR/gE4v5UNj2UA35cnX4KdVVGkG1deKqw==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/string-length": {
|
"node_modules/string-length": {
|
||||||
"version": "4.0.2",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz",
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
"react-native-keychain": "^10.0.0",
|
"react-native-keychain": "^10.0.0",
|
||||||
"react-native-safe-area-context": "^5.5.2",
|
"react-native-safe-area-context": "^5.5.2",
|
||||||
"react-native-vision-camera": "^4.7.3",
|
"react-native-vision-camera": "^4.7.3",
|
||||||
|
"react-native-worklets-core": "^1.6.2",
|
||||||
"vision-camera-face-detector": "^0.1.8"
|
"vision-camera-face-detector": "^0.1.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import {
|
|||||||
TextInput,
|
TextInput,
|
||||||
Alert,
|
Alert,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { verifyPin } from '../auth/AppPinService';
|
import { verifyPin } from './authorised/AppPinService';
|
||||||
import { unlockWithDevice, unlockApp } from '../auth/AuthManager';
|
import { unlockWithDevice, unlockApp } from './authorised/AuthManager';
|
||||||
|
|
||||||
const LockScreen = ({ onUnlock }: any) => {
|
const LockScreen = ({ onUnlock }: any) => {
|
||||||
const [pin, setPin] = useState('');
|
const [pin, setPin] = useState('');
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { AppState, View, Text } from 'react-native';
|
import { AppState, View, Text } from 'react-native';
|
||||||
|
import { isPinSet } from './authorised/AppPinService';
|
||||||
|
import { isAppLocked, lockApp } from './authorised/AuthManager';
|
||||||
|
import SetPinScreen from './SetPinScreen';
|
||||||
|
import LockScreen from './LockScreen';
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
const [locked, setLocked] = useState(true);
|
const [locked, setLocked] = useState(true);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { View, TextInput, Text, TouchableOpacity } from 'react-native';
|
import { View, TextInput, Text, TouchableOpacity } from 'react-native';
|
||||||
import { savePin } from '../auth/AppPinService';
|
import { savePin } from './authorised/AppPinService';
|
||||||
|
|
||||||
const SetPinScreen = ({ onDone }: any) => {
|
const SetPinScreen = ({ onDone }: any) => {
|
||||||
const [pin, setPin] = useState('');
|
const [pin, setPin] = useState('');
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||||
import { deviceAuthenticate } from './DeviceAuth';
|
import { authenticateWithDeviceLock } from './deviceAuth';
|
||||||
|
|
||||||
const LOCK_KEY = 'APP_LOCKED';
|
const LOCK_KEY = 'APP_LOCKED';
|
||||||
|
|
||||||
@@ -17,5 +17,5 @@ export const isAppLocked = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const unlockWithDevice = async () => {
|
export const unlockWithDevice = async () => {
|
||||||
return await deviceAuthenticate();
|
return await authenticateWithDeviceLock();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user