diff --git a/.talismanrc b/.talismanrc index 10ab7fbb1..2d3425104 100644 --- a/.talismanrc +++ b/.talismanrc @@ -24,18 +24,34 @@ fileignoreconfig: - filename: screens/AuthScreenController.ts checksum: 18af825821bc95e1056050623b804a5a8e7435b9e3383916a5d63024eeba9553 - filename: screens/WelcomeScreenController.ts - checksum: d8fe74404c80bf435459f4d20427a661fb622f0ee9f754345616abd346b98d14 + checksum: 71917c8c543a4a5b7ab61df259b785d233a80718123b0c8edf6ec81e1b3a81e0 - filename: shared/telemetry/TelemetryUtils.js - checksum: 9a61cd59a3718adf1f14faf3024fec66a3295ef373878a878a28e5cb1287afaa -- filename: machines/store.ts - checksum: bbee269bd9703644c2a345819291caa42479b5ad0d5288713da780495b2ffb49 + checksum: ffe9aac2dcc590b98b0d588885c088eff189504ade653a77f74b67312bfd27ad - filename: shared/fileStorage.ts checksum: 07cb337dc1d5b0f0eef56270ac4f4f589260ee5e490183c024cf98a2aeafb139 - filename: shared/storage.ts checksum: c8d874aa373bdf526bf59192139822f56915e702ef673bac4e0d7549b0fea3d0 -- filename: machines/issuersMachine.ts - checksum: 8e5c4cf8c4a1803ae889dee1fd3390aa59ae4b39901fb55135b196fe039617b1 - filename: screens/Issuers/IssuersScreen.tsx checksum: bc12c43ccc27ac04e5763fa6a6ed3cee63e4362ba5666c160b5e53269de924ab -- filename: package.json - checksum: fdd5905228a1afbfb004c710fd6c61adf073a12840200327c0592b76bea5e7e3 \ No newline at end of file +- filename: screens/Home/IntroSlidersScreen.tsx + checksum: 72ef913857448ef05763e52e32356faa2d1f3de8130a1c638d1897f44823031f +- filename: shared/commonUtil.ts + checksum: 01c3fdcd2f1c1757eae0c6a27fe04eb70c2aaf8660c604f3301997484592b66c +- filename: screens/Home/MyVcs/GetIdInputModal.tsx + checksum: 5c736ed79a372d0ffa7c02eb33d0dc06edbbb08d120978ff287f5f06cd6c7746 +- filename: shared/openId4VCI/Utils.ts + checksum: 2bd39d84099d700e5bddeebe87dfb3b0e3075edc0a4d06ce48b428b0a85e238f +- filename: machines/issuersMachine.ts + checksum: b925df13236145867fc7a1a2a703faca854e8c937dac9451008399e3937592fb +- filename: machines/issuersMachine.typegen.ts + checksum: f5e2c89f9029b1e590173e37b2cf6586d5229ecb7d4dfd4c5f050f9416d3c1cd +- filename: machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.ts + checksum: eec77ca61540327ff7cab3489ebdfd47aa373fd20b3ff87a6c322cd48d35fe8f +- filename: machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.typegen.ts + checksum: f1f504bd8c14496ee71f8eb7f40d54411cc05be03347d644dcc2cca187a20678 +- filename: machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.ts + checksum: 237a2640b7db70770d65da67c79f2929581e32f1162517e50b8d37e409f3387d +- filename: machines/store.ts + checksum: 0695d833df9ec1e1f6ae2bd81631630bb1039dec387718acb153bcb843c952cd +- filename: shared/cryptoutil/cryptoUtil.ts + checksum: b785ff3f01ab9530119072c4d38195048bfeee6155c54ea7dd031559acb722f3 diff --git a/App.tsx b/App.tsx index 19c358e4d..d4aeaba87 100644 --- a/App.tsx +++ b/App.tsx @@ -18,7 +18,7 @@ import {Alert} from 'react-native'; import {configureTelemetry} from './shared/telemetry/TelemetryUtils'; import {MessageOverlay} from './components/MessageOverlay'; import SecureKeystore from 'react-native-secure-keystore'; -import {isCustomSecureKeystore} from './shared/cryptoutil/cryptoUtil'; +import {isHardwareKeystoreExists} from './shared/cryptoutil/cryptoUtil'; import i18n from './i18n'; import './shared/flipperConfig'; @@ -91,7 +91,7 @@ const AppInitialization: React.FC = () => { const {t} = useTranslation('common'); useEffect(() => { - if (isCustomSecureKeystore()) { + if (isHardwareKeystoreExists) { SecureKeystore.updatePopup( t('biometricPopup.title'), t('biometricPopup.description'), diff --git a/components/ActivityLogText.strings.json b/components/ActivityLogText.strings.json deleted file mode 100644 index aea85f320..000000000 --- a/components/ActivityLogText.strings.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "VC_SHARED": "shared", - "VC_RECEIVED": "received", - "VC_RECEIVED_NOT_SAVED": "received was not saved", - "VC_DELETED": "deleted", - "VC_DOWNLOADED": "downloaded", - "VC_REVOKED": "revoked", - "VC_SHARED_WITH_VERIFICATION_CONSENT": "shared. Consent is given for presence verification", - "VC_RECEIVED_WITH_PRESENCE_VERIFIED": "received. Presence verified", - "VC_RECEIVED_BUT_PRESENCE_VERIFICATION_FAILED": "received. Presence verification failed", - "PRESENCE_VERIFIED_AND_VC_SHARED": "verified and shared", - "PRESENCE_VERIFICATION_FAILED": "verification failed", - "QRLOGIN_SUCCESFULL": "QRLogin successful", - "WALLET_BINDING_SUCCESSFULL": "Activation successful", - "WALLET_BINDING_FAILURE": "Activation failed", - "VC_REMOVED": "Removed from wallet", - "TAMPERED_VC_REMOVED": "Some cards removed due to malicious activity" -} \ No newline at end of file diff --git a/components/DeviceInfoList.strings.json b/components/DeviceInfoList.strings.json deleted file mode 100644 index c532dd34c..000000000 --- a/components/DeviceInfoList.strings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "requestedBy": "Requested by", - "sentBy": "Sent by", - "deviceRefNumber": "Device reference number", - "name": "Name" -} \ No newline at end of file diff --git a/components/EditableListItem.tsx b/components/EditableListItem.tsx index 847b8a30e..4a6443ee8 100644 --- a/components/EditableListItem.tsx +++ b/components/EditableListItem.tsx @@ -38,16 +38,16 @@ export const EditableListItem: React.FC = props => { /> - + {props.title} - {props.content} + {props.content} void; progress?: boolean; errorMessage?: string; + titleColor: string; } interface ListItemProps { diff --git a/components/FaceScanner.strings.json b/components/FaceScanner.strings.json deleted file mode 100644 index 9e26dfeeb..000000000 --- a/components/FaceScanner.strings.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/components/FaceScanner.tsx b/components/FaceScanner.tsx index b32c1cc0e..077b1b8d0 100644 --- a/components/FaceScanner.tsx +++ b/components/FaceScanner.tsx @@ -26,6 +26,7 @@ import {GlobalContext} from '../shared/GlobalContext'; import {selectIsActive} from '../machines/app'; import {RotatingIcon} from './RotatingIcon'; import {Theme} from './ui/styleUtils'; +import {isIOS} from '../shared/constants'; export const FaceScanner: React.FC = props => { const {t} = useTranslation('FaceScanner'); @@ -130,7 +131,7 @@ export const FaceScanner: React.FC = props => { )} {/* TODO: remove warning when iOS SDK is ready */} - {Platform.OS === 'ios' && ( + {isIOS() && ( (face-matching in iOS is mocked) diff --git a/components/GlobalContextProvider.tsx b/components/GlobalContextProvider.tsx index d6b1af9c5..94d8a2aef 100644 --- a/components/GlobalContextProvider.tsx +++ b/components/GlobalContextProvider.tsx @@ -1,8 +1,9 @@ import React from 'react'; import {useInterpret} from '@xstate/react'; -import {appMachine, logState} from '../machines/app'; +import {appMachine} from '../machines/app'; import {GlobalContext} from '../shared/GlobalContext'; +import {logState} from '../shared/commonUtil'; export const GlobalContextProvider: React.FC = props => { const appService = useInterpret(appMachine, {devTools: __DEV__}); diff --git a/components/OIDcAuth.strings.json b/components/OIDcAuth.strings.json deleted file mode 100644 index 6f2ae5672..000000000 --- a/components/OIDcAuth.strings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "title": "OIDC Authentication", - "text": "To be replaced with the OIDC provider UI", - "verify": "Verify" -} \ No newline at end of file diff --git a/components/PasscodeVerify.strings.json b/components/PasscodeVerify.strings.json deleted file mode 100644 index 4d6fc21fb..000000000 --- a/components/PasscodeVerify.strings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "passcodeMismatchError": "Passcode did not match." -} \ No newline at end of file diff --git a/components/QrScanner.strings.json b/components/QrScanner.strings.json deleted file mode 100644 index 805911b63..000000000 --- a/components/QrScanner.strings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "missingPermissionText": "This app uses the camera to scan the QR code of another device.", - "allowCameraButton": "Allow access to camera" -} \ No newline at end of file diff --git a/components/VC/MosipVCItem/MosipVCItemContent.tsx b/components/VC/MosipVCItem/MosipVCItemContent.tsx index bef5510a5..090aeb61c 100644 --- a/components/VC/MosipVCItem/MosipVCItemContent.tsx +++ b/components/VC/MosipVCItem/MosipVCItemContent.tsx @@ -323,7 +323,7 @@ export const MosipVCItemContent: React.FC< function faceImageSource() { return !verifiableCredential - ? Theme.ProfileIcon + ? Theme.cardFaceIcon : { uri: props.vcMetadata.isFromOpenId4VCI() ? verifiableCredential?.credentialSubject.face diff --git a/components/VC/MosipVCItem/MosipVCItemDetails.tsx b/components/VC/MosipVCItem/MosipVCItemDetails.tsx index 7c6cf9977..014013ade 100644 --- a/components/VC/MosipVCItem/MosipVCItemDetails.tsx +++ b/components/VC/MosipVCItem/MosipVCItemDetails.tsx @@ -49,7 +49,7 @@ const getProfileImage = ( return {uri: props.vc?.credential.biometrics.face}; } } - return Theme.ProfileIcon; + return Theme.cardFaceIcon; }; export const MosipVCItemDetails: React.FC< diff --git a/components/VcDetails.strings.json b/components/VcDetails.strings.json deleted file mode 100644 index d6e3189a4..000000000 --- a/components/VcDetails.strings.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "generatedOn": "Generated On", - "status": "Status", - "valid": "Valid", - "photo": "Photo", - "fullName": "Full Name", - "gender": "Gender", - "dateOfBirth": "Date of Birth", - "phoneNumber": "Phone Number", - "email": "Email", - "address": "Address", - "reasonForSharing": "Reason for sharing", - "idType": "ID Type", - "id": "Id", - "nationalCard": "National Card", - "uin": "UIN", - "vid": "VID", - "enableVerification": "Enable Verification", - "profileAuthenticated": "Profile is authenticated!", - "offlineAuthDisabledHeader": "Offline Authentication disabled!", - "offlineAuthDisabledMessage": "Click 'Enable Authentication' to enable this credentials to be used for offline authentication." -} diff --git a/components/ui/Loader.tsx b/components/ui/Loader.tsx index 26856fa1b..ccb115643 100644 --- a/components/ui/Loader.tsx +++ b/components/ui/Loader.tsx @@ -26,7 +26,7 @@ export const Loader: React.FC = props => { {props.subTitle && ( {props.subTitle} diff --git a/components/ui/Modal.tsx b/components/ui/Modal.tsx index 56d96d7e8..713a777ff 100644 --- a/components/ui/Modal.tsx +++ b/components/ui/Modal.tsx @@ -57,7 +57,7 @@ export const Modal: React.FC = props => { color={ props.headerLabelColor ? props.headerLabelColor - : Theme.Colors.profileLanguageValue + : Theme.Colors.textLabel }> {props.headerLabel} diff --git a/components/ui/themes/DefaultTheme.ts b/components/ui/themes/DefaultTheme.ts index 6cb02a941..8e0c45a50 100644 --- a/components/ui/themes/DefaultTheme.ts +++ b/components/ui/themes/DefaultTheme.ts @@ -1,6 +1,7 @@ /* eslint-disable sonarjs/no-duplicate-string */ import {Dimensions, Platform, StyleSheet, ViewStyle} from 'react-native'; import {Spacing} from '../styleUtils'; +import {isIOS} from '../../../shared/constants'; const Colors = { Black: '#000000', @@ -61,11 +62,7 @@ export const DefaultTheme = { borderBottomColor: Colors.Grey6, whiteBackgroundColor: Colors.White, lightGreyBackgroundColor: Colors.LightGrey, - profileLanguageValue: Colors.Grey, aboutVersion: Colors.Gray40, - profileAuthFactorUnlock: Colors.Grey, - profileLabel: Colors.Black, - profileValue: Colors.Grey, switchHead: Colors.Orange, switchTrackTrue: Colors.LightOrange, switchTrackFalse: Colors.Grey, @@ -89,7 +86,6 @@ export const DefaultTheme = { OnboardingCloseIcon: Colors.White, WarningIcon: Colors.Warning, DefaultToggle: Colors.LightOrange, - ProfileIconBg: Colors.LightOrange, GrayText: Colors.GrayText, errorGrayText: Colors.mediumDarkGrey, gradientBtn: ['#F59B4B', '#E86E04'], @@ -108,6 +104,8 @@ export const DefaultTheme = { statusMessage: Colors.Gray40, blackIcon: Colors.Black, uncheckedIcon: Colors.uncheckedIcon, + settingsLabel: Colors.Black, + chevronRightColor: Colors.Grey, }, Styles: StyleSheet.create({ title: { @@ -524,9 +522,9 @@ export const DefaultTheme = { width: Dimensions.get('window').width * 0.32, borderBottomWidth: 1, marginBottom: 2, - borderColor: Platform.OS === 'ios' ? 'transparent' : Colors.Grey, - bottom: Platform.OS === 'ios' ? 50 : 24, - height: Platform.OS === 'ios' ? 100 : 'auto', + borderColor: isIOS() ? 'transparent' : Colors.Grey, + bottom: isIOS() ? 50 : 24, + height: isIOS() ? 100 : 'auto', }, idInputBottom: { borderBottomColor: Colors.Orange, @@ -1261,7 +1259,7 @@ export const DefaultTheme = { CardBackground: require('../../../assets/card_bg.png'), OpenCard: require('../../../assets/card_bg.png'), activationPending: require('../../../assets/pending_activation.png'), - ProfileIcon: require('../../../assets/placeholder-photo.png'), + cardFaceIcon: require('../../../assets/placeholder-photo.png'), MosipSplashLogo: require('../../../assets/icon.png'), MosipLogo: require('../../../assets/mosip-logo.png'), CameraFlipIcon: require('../../../assets/camera-flip-icon.png'), @@ -1331,17 +1329,16 @@ export const DefaultTheme = { }; function generateBoxShadowStyle() { - if (Platform.OS === 'ios') { + if (isIOS()) { return { shadowColor: '#000', shadowOffset: {width: 1, height: 1.2}, shadowOpacity: 0.3, shadowRadius: 2.5, }; - } else if (Platform.OS === 'android') { - return { - elevation: 4, - shadowColor: '#000', - }; } + return { + elevation: 4, + shadowColor: '#000', + }; } diff --git a/components/ui/themes/PurpleTheme.ts b/components/ui/themes/PurpleTheme.ts index aa20533a9..e51a48438 100644 --- a/components/ui/themes/PurpleTheme.ts +++ b/components/ui/themes/PurpleTheme.ts @@ -1,6 +1,7 @@ /* eslint-disable sonarjs/no-duplicate-string */ import {Dimensions, Platform, StyleSheet, ViewStyle} from 'react-native'; import {Spacing} from '../styleUtils'; +import {isIOS} from '../../../shared/constants'; const Colors = { Black: '#231F20', @@ -64,11 +65,7 @@ export const PurpleTheme = { whiteBackgroundColor: Colors.White, lightGreyBackgroundColor: Colors.LightGrey, errorGrayText: Colors.mediumDarkGrey, - profileLanguageValue: Colors.Grey, aboutVersion: Colors.Gray40, - profileAuthFactorUnlock: Colors.Grey, - profileLabel: Colors.Black, - profileValue: Colors.Grey, switchHead: Colors.Purple, switchTrackTrue: Colors.LightPurple, switchTrackFalse: Colors.Grey, @@ -92,7 +89,6 @@ export const PurpleTheme = { OnboardingCloseIcon: Colors.White, WarningIcon: Colors.Warning, DefaultToggle: Colors.LightPurple, - ProfileIconBg: Colors.LightPurple, GrayText: Colors.GrayText, gradientBtn: Colors.GradientColors, dotColor: Colors.dorColor, @@ -110,6 +106,8 @@ export const PurpleTheme = { statusMessage: Colors.Gray40, blackIcon: Colors.Black, uncheckedIcon: Colors.uncheckedIcon, + settingsLabel: Colors.Black, + chevronRightColor: Colors.Grey, }, Styles: StyleSheet.create({ title: { @@ -527,9 +525,9 @@ export const PurpleTheme = { width: Dimensions.get('window').width * 0.32, borderBottomWidth: 1, marginBottom: 2, - borderColor: Platform.OS === 'ios' ? 'transparent' : Colors.Grey, - bottom: Platform.OS === 'ios' ? 50 : 24, - height: Platform.OS === 'ios' ? 100 : 'auto', + borderColor: isIOS() ? 'transparent' : Colors.Grey, + bottom: isIOS() ? 50 : 24, + height: isIOS() ? 100 : 'auto', }, idInputBottom: { borderBottomColor: Colors.Orange, @@ -1260,7 +1258,7 @@ export const PurpleTheme = { CardBackground: require('../../../assets/card_bg.png'), OpenCard: require('../../../assets/card_bg.png'), activationPending: require('../../../assets/pending_activation.png'), - ProfileIcon: require('../../../purpleAssets/profile_icon.png'), + cardFaceIcon: require('../../../purpleAssets/profile_icon.png'), MosipSplashLogo: require('../../../assets/icon.png'), MosipLogo: require('../../../assets/mosip-logo.png'), CameraFlipIcon: require('../../../assets/camera-flip-icon.png'), @@ -1330,17 +1328,16 @@ export const PurpleTheme = { }; function generateBoxShadowStyle() { - if (Platform.OS === 'ios') { + if (isIOS()) { return { shadowColor: '#000', shadowOffset: {width: 1, height: 1.2}, shadowOpacity: 0.3, shadowRadius: 2.5, }; - } else if (Platform.OS === 'android') { - return { - elevation: 4, - shadowColor: '#000', - }; } + return { + elevation: 4, + shadowColor: '#000', + }; } diff --git a/locales/ara.json b/locales/ara.json index 237416ce7..afa299427 100644 --- a/locales/ara.json +++ b/locales/ara.json @@ -202,6 +202,12 @@ }, "AddVcModal": { "requestingCredential": "جارٍ طلب بيانات الاعتماد...", + "confirmationDialog": { + "title": "هل تريد إلغاء التنزيل؟", + "message": "بمجرد الإلغاء، لن يتم تنزيل بطاقتك وستحتاج إلى إعادة بدء التنزيل.", + "wait": "لا، سأنتظر", + "cancel": "نعم، إلغاء" + }, "errors": { "input": { "empty": "فارغًا", @@ -357,11 +363,6 @@ "confirmPasscode": "قم بتأكيد رمز المرور", "enterPasscode": "أدخل رمز المرور الخاص" }, - "AppMetaData": { - "header": "حول إنجي", - "version": "الإصدار", - "useBle": "مدعوم من BLE" - }, "QrLogin": { "title": "QR تسجيل الدخول", "alignQr": "قم بمحاذاة رمز الاستجابة السريعة داخل الإطار للمسح الضوئي", diff --git a/locales/en.json b/locales/en.json index a18013274..4aca4ed1c 100644 --- a/locales/en.json +++ b/locales/en.json @@ -209,6 +209,12 @@ }, "AddVcModal": { "requestingCredential": "Requesting credential...", + "confirmationDialog": { + "title": "Do you want to cancel downloading?", + "message": "Once cancelled, your card will not be downloaded and you need to reinitiate the download.", + "wait": "No, I’ll wait", + "cancel": "Yes, Cancel" + }, "errors": { "input": { "empty": "The input cannot be empty", @@ -364,11 +370,6 @@ "confirmPasscode": "Confirm passcode", "enterPasscode": "Enter your passcode" }, - "AppMetaData": { - "header": "About Inji", - "version": "Version", - "useBle": "Powered by BLE" - }, "QrLogin": { "title": "QR Login", "alignQr": "Align the QR code within the frame to scan", diff --git a/locales/fil.json b/locales/fil.json index dae27bd6d..d8c388300 100644 --- a/locales/fil.json +++ b/locales/fil.json @@ -201,6 +201,12 @@ }, "AddVcModal": { "requestingCredential": "Humihiling ng kredensyal...", + "confirmationDialog": { + "title": "Gusto mo bang kanselahin ang pag-download?", + "message": "Kapag nakansela, hindi na mada-download ang iyong card at kailangan mong simulan muli ang pag-download.", + "wait": "Hindi, maghihintay ako", + "cancel": "Oo, Kanselahin" + }, "errors": { "input": { "empty": "Hindi maaaring walang laman ang input", @@ -356,11 +362,6 @@ "confirmPasscode": "Kumpirmahin ang passcode", "enterPasscode": "Ilagay ang iyong passcode" }, - "AppMetaData": { - "header": "Tungkol kay Inji", - "version": "Bersyon", - "useBle": "Pinapatakbo ng BLE" - }, "QrLogin": { "title": "QR Login", "alignQr": "I-align ang QR code sa loob ng frame para i-scan", diff --git a/locales/hin.json b/locales/hin.json index 9b4cb72bc..8ab7fefc9 100644 --- a/locales/hin.json +++ b/locales/hin.json @@ -200,6 +200,12 @@ }, "AddVcModal": { "requestingCredential": "क्रेडेंशियल का अनुरोध कर रहा है...", + "confirmationDialog": { + "title": "क्या आप डाउनलोडिंग रद्द करना चाहते हैं?", + "message": "एक बार रद्द होने पर, आपका कार्ड डाउनलोड नहीं किया जाएगा और आपको डाउनलोड फिर से शुरू करना होगा।", + "wait": "नहीं, मैं इंतजार करूंगा", + "cancel": "हाँ, रद्द करें" + }, "errors": { "input": { "empty": "इनपुट खाली नहीं हो सकता", @@ -356,11 +362,6 @@ "confirmPasscode": "पासकोड की पुष्टि करें", "enterPasscode": "अपना पासकोड प्रविष्ट करें" }, - "AppMetaData": { - "header": "इंजी के बारे में", - "version": "संस्करण", - "useBle": "BLE द्वारा संचालित" - }, "QrLogin": { "title": "क्यूआर लॉगिन", "alignQr": "स्कैन करने के लिए फ्रेम के भीतर क्यूआर कोड को संरेखित करें", diff --git a/locales/kan.json b/locales/kan.json index e7ba9b202..221c6cdc3 100644 --- a/locales/kan.json +++ b/locales/kan.json @@ -198,6 +198,12 @@ }, "AddVcModal": { "requestingCredential": "ರುಜುವಾತುಗಳನ್ನು ವಿನಂತಿಸಲಾಗುತ್ತಿದೆ...", + "confirmationDialog": { + "title": "ನೀವು ಡೌನ್‌ಲೋಡ್ ಮಾಡುವುದನ್ನು ರದ್ದುಗೊಳಿಸಲು ಬಯಸುವಿರಾ?", + "message": "ಒಮ್ಮೆ ರದ್ದುಗೊಳಿಸಿದರೆ, ನಿಮ್ಮ ಕಾರ್ಡ್ ಡೌನ್‌ಲೋಡ್ ಆಗುವುದಿಲ್ಲ ಮತ್ತು ನೀವು ಡೌನ್‌ಲೋಡ್ ಅನ್ನು ಮರುಪ್ರಾರಂಭಿಸಬೇಕಾಗುತ್ತದೆ.", + "wait": "ಇಲ್ಲ, ನಾನು ಕಾಯುತ್ತೇನೆ", + "cancel": "ಹೌದು, ರದ್ದುಮಾಡಿ" + }, "errors": { "input": { "empty": "ಇನ್‌ಪುಟ್ ಖಾಲಿ ಇರುವಂತಿಲ್ಲ", @@ -353,11 +359,6 @@ "confirmPasscode": "ನಿಮ್ಮ ಪಾಸ್ಕೋಡ್ ಅನ್ನು ದೃಢೀಕರಿಸಿ", "enterPasscode": "ನಿಮ್ಮ ಪಾಸ್ಕೋಡ್ ನಮೂದಿಸಿ" }, - "AppMetaData": { - "header": "ಇಂಜಿ ಬಗ್ಗೆ", - "version": "ಆವೃತ್ತಿ", - "useBle": "BLE ನಿಂದ ನಡೆಸಲ್ಪಡುತ್ತಿದೆ" - }, "QrLogin": { "title": "QR ಲಾಗಿನ್", "alignQr": "ಸ್ಕ್ಯಾನ್ ಮಾಡಲು ಚೌಕಟ್ಟಿನೊಳಗೆ QR ಕೋಡ್ ಅನ್ನು ಹೊಂದಿಸಿ", diff --git a/locales/spa.json b/locales/spa.json index 820639c39..ae11e6035 100644 --- a/locales/spa.json +++ b/locales/spa.json @@ -117,6 +117,12 @@ }, "AddVcModal": { "requestingCredential": "Solicitando credencial...", + "confirmationDialog": { + "title": "Quieres cancelar la descarga?", + "message": "OUna vez cancelada, su tarjeta no se descargará y deberá reiniciar la descarga.", + "wait": "No, esperaré", + "cancel": "Sí, cancelar" + }, "errors": { "input": { "empty": "El campo no puede estar vacío", @@ -254,11 +260,6 @@ "confirmPasscode": "Confirma tu código de acceso", "enterPasscode": "Ingresa tu código de acceso" }, - "AppMetaData": { - "header": "Acerca de Inji", - "version": "Versión", - "useBle": "Impulsado por BLE" - }, "SettingScreen": { "header": "Ajustes", "injiAsVerifierApp": "Inji como aplicación verificadora", @@ -734,11 +735,6 @@ "confirmPasscode": "Confirma tu código de acceso", "enterPasscode": "Ingresa tu código de acceso" }, - "AppMetaData": { - "header": "Acerca de Inji", - "version": "Versión", - "useBle": "Impulsado por BLE" - }, "SettingScreen": { "header": "Ajustes", "injiAsVerifierApp": "Inji como aplicación verificadora", diff --git a/locales/tam.json b/locales/tam.json index 6efc6e452..47eee3712 100644 --- a/locales/tam.json +++ b/locales/tam.json @@ -198,6 +198,12 @@ }, "AddVcModal": { "requestingCredential": "நற்சான்றிதழைக் கோருகிறது...", + "confirmationDialog": { + "title": "பதிவிறக்குவதை ரத்துசெய்ய விரும்புகிறீர்களா?", + "message": "ரத்துசெய்யப்பட்டதும், உங்கள் கார்டு பதிவிறக்கம் செய்யப்படாது மேலும் நீங்கள் பதிவிறக்கத்தை மீண்டும் தொடங்க வேண்டும்.", + "wait": "இல்லை, நான் காத்திருப்பேன்", + "cancel": "ஆம், ரத்துசெய்" + }, "errors": { "input": { "empty": "உள்ளீடு காலியாக இருக்க முடியாது", @@ -353,11 +359,6 @@ "confirmPasscode": "கடவுக்குறியீட்டை உறுதிப்படுத்தவும்", "enterPasscode": "உங்கள் கடவுக்குறியீட்டை உள்ளிடவும்" }, - "AppMetaData": { - "header": "இன்ஜி பற்றி", - "version": "பதிப்பு", - "useBle": "BLE ஆல் இயக்கப்படுகிறது" - }, "QrLogin": { "title": "QR உள்நுழைவு", "alignQr": "ஸ்கேன் செய்ய ஃப்ரேமுக்குள் QR குறியீட்டை சீரமைக்கவும்", diff --git a/machines/QrLoginMachine.ts b/machines/QrLoginMachine.ts index 551d4160d..4c9cf32c5 100644 --- a/machines/QrLoginMachine.ts +++ b/machines/QrLoginMachine.ts @@ -12,7 +12,10 @@ import {MY_VCS_STORE_KEY, ESIGNET_BASE_URL} from '../shared/constants'; import {StoreEvents} from './store'; import {linkTransactionResponse, VC} from '../types/VC/ExistingMosipVC/vc'; import {request} from '../shared/request'; -import {getJwt, isCustomSecureKeystore} from '../shared/cryptoutil/cryptoUtil'; +import { + getJwt, + isHardwareKeystoreExists, +} from '../shared/cryptoutil/cryptoUtil'; import { getBindingCertificateConstant, getPrivateKey, @@ -372,7 +375,7 @@ export const qrLoginMachine = sendAuthenticate: async context => { let privateKey; const individualId = context.selectedVc.vcMetadata.id; - if (!isCustomSecureKeystore()) { + if (!isHardwareKeystoreExists) { privateKey = await getPrivateKey( context.selectedVc.walletBindingResponse?.walletBindingId, ); @@ -406,7 +409,7 @@ export const qrLoginMachine = sendConsent: async context => { let privateKey; const individualId = context.selectedVc.vcMetadata.id; - if (!isCustomSecureKeystore()) { + if (!isHardwareKeystoreExists) { privateKey = await getPrivateKey( context.selectedVc.walletBindingResponse?.walletBindingId, ); diff --git a/machines/QrLoginMachine.typegen.ts b/machines/QrLoginMachine.typegen.ts index 5e151b41e..e69de29bb 100644 --- a/machines/QrLoginMachine.typegen.ts +++ b/machines/QrLoginMachine.typegen.ts @@ -1,83 +0,0 @@ -// This file was automatically generated. Edits will be overwritten - -export interface Typegen0 { - '@@xstate/typegen': true; - internalEvents: { - 'done.invoke.QrLogin.linkTransaction:invocation[0]': { - type: 'done.invoke.QrLogin.linkTransaction:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.QrLogin.sendingAuthenticate:invocation[0]': { - type: 'done.invoke.QrLogin.sendingAuthenticate:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'error.platform.QrLogin.linkTransaction:invocation[0]': { - type: 'error.platform.QrLogin.linkTransaction:invocation[0]'; - data: unknown; - }; - 'error.platform.QrLogin.sendingAuthenticate:invocation[0]': { - type: 'error.platform.QrLogin.sendingAuthenticate:invocation[0]'; - data: unknown; - }; - 'error.platform.QrLogin.sendingConsent:invocation[0]': { - type: 'error.platform.QrLogin.sendingConsent:invocation[0]'; - data: unknown; - }; - 'xstate.init': {type: 'xstate.init'}; - }; - invokeSrcNameMap: { - linkTransaction: 'done.invoke.QrLogin.linkTransaction:invocation[0]'; - sendAuthenticate: 'done.invoke.QrLogin.sendingAuthenticate:invocation[0]'; - sendConsent: 'done.invoke.QrLogin.sendingConsent:invocation[0]'; - }; - missingImplementations: { - actions: never; - delays: never; - guards: never; - services: never; - }; - eventsCausingActions: { - SetErrorMessage: - | 'error.platform.QrLogin.linkTransaction:invocation[0]' - | 'error.platform.QrLogin.sendingAuthenticate:invocation[0]' - | 'error.platform.QrLogin.sendingConsent:invocation[0]'; - expandLinkTransResp: 'done.invoke.QrLogin.linkTransaction:invocation[0]'; - forwardToParent: 'DISMISS'; - loadMyVcs: 'done.invoke.QrLogin.linkTransaction:invocation[0]'; - loadThumbprint: 'CONFIRM'; - resetLinkTransactionId: 'GET'; - resetSelectedVoluntaryClaims: 'GET'; - setClaims: 'done.invoke.QrLogin.linkTransaction:invocation[0]'; - setConsentClaims: 'TOGGLE_CONSENT_CLAIM'; - setLinkedTransactionId: 'done.invoke.QrLogin.sendingAuthenticate:invocation[0]'; - setMyVcs: 'STORE_RESPONSE'; - setScanData: 'GET'; - setSelectedVc: 'SELECT_VC'; - setThumbprint: 'STORE_RESPONSE'; - setlinkTransactionResponse: 'done.invoke.QrLogin.linkTransaction:invocation[0]'; - }; - eventsCausingDelays: {}; - eventsCausingGuards: {}; - eventsCausingServices: { - linkTransaction: 'GET'; - sendAuthenticate: never; - sendConsent: 'STORE_RESPONSE'; - }; - matchesStates: - | 'ShowError' - | 'done' - | 'faceAuth' - | 'invalidIdentity' - | 'linkTransaction' - | 'loadMyVcs' - | 'loadingThumbprint' - | 'requestConsent' - | 'sendingAuthenticate' - | 'sendingConsent' - | 'showvcList' - | 'success' - | 'waitingForData'; - tags: never; -} diff --git a/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.ts b/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.ts index fccf01e3a..d2b9b492b 100644 --- a/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.ts +++ b/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.ts @@ -5,7 +5,7 @@ import {VCMetadata} from '../../../shared/VCMetadata'; import {VC} from '../../../types/VC/ExistingMosipVC/vc'; import { generateKeys, - isCustomSecureKeystore, + isHardwareKeystoreExists, WalletBindingResponse, } from '../../../shared/cryptoutil/cryptoUtil'; import {log} from 'xstate/lib/actions'; @@ -715,7 +715,7 @@ export const EsignetMosipVCItemMachine = model.createMachine( setPublicKey: assign({ publicKey: (context, event) => { - if (!isCustomSecureKeystore()) { + if (!isHardwareKeystoreExists) { return (event.data as KeyPair).public; } return event.data as string; @@ -871,7 +871,7 @@ export const EsignetMosipVCItemMachine = model.createMachine( return walletResponse; }, generateKeyPair: async context => { - if (!isCustomSecureKeystore()) { + if (!isHardwareKeystoreExists) { return await generateKeys(); } const isBiometricsEnabled = SecureKeystore.hasBiometricsEnabled(); @@ -908,7 +908,7 @@ export const EsignetMosipVCItemMachine = model.createMachine( return vc != null; }, - isCustomSecureKeystore: () => isCustomSecureKeystore(), + isCustomSecureKeystore: () => isHardwareKeystoreExists, }, }, ); diff --git a/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.typegen.ts b/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.typegen.ts index a68bfeb04..e187312c7 100644 --- a/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.typegen.ts +++ b/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.typegen.ts @@ -252,3 +252,251 @@ export interface Typegen0 { }; tags: never; } + +// This file was automatically generated. Edits will be overwritten + +export interface Typegen0 { + '@@xstate/typegen': true; + internalEvents: { + 'done.invoke.vc-item-openid4vci.addKeyPair:invocation[0]': { + type: 'done.invoke.vc-item-openid4vci.addKeyPair:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]': { + type: 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]': { + type: 'done.invoke.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]': { + type: 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item-openid4vci.kebabPopUp.requestingBindingOtp:invocation[0]': { + type: 'done.invoke.vc-item-openid4vci.kebabPopUp.requestingBindingOtp:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]': { + type: 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item-openid4vci.requestingBindingOtp:invocation[0]': { + type: 'done.invoke.vc-item-openid4vci.requestingBindingOtp:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]': { + type: 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'error.platform.vc-item-openid4vci.addKeyPair:invocation[0]': { + type: 'error.platform.vc-item-openid4vci.addKeyPair:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item-openid4vci.addingWalletBindingId:invocation[0]': { + type: 'error.platform.vc-item-openid4vci.addingWalletBindingId:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]': { + type: 'error.platform.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]': { + type: 'error.platform.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item-openid4vci.kebabPopUp.requestingBindingOtp:invocation[0]': { + type: 'error.platform.vc-item-openid4vci.kebabPopUp.requestingBindingOtp:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]': { + type: 'error.platform.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item-openid4vci.requestingBindingOtp:invocation[0]': { + type: 'error.platform.vc-item-openid4vci.requestingBindingOtp:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item-openid4vci.updatingPrivateKey:invocation[0]': { + type: 'error.platform.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; + data: unknown; + }; + 'xstate.init': {type: 'xstate.init'}; + }; + invokeSrcNameMap: { + addWalletBindnigId: + | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]'; + generateKeyPair: + | 'done.invoke.vc-item-openid4vci.addKeyPair:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]'; + requestBindingOtp: + | 'done.invoke.vc-item-openid4vci.kebabPopUp.requestingBindingOtp:invocation[0]' + | 'done.invoke.vc-item-openid4vci.requestingBindingOtp:invocation[0]'; + requestOtp: + | 'done.invoke.vc-item-openid4vci.acceptingBindingOtp.resendOTP:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.acceptingBindingOtp.resendOTP:invocation[0]'; + updatePrivateKey: + | 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; + }; + missingImplementations: { + actions: 'clearTransactionId'; + delays: never; + guards: never; + services: 'requestOtp'; + }; + eventsCausingActions: { + VcUpdated: 'STORE_RESPONSE'; + clearOtp: + | 'DISMISS' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.requestingBindingOtp:invocation[0]' + | 'done.invoke.vc-item-openid4vci.requestingBindingOtp:invocation[0]'; + clearTransactionId: 'DISMISS'; + logVCremoved: 'STORE_RESPONSE'; + logWalletBindingFailure: + | 'error.platform.vc-item-openid4vci.addKeyPair:invocation[0]' + | 'error.platform.vc-item-openid4vci.addingWalletBindingId:invocation[0]' + | 'error.platform.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]' + | 'error.platform.vc-item-openid4vci.requestingBindingOtp:invocation[0]' + | 'error.platform.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; + logWalletBindingSuccess: + | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; + removeVcItem: 'CONFIRM'; + removedVc: 'STORE_RESPONSE'; + requestStoredContext: 'GET_VC_RESPONSE' | 'REFRESH'; + requestVcContext: 'DISMISS' | 'xstate.init'; + resetWalletBindingSuccess: 'DISMISS'; + sendVcUpdated: 'STORE_RESPONSE'; + sendWalletBindingSuccess: + | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]'; + setContext: 'GET_VC_RESPONSE' | 'STORE_RESPONSE'; + setGeneratedOn: 'GET_VC_RESPONSE'; + setOtp: 'INPUT_OTP'; + setPinCard: 'PIN_CARD'; + setPrivateKey: + | 'done.invoke.vc-item-openid4vci.addKeyPair:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]'; + setPublicKey: + | 'done.invoke.vc-item-openid4vci.addKeyPair:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]'; + setThumbprintForWalletBindingId: + | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]'; + setVcKey: 'REMOVE'; + setVcMetadata: 'UPDATE_VC_METADATA'; + setVerifiableCredential: 'GET_VC_RESPONSE' | 'STORE_RESPONSE'; + setWalletBindingError: + | 'error.platform.vc-item-openid4vci.addKeyPair:invocation[0]' + | 'error.platform.vc-item-openid4vci.addingWalletBindingId:invocation[0]' + | 'error.platform.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]' + | 'error.platform.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]' + | 'error.platform.vc-item-openid4vci.kebabPopUp.requestingBindingOtp:invocation[0]' + | 'error.platform.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]' + | 'error.platform.vc-item-openid4vci.requestingBindingOtp:invocation[0]' + | 'error.platform.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; + setWalletBindingErrorEmpty: + | 'CANCEL' + | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; + setWalletBindingId: + | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]'; + setWalletBindingSuccess: 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; + storeContext: + | 'PIN_CARD' + | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; + updatePrivateKey: + | 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; + updateVc: + | 'STORE_RESPONSE' + | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; + }; + eventsCausingDelays: {}; + eventsCausingGuards: { + hasCredential: 'GET_VC_RESPONSE'; + isCustomSecureKeystore: + | 'done.invoke.vc-item-openid4vci.addKeyPair:invocation[0]' + | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]'; + }; + eventsCausingServices: { + addWalletBindnigId: + | 'done.invoke.vc-item-openid4vci.addKeyPair:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]'; + generateKeyPair: 'INPUT_OTP'; + requestBindingOtp: 'CONFIRM'; + requestOtp: 'RESEND_OTP'; + updatePrivateKey: + | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]'; + }; + matchesStates: + | 'acceptingBindingOtp' + | 'acceptingBindingOtp.idle' + | 'acceptingBindingOtp.resendOTP' + | 'addKeyPair' + | 'addingWalletBindingId' + | 'checkingStore' + | 'checkingVc' + | 'idle' + | 'kebabPopUp' + | 'kebabPopUp.acceptingBindingOtp' + | 'kebabPopUp.acceptingBindingOtp.idle' + | 'kebabPopUp.acceptingBindingOtp.resendOTP' + | 'kebabPopUp.addKeyPair' + | 'kebabPopUp.addingWalletBindingId' + | 'kebabPopUp.idle' + | 'kebabPopUp.removeWallet' + | 'kebabPopUp.removingVc' + | 'kebabPopUp.requestingBindingOtp' + | 'kebabPopUp.showActivities' + | 'kebabPopUp.showBindingWarning' + | 'kebabPopUp.showingWalletBindingError' + | 'kebabPopUp.updatingPrivateKey' + | 'pinCard' + | 'requestingBindingOtp' + | 'showBindingWarning' + | 'showingWalletBindingError' + | 'updatingPrivateKey' + | { + acceptingBindingOtp?: 'idle' | 'resendOTP'; + kebabPopUp?: + | 'acceptingBindingOtp' + | 'addKeyPair' + | 'addingWalletBindingId' + | 'idle' + | 'removeWallet' + | 'removingVc' + | 'requestingBindingOtp' + | 'showActivities' + | 'showBindingWarning' + | 'showingWalletBindingError' + | 'updatingPrivateKey' + | {acceptingBindingOtp?: 'idle' | 'resendOTP'}; + }; + tags: never; +} diff --git a/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.ts b/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.ts index 019dfd7d9..54d9c4296 100644 --- a/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.ts +++ b/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.ts @@ -15,7 +15,7 @@ import {verifyCredential} from '../../../shared/vcjs/verifyCredential'; import {log} from 'xstate/lib/actions'; import { generateKeys, - isCustomSecureKeystore, + isHardwareKeystoreExists, WalletBindingResponse, } from '../../../shared/cryptoutil/cryptoUtil'; import {KeyPair} from 'react-native-rsa-native'; @@ -934,7 +934,7 @@ export const ExistingMosipVCItemMachine = setPublicKey: assign({ publicKey: (context, event) => { - if (!isCustomSecureKeystore()) { + if (!isHardwareKeystoreExists) { return (event.data as KeyPair).public; } return event.data as string; @@ -1333,7 +1333,7 @@ export const ExistingMosipVCItemMachine = }, generateKeyPair: async context => { - if (!isCustomSecureKeystore()) { + if (!isHardwareKeystoreExists) { return await generateKeys(); } const isBiometricsEnabled = SecureKeystore.hasBiometricsEnabled(); @@ -1508,7 +1508,7 @@ export const ExistingMosipVCItemMachine = return context.isVerified; }, - isCustomSecureKeystore: () => isCustomSecureKeystore(), + isCustomSecureKeystore: () => isHardwareKeystoreExists, }, }, ); diff --git a/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.typegen.ts b/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.typegen.ts index df05eec2a..e69de29bb 100644 --- a/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.typegen.ts +++ b/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.typegen.ts @@ -1,401 +0,0 @@ -// This file was automatically generated. Edits will be overwritten - -export interface Typegen0 { - '@@xstate/typegen': true; - internalEvents: { - '': {type: ''}; - 'done.invoke.checkStatus': { - type: 'done.invoke.checkStatus'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.downloadCredential': { - type: 'done.invoke.downloadCredential'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item.addKeyPair:invocation[0]': { - type: 'done.invoke.vc-item.addKeyPair:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item.addingWalletBindingId:invocation[0]': { - type: 'done.invoke.vc-item.addingWalletBindingId:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]': { - type: 'done.invoke.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item.kebabPopUp.addKeyPair:invocation[0]': { - type: 'done.invoke.vc-item.kebabPopUp.addKeyPair:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]': { - type: 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item.kebabPopUp.requestingBindingOtp:invocation[0]': { - type: 'done.invoke.vc-item.kebabPopUp.requestingBindingOtp:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]': { - type: 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item.requestingBindingOtp:invocation[0]': { - type: 'done.invoke.vc-item.requestingBindingOtp:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item.requestingLock:invocation[0]': { - type: 'done.invoke.vc-item.requestingLock:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item.requestingOtp:invocation[0]': { - type: 'done.invoke.vc-item.requestingOtp:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item.requestingRevoke:invocation[0]': { - type: 'done.invoke.vc-item.requestingRevoke:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item.updatingPrivateKey:invocation[0]': { - type: 'done.invoke.vc-item.updatingPrivateKey:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item.verifyingCredential:invocation[0]': { - type: 'done.invoke.vc-item.verifyingCredential:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'error.platform.checkStatus': { - type: 'error.platform.checkStatus'; - data: unknown; - }; - 'error.platform.downloadCredential': { - type: 'error.platform.downloadCredential'; - data: unknown; - }; - 'error.platform.vc-item.addKeyPair:invocation[0]': { - type: 'error.platform.vc-item.addKeyPair:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item.addingWalletBindingId:invocation[0]': { - type: 'error.platform.vc-item.addingWalletBindingId:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]': { - type: 'error.platform.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item.kebabPopUp.addKeyPair:invocation[0]': { - type: 'error.platform.vc-item.kebabPopUp.addKeyPair:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]': { - type: 'error.platform.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item.kebabPopUp.requestingBindingOtp:invocation[0]': { - type: 'error.platform.vc-item.kebabPopUp.requestingBindingOtp:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]': { - type: 'error.platform.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item.requestingBindingOtp:invocation[0]': { - type: 'error.platform.vc-item.requestingBindingOtp:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item.requestingLock:invocation[0]': { - type: 'error.platform.vc-item.requestingLock:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item.requestingRevoke:invocation[0]': { - type: 'error.platform.vc-item.requestingRevoke:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item.updatingPrivateKey:invocation[0]': { - type: 'error.platform.vc-item.updatingPrivateKey:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item.verifyingCredential:invocation[0]': { - type: 'error.platform.vc-item.verifyingCredential:invocation[0]'; - data: unknown; - }; - 'xstate.init': {type: 'xstate.init'}; - }; - invokeSrcNameMap: { - addWalletBindnigId: - | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]'; - checkDownloadExpiryLimit: 'done.invoke.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]'; - checkStatus: 'done.invoke.checkStatus'; - downloadCredential: 'done.invoke.downloadCredential'; - generateKeyPair: - | 'done.invoke.vc-item.addKeyPair:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.addKeyPair:invocation[0]'; - requestBindingOtp: - | 'done.invoke.vc-item.kebabPopUp.requestingBindingOtp:invocation[0]' - | 'done.invoke.vc-item.requestingBindingOtp:invocation[0]'; - requestLock: 'done.invoke.vc-item.requestingLock:invocation[0]'; - requestOtp: - | 'done.invoke.vc-item.acceptingOtpInput.resendOTP:invocation[0]' - | 'done.invoke.vc-item.requestingOtp:invocation[0]'; - requestRevoke: 'done.invoke.vc-item.requestingRevoke:invocation[0]'; - updatePrivateKey: - | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]'; - verifyCredential: 'done.invoke.vc-item.verifyingCredential:invocation[0]'; - }; - missingImplementations: { - actions: never; - delays: never; - guards: never; - services: never; - }; - eventsCausingActions: { - addVcToInProgressDownloads: 'STORE_RESPONSE'; - clearOtp: - | '' - | 'CANCEL' - | 'DISMISS' - | 'REVOKE_VC' - | 'STORE_RESPONSE' - | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.requestingBindingOtp:invocation[0]' - | 'done.invoke.vc-item.requestingBindingOtp:invocation[0]' - | 'done.invoke.vc-item.requestingOtp:invocation[0]' - | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item.verifyingCredential:invocation[0]' - | 'error.platform.vc-item.requestingLock:invocation[0]' - | 'error.platform.vc-item.requestingRevoke:invocation[0]' - | 'error.platform.vc-item.verifyingCredential:invocation[0]'; - clearTransactionId: - | '' - | 'CANCEL' - | 'DISMISS' - | 'STORE_RESPONSE' - | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item.verifyingCredential:invocation[0]' - | 'error.platform.vc-item.verifyingCredential:invocation[0]'; - incrementDownloadCounter: 'POLL'; - logDownloaded: 'STORE_RESPONSE'; - logRevoked: 'STORE_RESPONSE'; - logVCremoved: 'STORE_RESPONSE'; - logWalletBindingFailure: - | 'error.platform.vc-item.addKeyPair:invocation[0]' - | 'error.platform.vc-item.addingWalletBindingId:invocation[0]' - | 'error.platform.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' - | 'error.platform.vc-item.requestingBindingOtp:invocation[0]' - | 'error.platform.vc-item.updatingPrivateKey:invocation[0]'; - logWalletBindingSuccess: - | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]'; - markVcValid: 'done.invoke.vc-item.verifyingCredential:invocation[0]'; - refreshMyVcs: 'STORE_RESPONSE'; - removeTamperedVcItem: 'TAMPERED_VC'; - removeVcFromInProgressDownloads: 'STORE_RESPONSE'; - removeVcItem: 'CONFIRM'; - removeVcMetaDataFromStorage: 'STORE_ERROR'; - removeVcMetaDataFromVcMachine: 'DISMISS'; - requestStoredContext: 'GET_VC_RESPONSE' | 'REFRESH'; - requestVcContext: 'DISMISS' | 'xstate.init'; - resetWalletBindingSuccess: 'DISMISS'; - revokeVID: 'done.invoke.vc-item.requestingRevoke:invocation[0]'; - sendActivationFailedEndEvent: 'DISMISS'; - sendActivationStartEvent: 'CONFIRM'; - sendActivationSuccessEvent: - | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]'; - sendDownloadLimitExpire: 'error.platform.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]'; - sendTamperedVc: 'TAMPERED_VC'; - sendTelemetryEvents: 'STORE_RESPONSE'; - sendVcUpdated: 'PIN_CARD'; - sendWalletBindingSuccess: - | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]'; - setCredential: 'GET_VC_RESPONSE' | 'STORE_RESPONSE'; - setDownloadInterval: 'done.invoke.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]'; - setLock: 'done.invoke.vc-item.requestingLock:invocation[0]'; - setMaxDownloadCount: 'done.invoke.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]'; - setOtp: 'INPUT_OTP'; - setOtpError: - | 'error.platform.vc-item.requestingLock:invocation[0]' - | 'error.platform.vc-item.requestingRevoke:invocation[0]'; - setPinCard: 'PIN_CARD'; - setPrivateKey: - | 'done.invoke.vc-item.addKeyPair:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.addKeyPair:invocation[0]'; - setPublicKey: - | 'done.invoke.vc-item.addKeyPair:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.addKeyPair:invocation[0]'; - setRevoke: 'done.invoke.vc-item.requestingRevoke:invocation[0]'; - setStoreVerifiableCredential: 'CREDENTIAL_DOWNLOADED'; - setThumbprintForWalletBindingId: - | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]'; - setTransactionId: - | 'INPUT_OTP' - | 'REVOKE_VC' - | 'done.invoke.vc-item.requestingOtp:invocation[0]' - | 'error.platform.vc-item.requestingLock:invocation[0]' - | 'error.platform.vc-item.requestingRevoke:invocation[0]'; - setVcKey: 'REMOVE'; - setVcMetadata: 'UPDATE_VC_METADATA'; - setVerifiableCredential: 'STORE_RESPONSE'; - setWalletBindingError: - | 'error.platform.vc-item.addKeyPair:invocation[0]' - | 'error.platform.vc-item.addingWalletBindingId:invocation[0]' - | 'error.platform.vc-item.kebabPopUp.addKeyPair:invocation[0]' - | 'error.platform.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' - | 'error.platform.vc-item.kebabPopUp.requestingBindingOtp:invocation[0]' - | 'error.platform.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' - | 'error.platform.vc-item.requestingBindingOtp:invocation[0]' - | 'error.platform.vc-item.updatingPrivateKey:invocation[0]'; - setWalletBindingErrorEmpty: - | 'CANCEL' - | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]'; - setWalletBindingId: - | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]'; - setWalletBindingSuccess: 'done.invoke.vc-item.updatingPrivateKey:invocation[0]'; - storeContext: - | 'CREDENTIAL_DOWNLOADED' - | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item.verifyingCredential:invocation[0]'; - storeLock: 'done.invoke.vc-item.requestingLock:invocation[0]'; - updatePrivateKey: - | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]'; - updateVc: - | 'STORE_RESPONSE' - | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item.verifyingCredential:invocation[0]'; - }; - eventsCausingDelays: {}; - eventsCausingGuards: { - hasCredential: 'GET_VC_RESPONSE' | 'STORE_RESPONSE'; - isCustomSecureKeystore: - | 'done.invoke.vc-item.addKeyPair:invocation[0]' - | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.addKeyPair:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]'; - isDownloadAllowed: 'POLL'; - isVcValid: ''; - }; - eventsCausingServices: { - addWalletBindnigId: - | 'done.invoke.vc-item.addKeyPair:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.addKeyPair:invocation[0]'; - checkDownloadExpiryLimit: 'STORE_RESPONSE'; - checkStatus: - | 'done.invoke.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]' - | 'error.platform.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]'; - downloadCredential: 'DOWNLOAD_READY'; - generateKeyPair: 'INPUT_OTP'; - requestBindingOtp: 'CONFIRM'; - requestLock: 'INPUT_OTP'; - requestOtp: 'LOCK_VC' | 'RESEND_OTP'; - requestRevoke: 'INPUT_OTP'; - updatePrivateKey: - | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]'; - verifyCredential: '' | 'VERIFY'; - }; - matchesStates: - | 'acceptingBindingOtp' - | 'acceptingOtpInput' - | 'acceptingOtpInput.idle' - | 'acceptingOtpInput.resendOTP' - | 'acceptingRevokeInput' - | 'addKeyPair' - | 'addingWalletBindingId' - | 'checkingServerData' - | 'checkingServerData.checkingStatus' - | 'checkingServerData.downloadingCredential' - | 'checkingServerData.savingFailed' - | 'checkingServerData.savingFailed.idle' - | 'checkingServerData.savingFailed.viewingVc' - | 'checkingServerData.verifyingDownloadLimitExpiry' - | 'checkingStore' - | 'checkingVc' - | 'checkingVerificationStatus' - | 'idle' - | 'invalid' - | 'invalid.backend' - | 'invalid.otp' - | 'kebabPopUp' - | 'kebabPopUp.acceptingBindingOtp' - | 'kebabPopUp.addKeyPair' - | 'kebabPopUp.addingWalletBindingId' - | 'kebabPopUp.idle' - | 'kebabPopUp.removeWallet' - | 'kebabPopUp.removingVc' - | 'kebabPopUp.requestingBindingOtp' - | 'kebabPopUp.showActivities' - | 'kebabPopUp.showBindingWarning' - | 'kebabPopUp.showingWalletBindingError' - | 'kebabPopUp.updatingPrivateKey' - | 'lockingVc' - | 'loggingRevoke' - | 'pinCard' - | 'requestingBindingOtp' - | 'requestingLock' - | 'requestingOtp' - | 'requestingRevoke' - | 'revokingVc' - | 'showBindingWarning' - | 'showingWalletBindingError' - | 'updatingPrivateKey' - | 'verifyingCredential' - | { - acceptingOtpInput?: 'idle' | 'resendOTP'; - checkingServerData?: - | 'checkingStatus' - | 'downloadingCredential' - | 'savingFailed' - | 'verifyingDownloadLimitExpiry' - | {savingFailed?: 'idle' | 'viewingVc'}; - invalid?: 'backend' | 'otp'; - kebabPopUp?: - | 'acceptingBindingOtp' - | 'addKeyPair' - | 'addingWalletBindingId' - | 'idle' - | 'removeWallet' - | 'removingVc' - | 'requestingBindingOtp' - | 'showActivities' - | 'showBindingWarning' - | 'showingWalletBindingError' - | 'updatingPrivateKey'; - }; - tags: never; -} diff --git a/machines/app.ts b/machines/app.ts index fc86c93a6..69833e287 100644 --- a/machines/app.ts +++ b/machines/app.ts @@ -1,17 +1,13 @@ import NetInfo, {NetInfoStateType} from '@react-native-community/netinfo'; import {AppState, AppStateStatus, Platform} from 'react-native'; -import { - getDeviceId, - getDeviceName, - getDeviceNameSync, -} from 'react-native-device-info'; -import {EventFrom, spawn, StateFrom, send, assign, AnyState} from 'xstate'; +import {getDeviceId, getDeviceName} from 'react-native-device-info'; +import {assign, EventFrom, send, spawn, StateFrom} from 'xstate'; import {createModel} from 'xstate/lib/model'; import {authMachine, createAuthMachine} from './auth'; import {createSettingsMachine, settingsMachine} from './settings'; import {StoreEvents, storeMachine} from './store'; import {createVcMachine, vcMachine} from './vc'; -import {createActivityLogMachine, activityLogMachine} from './activityLog'; +import {activityLogMachine, createActivityLogMachine} from './activityLog'; import { createRequestMachine, requestMachine, @@ -20,19 +16,19 @@ import {createScanMachine, scanMachine} from './bleShare/scan/scanMachine'; import {createRevokeMachine, revokeVidsMachine} from './revoke'; import {pure, respond} from 'xstate/lib/actions'; import {AppServices} from '../shared/GlobalContext'; -import {request} from '../shared/request'; import { changeCrendetialRegistry, - SETTINGS_STORE_KEY, - MIMOTO_BASE_URL, - ESIGNET_BASE_URL, changeEsignetUrl, + ESIGNET_BASE_URL, + isAndroid, + MIMOTO_BASE_URL, + SETTINGS_STORE_KEY, } from '../shared/constants'; +import {logState} from '../shared/commonUtil'; const model = createModel( { info: {} as AppInfo, - backendInfo: {} as BackendInfo, serviceRefs: {} as AppServices, isReadError: false, isDecryptError: false, @@ -51,7 +47,6 @@ const model = createModel( REQUEST_DEVICE_INFO: () => ({}), READY: (data?: unknown) => ({data}), APP_INFO_RECEIVED: (info: AppInfo) => ({info}), - BACKEND_INFO_RECEIVED: (info: BackendInfo) => ({info}), STORE_RESPONSE: (response: unknown) => ({response}), RESET_KEY_INVALIDATE_ERROR_DISMISS: () => ({}), }, @@ -135,19 +130,8 @@ export const appMachine = model.createMachine( }, on: { APP_INFO_RECEIVED: { - target: 'devinfo', - actions: ['setAppInfo'], - }, - }, - }, - devinfo: { - invoke: { - src: 'getBackendInfo', - }, - on: { - BACKEND_INFO_RECEIVED: { target: '#ready', - actions: ['setBackendInfo'], + actions: ['setAppInfo'], }, }, }, @@ -286,7 +270,7 @@ export const appMachine = model.createMachine( scanMachine.id, ); - if (Platform.OS === 'android') { + if (isAndroid()) { serviceRefs.request = spawn( createRequestMachine(serviceRefs), requestMachine.id, @@ -310,7 +294,7 @@ export const appMachine = model.createMachine( context.serviceRefs.activityLog.subscribe(logState); context.serviceRefs.scan.subscribe(logState); - if (Platform.OS === 'android') { + if (isAndroid()) { context.serviceRefs.request.subscribe(logState); } @@ -322,10 +306,6 @@ export const appMachine = model.createMachine( info: (_, event) => event.info, }), - setBackendInfo: model.assign({ - backendInfo: (_, event) => event.info, - }), - loadCredentialRegistryHostFromStorage: send( StoreEvents.GET(SETTINGS_STORE_KEY), { @@ -363,23 +343,6 @@ export const appMachine = model.createMachine( callback(model.events.APP_INFO_RECEIVED(appInfo)); }, - getBackendInfo: () => async callback => { - let backendInfo = { - application: { - name: '', - version: '', - }, - build: {}, - config: {}, - }; - try { - backendInfo = await request('GET', '/residentmobileapp/info'); - callback(model.events.BACKEND_INFO_RECEIVED(backendInfo)); - } catch { - callback(model.events.BACKEND_INFO_RECEIVED(backendInfo)); - } - }, - checkFocusState: () => callback => { const changeHandler = (newState: AppStateStatus) => { switch (newState) { @@ -398,8 +361,7 @@ export const appMachine = model.createMachine( AppState.addEventListener('change', changeHandler); - // android only - if (Platform.OS === 'android') { + if (isAndroid()) { AppState.addEventListener('blur', blurHandler); AppState.addEventListener('focus', focusHandler); } @@ -407,7 +369,7 @@ export const appMachine = model.createMachine( return () => { AppState.removeEventListener('change', changeHandler); - if (Platform.OS === 'android') { + if (isAndroid()) { AppState.removeEventListener('blur', blurHandler); AppState.removeEventListener('focus', focusHandler); } @@ -432,25 +394,11 @@ interface AppInfo { deviceName: string; } -interface BackendInfo { - application: { - name: string; - version: string; - }; - build: object; - config: object; -} - type State = StateFrom; export function selectAppInfo(state: State) { return state.context.info; } - -export function selectBackendInfo(state: State) { - return state.context.backendInfo; -} - export function selectIsReady(state: State) { return state.matches('ready'); } @@ -467,28 +415,6 @@ export function selectIsFocused(state: State) { return state.matches('ready.focus'); } -export function logState(state: AnyState) { - const data = JSON.stringify( - state.event, - (key, value) => { - if (key === 'type') return undefined; - if (typeof value === 'string' && value.length >= 100) { - return value.slice(0, 100) + '...'; - } - return value; - }, - 2, - ); - console.log( - `[${getDeviceNameSync()}] ${state.machine.id}: ${ - state.event.type - } -> ${state.toStrings().pop()}\n${ - data.length > 300 ? data.slice(0, 300) + '...' : data - } - `, - ); -} - export function selectIsReadError(state: State) { return state.context.isReadError; } diff --git a/machines/biometrics.ts b/machines/biometrics.ts index 47eea1875..648b8646e 100644 --- a/machines/biometrics.ts +++ b/machines/biometrics.ts @@ -2,6 +2,7 @@ import {createModel} from 'xstate/lib/model'; import * as LocalAuthentication from 'expo-local-authentication'; import {EventFrom, MetaObject, StateFrom} from 'xstate'; import {Platform} from 'react-native'; +import {isAndroid} from '../shared/constants'; // ----- CREATE MODEL --------------------------------------------------------- const model = createModel( @@ -99,7 +100,7 @@ export const biometricsMachine = model.createMachine( authenticating: { invoke: { src: () => async () => { - if (Platform.OS === 'android') { + if (isAndroid()) { await LocalAuthentication.cancelAuthenticate(); } const res = await LocalAuthentication.authenticateAsync({ diff --git a/machines/bleShare/request/requestMachine.ts b/machines/bleShare/request/requestMachine.ts index 8ccb26f34..5282ad709 100644 --- a/machines/bleShare/request/requestMachine.ts +++ b/machines/bleShare/request/requestMachine.ts @@ -14,7 +14,7 @@ import {getDeviceNameSync} from 'react-native-device-info'; import {StoreEvents} from '../../store'; import {VC} from '../../../types/VC/ExistingMosipVC/vc'; import {AppServices} from '../../../shared/GlobalContext'; -import {RECEIVED_VCS_STORE_KEY} from '../../../shared/constants'; +import {isAndroid, RECEIVED_VCS_STORE_KEY} from '../../../shared/constants'; import {ActivityLogEvents, ActivityLogType} from '../../activityLog'; import {VcEvents} from '../../vc'; import {subscribe} from '../../../shared/openIdBLE/verifierEventHandler'; @@ -736,7 +736,7 @@ export const requestMachine = }, checkNearByDevicesPermission: () => callback => { - if (Platform.OS === 'android' && Platform.Version >= 31) { + if (isAndroid() && Platform.Version >= 31) { const result = checkMultiple([ PERMISSIONS.ANDROID.BLUETOOTH_ADVERTISE, PERMISSIONS.ANDROID.BLUETOOTH_CONNECT, diff --git a/machines/bleShare/scan/scanMachine.ts b/machines/bleShare/scan/scanMachine.ts index d7064a266..6e1a39a4a 100644 --- a/machines/bleShare/scan/scanMachine.ts +++ b/machines/bleShare/scan/scanMachine.ts @@ -17,7 +17,7 @@ import {getDeviceNameSync} from 'react-native-device-info'; import {VC, VerifiablePresentation} from '../../../types/VC/ExistingMosipVC/vc'; import {AppServices} from '../../../shared/GlobalContext'; import {ActivityLogEvents, ActivityLogType} from '../../activityLog'; -import {MY_LOGIN_STORE_KEY} from '../../../shared/constants'; +import {isAndroid, isIOS, MY_LOGIN_STORE_KEY} from '../../../shared/constants'; import {subscribe} from '../../../shared/openIdBLE/walletEventHandler'; import { check, @@ -38,7 +38,6 @@ import {StoreEvents} from '../../store'; import {WalletDataEvent} from 'react-native-tuvali/lib/typescript/types/events'; import {BLEError} from '../types'; import Storage from '../../../shared/storage'; -import {logState} from '../../app'; import {VCMetadata} from '../../../shared/VCMetadata'; import { getStartEventData, @@ -47,6 +46,7 @@ import { sendEndEvent, TelemetryConstants, } from '../../../shared/telemetry/TelemetryUtils'; +import {logState} from '../../../shared/commonUtil'; const {wallet, EventTypes, VerificationStatus} = tuvali; @@ -731,7 +731,7 @@ export const scanMachine = value: context.linkCode, }), openBluetoothSettings: () => { - Platform.OS === 'android' + isAndroid() ? BluetoothStateManager.openSettings().catch() : Linking.openURL('App-Prefs:Bluetooth'); }, @@ -915,7 +915,7 @@ export const scanMachine = // Passing Granted for android since permission status is always granted even if its denied. let response: PermissionStatus = RESULTS.GRANTED; - if (Platform.OS === 'ios') { + if (isIOS()) { response = await check(PERMISSIONS.IOS.BLUETOOTH_PERIPHERAL); } @@ -1119,9 +1119,9 @@ export const scanMachine = } }, - uptoAndroid11: () => Platform.OS === 'android' && Platform.Version < 31, + uptoAndroid11: () => isAndroid() && Platform.Version < 31, - isIOS: () => Platform.OS === 'ios', + isIOS: () => isIOS(), isMinimumStorageRequiredForAuditEntryReached: (_context, event) => Boolean(event.data), diff --git a/machines/issuersMachine.ts b/machines/issuersMachine.ts index c8bc7169e..49339f568 100644 --- a/machines/issuersMachine.ts +++ b/machines/issuersMachine.ts @@ -1,13 +1,17 @@ import {authorize, AuthorizeResult} from 'react-native-app-auth'; import {assign, EventFrom, send, sendParent, StateFrom} from 'xstate'; import {createModel} from 'xstate/lib/model'; -import {MY_VCS_STORE_KEY} from '../shared/constants'; +import { + MY_VCS_STORE_KEY, + NETWORK_REQUEST_FAILED, + REQUEST_TIMEOUT, +} from '../shared/constants'; import {StoreEvents} from './store'; import {AppServices} from '../shared/GlobalContext'; import NetInfo from '@react-native-community/netinfo'; import { generateKeys, - isCustomSecureKeystore, + isHardwareKeystoreExists, } from '../shared/cryptoutil/cryptoUtil'; import SecureKeystore from 'react-native-secure-keystore'; import {KeyPair} from 'react-native-rsa-native'; @@ -23,8 +27,8 @@ import { updateCredentialInformation, constructAuthorizationConfiguration, getVCMetadata, + Issuers_Key_Ref, } from '../shared/openId4VCI/Utils'; -import {NETWORK_REQUEST_FAILED, REQUEST_TIMEOUT} from '../shared/constants'; import {VCMetadata} from '../shared/VCMetadata'; import { TelemetryConstants, @@ -72,7 +76,6 @@ const model = createModel( export const IssuerScreenTabEvents = model.events; export const Issuer_Tab_Ref_Id = 'issuersMachine'; -export const Issuers_Key_Ref = 'OpenId4VCI_KeyPair'; export const IssuersMachine = model.createMachine( { /** @xstate-layout N4IgpgJg5mDOIC5QEtawK5gE6wLIEMBjAC2QDswA6CVABwBt8BPASTUxwGIIB7Cy8gDceAayqoM2PEVL8asBszaScCIT0L4ALsj4BtAAwBdQ0cShaPWMh19zIAB6IALAEYAnJWfuAzM4BsAKwAHN7BwQDsfgA0IEyIAEw+Ea6UBgkRwT7uEekGrhHOAL5FsRIc0iTkVPKKrOxSnNhYPFiUiloAZq0AtgINOARVcnSM9SqwamTCmrZkpqb2ltZz9k4Izgme3n5Boe7hUc6x8QgJ3gZpgT6BgRH+yYWBJWUDlbJUza2cACoASgBNAD6AEEAOIglgAOUWSBAyxsujIaxcWy8vgCITCkRicUSIQSlGyCQMETu7n84QKLxA5SkQw+lC+WF+gNBEOhelcZjhCNWcPWrgSJ0QQppdMGMmqTKwLRZ-2B4MhMISPIsVkRdgFooMvjS-jc9wezl1ARFZwiCUClFcN3czmcKWuPnFbwZ0uZnD+AFEAMren5A71-P4AeT+sPVKyRKIQrgMwX8lASCWCgVcgW8lt15oyEU8CSCloz6WcN38rom7v4sDA9DAhB0ZCgyg4nAAIqGAOpQgAyoZB7aBLHbkfhGv5oHWPgMBmclEigQM-lTVpyc9z+R8yfzriyPhTS4zlYq1aotfrjfILYGnH9ve9AGEft6hyxfb6AKrBsd8mPahBAmFPEEB8VwhS8XVkgKA5dXcE96SlOQeAAdzIegeHwCBW2wR8+E6ZAoG4PhxGmURxDdJCalQ9DMOwgY8LIAioCmGZtCRBZjCWCd-ynUVgNOMVSlpSjhmotCMKwnCsEY5imllVp2kYLpen6KsqOoGjJPolRZMI1iNHY-RjF-HitT4jYUwXZwgMpFMfHCGcIlze15zuFdghyA5UweBDJTEygSAbEQWDILRsAoLRiP4dQxEC4hgtC8KsEi0zo3MxxRVuQlLUCdxdUzbIhX8c14w8Iky1ucI1zTYI-PeaUgsIEKwoisAot4GKyLipqWuS1LuW49LkQA4I0SFdxwOXO1-HSUrbUuLZSX8XwMn8Vwy3qs94sS1qUva+S5SU7RuiwPpeqStqtDSzURos4IIMpB5i1moCHPNSbgi8QIDXcPLcltDIto0i69simU5QSVlFQ5GEuN5My7syuNkiTfJJvyDwiyCUrZ2tPwbimoDMhuYGAtobBTp6EF0C0YhWmQAAvIyyGi0jhDiiUGv4CmsCpmm6YZ5m5gM2YOJM+Go1u2NbJtFbJoyN7U3cc0V2tbxXH8FdHSPe0ycZXn+dp+msCZlnDsUjoqbU08NMN3oBZNs2RfUMXjJMSXx2GmXNbl9wFbJJJlfNB6bUiLYbiW-KIgifXpXts7HaF83mWOlSzptxDycph3jeTl2yLd+YTMGhHvYA64k01-2hUDg9PNK5J52CAwZ3TQpwNj4Sue23qAGkwCYAAFfBkBZR8AAknz7oE++9YEh8hCNPb-DLBTnKuPD+h15cKc0qptDaMcibxnm70TGX7weR7HzhJ+n2f56BReWAjUupcnZH4x8Tf-czAJ-Z7xAskS4YFiQeXOJ5F0591IBRgBQLA2gwAD2HqPFknV2bkUzv5Rk8DsBIJQTfLAosWacTVF7aWAECjZEoPlTy6Z1o5HOOaPwqRqoOQyGNTMKY478DwYg8KhC0FswEN1CisDcFgAQQQ6+aCSFzAWO-Chn9BRRE8HQv6msPCWmOCBFMhI0xBH8DHMkOQyS8PErRLCj4sCQCkTofA9BYAiNiuI22AVeASTojYuxYVkCOMmK7UhEtyGryRusGyER9SWgpIVCkYFAi5j3EmG4CZW4OSbsUGB7jGSeKsRAHxEB7H+KcRbNoVtVI9w0nk7ShTikBPkeLD2oTEaxkidErYQQyzxIzLmThlBKSrQzJsKkFjNJeOsbYopfiAl3xBFCR83pew3RUS4R0HTYndIeL0kCe4ogVSyB4ByMcNpjMENgZAnQmDXjqTM+gLixHYO5lQc5psrk3KmfU+gjT3YrN4l-eMnguF3HOAkDMDlEl6ITFXYxDosjnCONA14EjpSvMudc5styHH3NThUjOVSApoveZiz5dyfnF2aUNShFkppAqtCCzY4K0x9IMNafMDCDgPBJAeMZyAID1jvqGXAQ8HwvlHCvVpVC1ZeG5VsVMUQ9l9JNAM5wY0W6pnjJEXl-KwBzIWUsv5a9RTSs2K3OVOJFV6NtKkG4eVUytx+jymkZAeBFPgHCAlHwqWrIQAAWh-uaX1ZIw6WnuJVKIK0EhjNqGMaS7qP7-PWJaXMP0okmhTPmGOFJ4wVmyVnRkzJvWJsQC3IFOQNqJkKPmG4uZMiXF1JSTYhZ0i7DGReBsTYbwqCLUauMu4iRUh+pmIUG0km2gGQURMqNNibTzTg6UNS6LST0lAHt4TEDGJcoWWhI6xreACGSXNyKcmNQSs1S6+0tBrtjGGgZU6XqsqSMEc0ZJtwFRNAUHeGYz7Hvzae3a-V2oQ1aAka9VCwVROhS3PKfhlwFA+mNZMjxcgORskkI9IkUU8xzonPOpthb-LCW0gSoofB+C8GNFaLd4zLhjmMq+qCx5gYsoehcMcbi7g2imVW5H0yqrGjcPwlo6pzueZQfhMjGNYGY1-PwhISQFGeoJlILCwJeHWhmBVFahK-vnchCZBTSXYvjco4tCAch9LU7Va48ZHSUjORc4lUAsUlJk+sQZyYqrrgNFrZ9VrKR3uMR5TWZGf5tq0AzZsbnSO+0NNkNwbhHKQsEv7bcar8pgW8FsUI2r6zRZRhmNIMdVy5Dyuqyz84AhPXsqqlI0aSL5ZgjawdXSR26NOCmX2WxHS6k-Xxs+JQgA */ @@ -123,7 +126,7 @@ export const IssuersMachine = model.createMachine( }, { description: 'not fetched issuers config yet', - actions: ['setLoadingReasonAsDisplayIssuers', 'resetError'], + actions: ['setLoadingReasonAsSettingUp', 'resetError'], target: 'downloadIssuerConfig', }, ], @@ -140,7 +143,7 @@ export const IssuersMachine = model.createMachine( actions: sendParent('DOWNLOAD_ID'), }, SELECTED_ISSUER: { - actions: 'setSelectedIssuerId', + actions: ['setSelectedIssuerId', 'setLoadingReasonAsSettingUp'], target: 'downloadIssuerConfig', }, }, @@ -223,7 +226,7 @@ export const IssuersMachine = model.createMachine( }, checkKeyPair: { description: 'checks whether key pair is generated', - entry: [send('CHECK_KEY_PAIR')], + entry: ['setLoadingReasonAsSettingUp', send('CHECK_KEY_PAIR')], on: { CHECK_KEY_PAIR: [ { @@ -458,7 +461,7 @@ export const IssuersMachine = model.createMachine( }), setPublicKey: assign({ publicKey: (_, event) => { - if (!isCustomSecureKeystore()) { + if (!isHardwareKeystoreExists) { return (event.data as KeyPair).public; } return event.data as string; @@ -549,8 +552,8 @@ export const IssuersMachine = model.createMachine( constructAuthorizationConfiguration(context.selectedIssuer), ); }, - generateKeyPair: async context => { - if (!isCustomSecureKeystore()) { + generateKeyPair: async () => { + if (!isHardwareKeystoreExists) { return await generateKeys(); } const isBiometricsEnabled = SecureKeystore.hasBiometricsEnabled(); @@ -595,7 +598,7 @@ export const IssuersMachine = model.createMachine( ); }, shouldFetchIssuersAgain: context => context.issuers.length === 0, - isCustomSecureKeystore: () => isCustomSecureKeystore(), + isCustomSecureKeystore: () => isHardwareKeystoreExists, }, }, ); diff --git a/machines/issuersMachine.typegen.ts b/machines/issuersMachine.typegen.ts index 9e19a6947..f7f777638 100644 --- a/machines/issuersMachine.typegen.ts +++ b/machines/issuersMachine.typegen.ts @@ -105,7 +105,10 @@ export interface Typegen0 { setIssuers: 'done.invoke.issuersMachine.displayIssuers:invocation[0]'; setLoadingReasonAsDisplayIssuers: 'TRY_AGAIN'; setLoadingReasonAsDownloadingCredentials: 'done.invoke.issuersMachine.generateKeyPair:invocation[0]'; - setLoadingReasonAsSettingUp: 'done.invoke.issuersMachine.performAuthorization:invocation[0]'; + setLoadingReasonAsSettingUp: + | 'SELECTED_ISSUER' + | 'TRY_AGAIN' + | 'done.invoke.issuersMachine.performAuthorization:invocation[0]'; setNoInternet: 'done.invoke.checkInternet'; setOIDCConfigError: 'error.platform.issuersMachine.performAuthorization:invocation[0]'; setPrivateKey: 'done.invoke.issuersMachine.generateKeyPair:invocation[0]'; diff --git a/machines/settings.ts b/machines/settings.ts index 76cc855f9..5c1559e08 100644 --- a/machines/settings.ts +++ b/machines/settings.ts @@ -17,7 +17,7 @@ import getAllConfigurations, { import Storage from '../shared/storage'; import ShortUniqueId from 'short-unique-id'; import {__AppId} from '../shared/GlobalVariables'; -import {isCustomSecureKeystore} from '../shared/cryptoutil/cryptoUtil'; +import {isHardwareKeystoreExists} from '../shared/cryptoutil/cryptoUtil'; const model = createModel( { @@ -93,7 +93,6 @@ export const settingsMachine = model.createMachine( }, }, idle: { - entry: ['injiTourGuide'], on: { TOGGLE_BIOMETRIC_UNLOCK: { actions: ['toggleBiometricUnlock', 'storeContext'], @@ -114,6 +113,9 @@ export const settingsMachine = model.createMachine( CANCEL: { actions: ['resetCredentialRegistry'], }, + INJI_TOUR_GUIDE: { + target: 'showInjiTourGuide', + }, ACCEPT_HARDWARE_SUPPORT_NOT_EXISTS: { actions: [ 'updateUserShownWithHardwareKeystoreNotExists', @@ -146,13 +148,6 @@ export const settingsMachine = model.createMachine( }, }, }, - injiTourGuide: { - on: { - INJI_TOUR_GUIDE: { - target: 'showInjiTourGuide', - }, - }, - }, showInjiTourGuide: { on: { BACK: { @@ -274,7 +269,7 @@ function generateAppId() { } function deviceSupportsHardwareKeystore() { - return isIOS() ? true : isCustomSecureKeystore(); + return isIOS() ? true : isHardwareKeystoreExists; } type State = StateFrom; diff --git a/machines/store.ts b/machines/store.ts index 7ca566bac..f36247418 100644 --- a/machines/store.ts +++ b/machines/store.ts @@ -22,7 +22,7 @@ import { ENCRYPTION_ID, encryptJson, HMAC_ALIAS, - isCustomSecureKeystore, + isHardwareKeystoreExists, } from '../shared/cryptoutil/cryptoUtil'; import {VCMetadata} from '../shared/VCMetadata'; import FileStorage, {getFilePath} from '../shared/fileStorage'; @@ -82,7 +82,7 @@ export const storeMachine = events: {} as EventFrom, }, id: 'store', - initial: !isCustomSecureKeystore() + initial: !isHardwareKeystoreExists ? 'gettingEncryptionKey' : 'checkEncryptionKey', states: { @@ -105,7 +105,7 @@ export const storeMachine = }, on: { KEY_RECEIVED: { - actions: ['setEncryptionKey', 'logKey'], + actions: ['setEncryptionKey'], target: 'ready', }, ERROR: { @@ -441,7 +441,7 @@ export const storeMachine = generateEncryptionKey: () => async callback => { const randomBytes = await generateSecureRandom(32); const randomBytesString = binaryToBase64(randomBytes); - if (!isCustomSecureKeystore()) { + if (!isHardwareKeystoreExists) { const hasSetCredentials = await Keychain.setGenericPassword( ENCRYPTION_ID, randomBytesString, @@ -475,7 +475,7 @@ export const storeMachine = }, guards: { - isCustomSecureKeystore: () => isCustomSecureKeystore(), + isCustomSecureKeystore: () => isHardwareKeystoreExists, }, }, ); diff --git a/machines/store.typegen.ts b/machines/store.typegen.ts index fce816aab..e69de29bb 100644 --- a/machines/store.typegen.ts +++ b/machines/store.typegen.ts @@ -1,75 +0,0 @@ -// This file was automatically generated. Edits will be overwritten - -export interface Typegen0 { - '@@xstate/typegen': true; - internalEvents: { - 'done.invoke._store': { - type: 'done.invoke._store'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.store.resettingStorage:invocation[0]': { - type: 'done.invoke.store.resettingStorage:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'error.platform._store': {type: 'error.platform._store'; data: unknown}; - 'xstate.init': {type: 'xstate.init'}; - }; - invokeSrcNameMap: { - checkStorageInitialisedOrNot: 'done.invoke.store.checkStorageInitialisation:invocation[0]'; - clear: 'done.invoke.store.resettingStorage:invocation[0]'; - generateEncryptionKey: 'done.invoke.store.generatingEncryptionKey:invocation[0]'; - getEncryptionKey: 'done.invoke.store.gettingEncryptionKey:invocation[0]'; - hasAndroidEncryptionKey: 'done.invoke.store.checkEncryptionKey:invocation[0]'; - store: 'done.invoke._store'; - }; - missingImplementations: { - actions: 'logKey'; - delays: never; - guards: never; - services: never; - }; - eventsCausingActions: { - forwardStoreRequest: - | 'APPEND' - | 'CLEAR' - | 'GET' - | 'PREPEND' - | 'REMOVE' - | 'REMOVE_ITEMS' - | 'REMOVE_VC_METADATA' - | 'SET' - | 'UPDATE'; - logKey: 'KEY_RECEIVED'; - notifyParent: - | 'KEY_RECEIVED' - | 'READY' - | 'done.invoke.store.resettingStorage:invocation[0]'; - setEncryptionKey: 'KEY_RECEIVED'; - }; - eventsCausingDelays: {}; - eventsCausingGuards: { - isCustomSecureKeystore: 'KEY_RECEIVED'; - }; - eventsCausingServices: { - checkStorageInitialisedOrNot: 'ERROR'; - clear: 'KEY_RECEIVED'; - generateEncryptionKey: 'ERROR' | 'IGNORE' | 'READY'; - getEncryptionKey: 'TRY_AGAIN'; - hasAndroidEncryptionKey: never; - store: - | 'KEY_RECEIVED' - | 'READY' - | 'done.invoke.store.resettingStorage:invocation[0]'; - }; - matchesStates: - | 'checkEncryptionKey' - | 'checkStorageInitialisation' - | 'failedReadingKey' - | 'generatingEncryptionKey' - | 'gettingEncryptionKey' - | 'ready' - | 'resettingStorage'; - tags: never; -} diff --git a/package.json b/package.json index 8ebe5d68a..8620a7927 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "android:mosip": "react-native run-android --variant=mosipDebug", "ios": "react-native run-ios", "build:android:mosip": "cd android && ./gradlew :app:assembleMosipRelease && cd ..", - "i18n:compile-strings": "node scripts/compile-strings.js", "lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix", "test": "jest", "postinstall": "patch-package && npm run jetify && sh tools/talisman/talisman-precommit.sh" @@ -127,8 +126,7 @@ "name": "mosip-resident-app", "version": "1.0.0", "lint-staged": { - "*.{ts,tsx,js,css,md}": "prettier --write", - "*.strings.json": "node scripts/compile-strings.js" + "*.{ts,tsx,js,css,md}": "prettier --write" }, "overrides": { "react": "18.2.0", diff --git a/screens/AuthScreen.strings.json b/screens/AuthScreen.strings.json deleted file mode 100644 index 0ad0c4565..000000000 --- a/screens/AuthScreen.strings.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "header": "Would you like to use biometrics to unlock the application?", - "useBiometrics": "Use biometrics", - "usePasscode": "I'd rather use a passcode", - "errors": { - "unavailable": "Device does not support Biometrics", - "unenrolled": "To use Biometrics, please enroll your biometrics in your device settings", - "failed": "Failed to authenticate with Biometrics", - "generic": "There seems to be an error in Biometrics authentication" - } -} \ No newline at end of file diff --git a/screens/BiometricScreen.strings.json b/screens/BiometricScreen.strings.json deleted file mode 100644 index e8fee2234..000000000 --- a/screens/BiometricScreen.strings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "unlock": "Unlock with biometrics" -} \ No newline at end of file diff --git a/screens/BiometricScreenController.ts b/screens/BiometricScreenController.ts index 52362f269..6d4944dba 100644 --- a/screens/BiometricScreenController.ts +++ b/screens/BiometricScreenController.ts @@ -29,6 +29,7 @@ import { TelemetryConstants, resetRetryCount, } from '../shared/telemetry/TelemetryUtils'; +import {isAndroid} from '../shared/constants'; export function useBiometricScreen(props: RootRouteProps) { const {appService} = useContext(GlobalContext); @@ -127,7 +128,7 @@ export function useBiometricScreen(props: RootRouteProps) { ]); const checkBiometricsChange = () => { - if (Platform.OS === 'android') { + if (isAndroid()) { RNFingerprintChange.hasFingerPrintChanged().then( async (biometricsHasChanged: boolean) => { //if new biometrics are added, re-enable Biometrics Authentication diff --git a/screens/History/HistoryScreen.strings.json b/screens/History/HistoryScreen.strings.json deleted file mode 100644 index 9ff385d6f..000000000 --- a/screens/History/HistoryScreen.strings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "noHistory": "No history available yet", - "downloaded": "downloaded", - "shared": "shared", - "received": "received", - "deleted": "deleted" -} \ No newline at end of file diff --git a/screens/Home/HomeScreen.strings.json b/screens/Home/HomeScreen.strings.json deleted file mode 100644 index 4d7d6693c..000000000 --- a/screens/Home/HomeScreen.strings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "myVcsTab": "My\nCards", - "receivedVcsTab": "Received\nCards", - "historyTab": "History" -} \ No newline at end of file diff --git a/screens/Home/IntroSlidersScreen.tsx b/screens/Home/IntroSlidersScreen.tsx index f09636abb..297fa41bc 100644 --- a/screens/Home/IntroSlidersScreen.tsx +++ b/screens/Home/IntroSlidersScreen.tsx @@ -65,17 +65,17 @@ export const IntroSlidersScreen: React.FC = props => { }}> {controller.isPasscodeSet() ? (