add card verification
This commit is contained in:
parent
00a64681f5
commit
f31564e8ec
|
@ -1246,7 +1246,7 @@ PODS:
|
||||||
- Yoga
|
- Yoga
|
||||||
- react-native-get-random-values (1.11.0):
|
- react-native-get-random-values (1.11.0):
|
||||||
- React-Core
|
- React-Core
|
||||||
- react-native-status-keycard (2.6.1):
|
- react-native-status-keycard (2.6.2):
|
||||||
- Keycard
|
- Keycard
|
||||||
- React
|
- React
|
||||||
- React-nativeconfig (0.75.3)
|
- React-nativeconfig (0.75.3)
|
||||||
|
@ -1826,7 +1826,7 @@ SPEC CHECKSUMS:
|
||||||
React-Mapbuffer: 714f2fae68edcabfc332b754e9fbaa8cfc68fdd4
|
React-Mapbuffer: 714f2fae68edcabfc332b754e9fbaa8cfc68fdd4
|
||||||
React-microtasksnativemodule: 4943ad8f99be8ccf5a63329fa7d269816609df9e
|
React-microtasksnativemodule: 4943ad8f99be8ccf5a63329fa7d269816609df9e
|
||||||
react-native-get-random-values: 21325b2244dfa6b58878f51f9aa42821e7ba3d06
|
react-native-get-random-values: 21325b2244dfa6b58878f51f9aa42821e7ba3d06
|
||||||
react-native-status-keycard: 9803b8545df3bde6880a2419ffbf3df404b3201f
|
react-native-status-keycard: 76a5c826352ee1d70de854b3e8b12670946bc1c8
|
||||||
React-nativeconfig: 4a9543185905fe41014c06776bf126083795aed9
|
React-nativeconfig: 4a9543185905fe41014c06776bf126083795aed9
|
||||||
React-NativeModulesApple: 0506da59fc40d2e1e6e12a233db5e81c46face27
|
React-NativeModulesApple: 0506da59fc40d2e1e6e12a233db5e81c46face27
|
||||||
React-perflogger: 3bbb82f18e9ac29a1a6931568e99d6305ef4403b
|
React-perflogger: 3bbb82f18e9ac29a1a6931568e99d6305ef4403b
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
"react-native": "0.75.3",
|
"react-native": "0.75.3",
|
||||||
"react-native-get-random-values": "^1.11.0",
|
"react-native-get-random-values": "^1.11.0",
|
||||||
"react-native-modal": "^13.0.1",
|
"react-native-modal": "^13.0.1",
|
||||||
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.6.1",
|
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.6.2",
|
||||||
"react-native-svg": "^15.7.1",
|
"react-native-svg": "^15.7.1",
|
||||||
"react-native-vector-icons": "^10.1.0",
|
"react-native-vector-icons": "^10.1.0",
|
||||||
"react-native-vision-camera": "^4.5.3",
|
"react-native-vision-camera": "^4.5.3",
|
||||||
|
@ -13225,8 +13225,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-native-status-keycard": {
|
"node_modules/react-native-status-keycard": {
|
||||||
"version": "2.6.1",
|
"version": "2.6.2",
|
||||||
"resolved": "git+ssh://git@github.com/status-im/react-native-status-keycard.git#2f9d46b2c720a8f2d76b510259bf8f538463ffa3",
|
"resolved": "git+ssh://git@github.com/status-im/react-native-status-keycard.git#26c476b362e68aa9076412c97de082abaabab4bd",
|
||||||
"license": "MPL 2.0"
|
"license": "MPL 2.0"
|
||||||
},
|
},
|
||||||
"node_modules/react-native-svg": {
|
"node_modules/react-native-svg": {
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
"react-native": "0.75.3",
|
"react-native": "0.75.3",
|
||||||
"react-native-get-random-values": "^1.11.0",
|
"react-native-get-random-values": "^1.11.0",
|
||||||
"react-native-modal": "^13.0.1",
|
"react-native-modal": "^13.0.1",
|
||||||
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.6.1",
|
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#refs/tags/v2.6.2",
|
||||||
"react-native-svg": "^15.7.1",
|
"react-native-svg": "^15.7.1",
|
||||||
"react-native-vector-icons": "^10.1.0",
|
"react-native-vector-icons": "^10.1.0",
|
||||||
"react-native-vision-camera": "^4.5.3",
|
"react-native-vision-camera": "^4.5.3",
|
||||||
|
|
|
@ -26,6 +26,7 @@ enum Step {
|
||||||
LoginSuccess,
|
LoginSuccess,
|
||||||
LoginError,
|
LoginError,
|
||||||
FactoryReset,
|
FactoryReset,
|
||||||
|
NotAuthentic,
|
||||||
}
|
}
|
||||||
|
|
||||||
const Main = () => {
|
const Main = () => {
|
||||||
|
@ -105,6 +106,12 @@ const Main = () => {
|
||||||
newPinCounter = appInfo["pin-retry-counter"];
|
newPinCounter = appInfo["pin-retry-counter"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (appInfo["authentic?"] === false) {
|
||||||
|
setStep(Step.NotAuthentic);
|
||||||
|
await stopNFC();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (stepRef.current) {
|
switch (stepRef.current) {
|
||||||
case Step.Discovery:
|
case Step.Discovery:
|
||||||
if (appInfo["initialized?"]) {
|
if (appInfo["initialized?"]) {
|
||||||
|
@ -208,6 +215,7 @@ const Main = () => {
|
||||||
|
|
||||||
const loadData = async () => {
|
const loadData = async () => {
|
||||||
await Keycard.setPairings(await getPairings());
|
await Keycard.setPairings(await getPairings());
|
||||||
|
await Keycard.setCertificationAuthorities(["029ab99ee1e7a71bdf45b3f9c58c99866ff1294d2c1e304e228a86e10c3343501c"]);
|
||||||
const tmp = await AsyncStorage.getItem("wallet-key");
|
const tmp = await AsyncStorage.getItem("wallet-key");
|
||||||
walletKey.current = tmp !== null ? tmp : "";
|
walletKey.current = tmp !== null ? tmp : "";
|
||||||
|
|
||||||
|
@ -319,6 +327,7 @@ const Main = () => {
|
||||||
{step == Step.FactoryReset && <InfoScreen icon="alert-circle" title="Factory Reset" message={factoryResetMessage()} onPressFunc={connectCard} onCancelFunc={cancelFactoryReset}></InfoScreen>}
|
{step == Step.FactoryReset && <InfoScreen icon="alert-circle" title="Factory Reset" message={factoryResetMessage()} onPressFunc={connectCard} onCancelFunc={cancelFactoryReset}></InfoScreen>}
|
||||||
{step == Step.LoginSuccess && <InfoScreen icon="check-circle" title="Success!" message="Login successful. You can now proceed to the Operator Dashboard in your browser" onPressFunc={toHome}></InfoScreen>}
|
{step == Step.LoginSuccess && <InfoScreen icon="check-circle" title="Success!" message="Login successful. You can now proceed to the Operator Dashboard in your browser" onPressFunc={toHome}></InfoScreen>}
|
||||||
{step == Step.LoginError && <InfoScreen icon="close-circle" title="Error" message={errorMessage} onPressFunc={toHome}></InfoScreen>}
|
{step == Step.LoginError && <InfoScreen icon="close-circle" title="Error" message={errorMessage} onPressFunc={toHome}></InfoScreen>}
|
||||||
|
{step == Step.NotAuthentic && <InfoScreen icon="close-circle" title="Error" message="We couldn't verify that this is an authentic Keycard. Please contact your distributor." onPressFunc={cancel}></InfoScreen>}
|
||||||
<NFCModal isVisible={isModalVisible} onChangeFunc={stopNFC}></NFCModal>
|
<NFCModal isVisible={isModalVisible} onChangeFunc={stopNFC}></NFCModal>
|
||||||
</ImageBackground>
|
</ImageBackground>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue