diff --git a/.github/workflows/ios-automation-build.yml b/.github/workflows/ios-automation-build.yml index 26c9ef3eec..6f1b637e1d 100644 --- a/.github/workflows/ios-automation-build.yml +++ b/.github/workflows/ios-automation-build.yml @@ -61,7 +61,7 @@ jobs: with: name: Inji path: ios/fastlane/Inji_app_file/Products/Applications/ - retention-days: 1 + retention-days: 7 - name: Upload Runner Log on Failure if: failure() # Only run this step if the previous steps failed diff --git a/.gitignore b/.gitignore index 8daf666cf4..310ccdba79 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,6 @@ web-build/ # The following patterns were generated by expo-cli # Built application files -*.apk *.aab android/app/debug/output-metadata.json android/app/release/output-metadata.json @@ -121,4 +120,13 @@ android/app/debug.keystore # Expo .expo dist/ -web-build/ \ No newline at end of file +web-build/ + +# automation test results +# test reports generated after running test +injitest/report/ +injitest/testng-report/ +# logs from tests ran +injitest/src/logs/ +# test case class files +injitest/target/ \ No newline at end of file diff --git a/.talismanrc b/.talismanrc index 90e535a19a..10731f7ee5 100644 --- a/.talismanrc +++ b/.talismanrc @@ -1,59 +1,185 @@ fileignoreconfig: -- filename: package.json - checksum: e0b34f1a1efbdf07b40a3e9e9ecd8884dd7d6835f45c57850e30988d2c6371a2 -- filename: package-lock.json - checksum: fc26d97edecbacd0b7507032c6fc1acfcea9f01f5dbe66a2a0341506e2f0daca -- filename: components/PasscodeVerify.tsx - checksum: 14654c0f038979fcd0d260170a45894a072f81e0767ca9a0e66935d33b5cc703 -- filename: i18n.ts - checksum: 75dd5536038ba198aa7b12eb6d2c2e7042c9ce292e5a0d5c90883ae5b2312b1e -- filename: screens/BiometricScreenController.ts - checksum: b3d0184fb894f4a9ffa1a4d277d2975495dbc47771593895bf1999deabafeb94 -- filename: screens/Home/MyVcs/IdInputModal.tsx - checksum: ec48ebeaf46b8fbc756f19ef8ffe8901ce0528aef164f3c7ffdeec36fb53ffc6 -- filename: components/Passcode.tsx - checksum: db4a18001be8c63bf7ffb389359861401fa1d22261b10ad729a76fd431c019a7 -- filename: screens/PasscodeScreen.tsx - checksum: 0cc5b91350e491a058ee8a1878a496c16b65f14969e989bdb1c354f6e9b8c03c -- filename: locales/spa.json - checksum: 981103ff872d6f54610468c7ead65873d9294a11092649b105c552f770f0214b -- filename: screens/AuthScreen.tsx - checksum: 2c1183b2ad8ec27adf8f389a2511805493f229fdda674064e2579d2032119d1c -- filename: screens/BiometricScreen.tsx - checksum: 7a730731aaa7540eec9d05d73de277a665dc06425666280842e0f9ba6e5b8514 -- filename: screens/AuthScreenController.ts - checksum: 18af825821bc95e1056050623b804a5a8e7435b9e3383916a5d63024eeba9553 -- filename: screens/WelcomeScreenController.ts - checksum: 71917c8c543a4a5b7ab61df259b785d233a80718123b0c8edf6ec81e1b3a81e0 -- filename: shared/telemetry/TelemetryUtils.js - checksum: 9a61cd59a3718adf1f14faf3024fec66a3295ef373878a878a28e5cb1287afaa -- filename: ios/Podfile.lock - checksum: cc123c3e1f04d41b394ceb16843b15c08bac3ba619ae853ff322717739761a85 -- filename: ios/Podfile.lock - checksum: cc123c3e1f04d41b394ceb16843b15c08bac3ba619ae853ff322717739761a85 -- 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: shared/cryptoutil/cryptoUtil.ts - checksum: b785ff3f01ab9530119072c4d38195048bfeee6155c54ea7dd031559acb722f3 -- filename: package.json - checksum: 1a9d02d94424c1266503d58038cae2318ab71261ab50cf930c5f98e07c0f3ccd -- filename: machines/store.typegen.ts - checksum: 6d22bc5c77398316b943c512c208ce0846a9fff674c1ccac79e07f21962acd5f -- filename: machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.typegen.ts - checksum: 10889302ca05646a283386be1bbe7a5fb510c02bb62a308ee45f3c2a872ae64e + - filename: package.json + checksum: 984f91af6d696faf934f7e541801343e146aed1b58d7c950ba11ec02dbd60dda + - filename: package-lock.json + checksum: c16e22cf137c123d7f1b1b95758646fc839dc1fa16f7cf74dff3124174475e13 + - filename: lib/jsonld-signatures/suites/ed255192018/ed25519.ts + checksum: 493b6e31144116cb612c24d98b97d8adcad5609c0a52c865a6847ced0a0ddc3a + - filename: components/PasscodeVerify.tsx + checksum: 14654c0f038979fcd0d260170a45894a072f81e0767ca9a0e66935d33b5cc703 + - filename: i18n.ts + checksum: 75dd5536038ba198aa7b12eb6d2c2e7042c9ce292e5a0d5c90883ae5b2312b1e + - filename: components/Passcode.tsx + checksum: db4a18001be8c63bf7ffb389359861401fa1d22261b10ad729a76fd431c019a7 + - filename: components/PasscodeVerify.tsx + checksum: 14654c0f038979fcd0d260170a45894a072f81e0767ca9a0e66935d33b5cc703 + - filename: screens/Home/MyVcs/GetIdInputModal.tsx + checksum: 5c736ed79a372d0ffa7c02eb33d0dc06edbbb08d120978ff287f5f06cd6c7746 + - filename: screens/AuthScreen.tsx + checksum: 4a096c467bb9b3fa476c220993ef0a58d72a758c40cf741dc2e4ec4db0c692e8 + - filename: screens/BiometricScreen.tsx + checksum: 7a730731aaa7540eec9d05d73de277a665dc06425666280842e0f9ba6e5b8514 + - filename: screens/AuthScreenController.ts + checksum: 18af825821bc95e1056050623b804a5a8e7435b9e3383916a5d63024eeba9553 + - filename: screens/BiometricScreenController.ts + checksum: 4a424adbd2d2404c9d968c54607885af643a07e09acc4a2d37c6e7a7952c4945 + - filename: screens/Home/IntroSlidersScreen.tsx + checksum: 9ff212530850e9f921f91d406c01f67ea5dd2a44e9cdb5e63d977749c7a7c5bd + - filename: machines/store.ts + checksum: defcbad7cd4dc1b710a45b3786abdafe5c96e460ede9f6e10a867c46d1123b49 + - filename: machines/issuersMachine.ts + checksum: c9099b58eb3fb41febcb7074af803392bf75858bacc9fc3a768cb05fa783ac09 + - filename: machines/issuersMachine.typegen.ts + checksum: 35e8bfe7945b963edceb9b33532cbaf2ee8cb93356dda526e48f2a1e4efec865 + - filename: screens/Home/MyVcs/IdInputModal.tsx + checksum: 6f21b2caf20ee1821b69e178a69e755e0b1094275e4a9f9cb4ae5ab515ce5d23 + - filename: screens/WelcomeScreenController.ts + checksum: 71917c8c543a4a5b7ab61df259b785d233a80718123b0c8edf6ec81e1b3a81e0 + - filename: shared/telemetry/TelemetryUtils.js + checksum: ffe9aac2dcc590b98b0d588885c088eff189504ade653a77f74b67312bfd27ad + - filename: shared/fileStorage.ts + checksum: 07cb337dc1d5b0f0eef56270ac4f4f589260ee5e490183c024cf98a2aeafb139 + - filename: shared/storage.ts + checksum: e29f48c9a54e3f91c98794935b829d4f021709d3e5aa881c9d6e7b6dc07d7ff9 + - filename: screens/Issuers/IssuersScreen.tsx + checksum: ec988b29527156057f0e24a9663fc850d22ccf10a0413d51481ae613a9425202 + - filename: ios/Podfile.lock + checksum: 62e1f542861366273b5cb5804535b440855e997e20584b81180481dcbc9c9fbe + - 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: ba3041b2ce380f44f6f52dc2c3df337d857df4494bd3c8727df9bf6fb5734750 + - filename: shared/cryptoutil/cryptoUtil.ts + checksum: adbc2ff6df1df412e891c988c9ba03fc82f66c2f6c64339f87d513fc835d14cc + - filename: machines/store.typegen.ts + checksum: 6d22bc5c77398316b943c512c208ce0846a9fff674c1ccac79e07f21962acd5f + - filename: machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.typegen.ts + checksum: 5836d4d1bec81d4078842ab8dbdd1ae4f8336b8bfe7843937d3d7d76bff1d017 + - filename: shared/telemetry/TelemetryConstants.js + checksum: f5c7b7766481d142908f8507afefe92ac5c6d5a725382058967c429a3453e6f6 + - filename: .github/workflows/internal-build.yml + checksum: 3a3b4dea51cb496729c4e568113fc19cf5b008481bb4a5d157f211a2128b951b + - filename: .github/workflows/push-triggers.yml + checksum: c5de3d912e2cbd55f6898e2f4a24413abbee8f084c99ea11ce6265504a520ce0 + - filename: android/fastlane/Fastfile + checksum: 41d1409adf8df9c843fd2dba89142cd55c471f3060ced57d48ee96dc8793ffcd + - filename: machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.typegen.ts + checksum: 15308987b1aab0c51c96bfc646ae55a3d7ae728a1f6e03ab31d5e1b786da03eb + - filename: machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.typegen.ts + checksum: 533785a3c8096ea93afc59c65025679c24d379e824e784e745ab298a0978cd2a + - filename: shared/telemetry/TelemetryUtils.js + checksum: a0686e9a5c006176fd720b84bc36ca947db1422caf65c90cd0c2d1102a9e96df + - filename: ios/fastlane/Fastfile + checksum: feea5a7f044ef6961d53e7d1e1ffb92a3e0f72761496424f6e64288e3718d605 + - filename: machines/bleShare/scan/scanMachine.ts + checksum: 399f08e25bfa9e25e6505801f2fbc94c20779cbad5010392275d0cd21824b3ac + - filename: locales/spa.json + checksum: c11dab58459d0d33149e374fbc8168efbbd38e921449abc943362f2c97da4637 + - filename: screens/PasscodeScreen.tsx + checksum: 3330b9db9cfce407782e82b4fe3c0b60a9ecb0f9327af2b69971e254f9e52921 + - filename: screens/Home/MyVcs/OtpVerificationModal.tsx + checksum: a99fe136d9d1348c541d413324d266e179ecad6a1fe6b6bd1e0b2856a5a6d6b5 + - filename: screens/QrLogin/QrConsent.tsx + checksum: 8563a194a4d38814eff670f0652d1a7af77134cafb350462174b4f147dbd890d + - filename: injitest/src/main/resources/config/bioValue.properties + checksum: 9e630028fe74001e95e905f1202e5fce7da59d07e3d65463740322393715309a + - filename: injitest/src/test/java/androidTestCases/ReceiveCardTest.java + checksum: 57057f56e3c8fb91ac1216647773dc4f64e571f7d1f3aa919273d3dde46bfe14 + - filename: injitest/src/test/java/androidTestCases/ShareVcTest.java + checksum: 025a2456f783253a937d485735e6fb665d51eb22084995dba275b76fcd9b58fe + - filename: injitest/src/test/java/androidTestCases/UnlockWithPasscodeTest.java + checksum: a6b0b4788a00ad033c26b1fcb1752f1969cf4302631aa7649718677f03d0560d + - filename: machines/auth.typegen.ts + checksum: 0c9a8c37cffede31a48325de8482a3acb982619c04563599ab116c25f756a0cd + - filename: injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingEsignetTest.java + checksum: 4113c682696eb0d5fa060a6ff6659d379f59746dfea482ac3abdf8f69d5053ca + - filename: injitest/src/main/java/inji/pages/AddNewCardPage.java + checksum: 973feebd0802514332893b9e11032f244956cb0153908e2a987815fca275dd9f + - filename: injitest/src/test/java/iosTestCases/UnlockWithPasscodeTest.java + checksum: 976bf34e5c708d945e276df7542e37673f61e19e3643fdefb68e6b7aae011751 + - filename: injitest/src/test/java/iosTestCases/ShareVcTest.java + checksum: bfd4141890bfc2851adaf9398daa96b09962ce0c717fea46335f5c910cad7a27 + - filename: injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingUinTest.java + checksum: ff6532896f8ef49143d2b80d019403973f5c2d341509fe758789b0e08c62894f + - filename: injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingVidTest.java + checksum: d54655e5c008db47a8c5c0ca940159c1764541e4f175286d17be04945593719f + - filename: injitest/src/test/java/iosTestCases/VcDownloadAndVerifyUsingUinTest.java + checksum: cbd99fab56775a4dc35b2f056a012cf25fc12e1adc249cec40c9ab5b9297046f + - filename: injitest/src/test/java/androidTestCases/VcDownloadAndVerifyUsingVidTest.java + checksum: 73b88ce6c91a5b6d23a74d20fd7c954ba08ff80b27ef1de79709d53a4a4bf072 + - filename: injitest/src/test/java/iosTestCases/VerifyHistoryTest.java + checksum: 278f4d6a36324a7381e0b3cc77a22b333b5cacf3983fd20cbec21a94326785a7 + - filename: injitest/src/main/java/inji/pages/CredentialRegistryPage.java + checksum: 02a56652dbd8449c952792968593990d23900718deea82484af3264b40daab1f + - filename: injitest/src/main/java/inji/pages/EsignetLoginPage.java + checksum: b0db45c8ea447c673f42bb4009bf307b8c3442005a439b17e54683365762e549 + - filename: injitest/src/test/java/iosTestCases/GenerateUinOrVidTest.java + checksum: 5ba115bc1b002cd98ea775dcbc8d77e06b1116362b19ce27ccf1d11ac7861c3e + - filename: injitest/src/test/java/iosTestCases/VerifyWelcomePagesTest.java + checksum: a51d5343475502a2a5836c062ab77da11fd391f4dce497cbdc214f568e95c6a3 + - filename: injitest/src/test/java/androidTestCases/VerifyWelcomePagesTest.java + checksum: 974b7d72c84de60590acdc306763ee04e33e70dac1894098a9fba1007bebdafb + - filename: injitest/src/main/java/inji/api/BaseTestCase.java + checksum: 0ea193cb665a01dd6a0d133edbfe043ad4ce24fb31024554a10cc7245a9f5a54 + - filename: injitest/src/test/java/iosTestCases/ReceiveCardTest.java + checksum: be0f469014ebffe203a44052891e440acde2e6fd943c724cae55cd77a1526c64 + - filename: injitest/src/test/java/iosTestCases/PinVcTest.java + checksum: d24e545667fef9f649d96ba86c5f33d9a489e700a2b50aeb1cc253fcb4e28f54 + - filename: injitest/src/test/java/androidTestCases/VerifyHistoryTest.java + checksum: a51d4831fd2e30c937d281a9c80f641f6c7254750dd6f21e6818e82028dc2843 + - filename: injitest/src/test/java/iosTestCases/ChangeLanguageTest.java + checksum: 3a668f5bb6a97c5f004fdfbea81c6881068698b50922f22cad156a906c1a2014 + - filename: injitest/src/test/java/iosTestCases/ActivateVcTest.java + checksum: 16174b9a66612e39f0fa85cdfb48f1966360554474300a008d158fbf98b9f6a0 + - filename: injitest/src/main/java/inji/api/CommonLibrary.java + checksum: db98f1945f49f03e78b8bec240824426bcc059f0f961f1a092d74f03c579b151 + - filename: injitest/src/main/resources/config/Authorization/request.json + checksum: 52f86aa8be616354798bdea54dff1cebb1e2e1a9318e0e9fa910275a266f7300 + - filename: injitest/src/test/java/iosTestCases/NoNetworkAndroidTest.java + checksum: 9941fefa4e7fcff5eeee8dc09e6405053a981794ab7a7ec6836a9eb6519de14b + - filename: injitest/src/test/java/iosTestCases/DeletingVcTest.java + checksum: 05956c268f57f795d0ce2017edc1b914c3b5b648c4aed012a7d7621fd02ff731 + - filename: injitest/src/main/java/inji/pages/OtpVerificationPage.java + checksum: cde23469a0d18363ecabc83965c5b855547b44fec55c9a0ec8baff0078c57fb6 + - filename: injitest/src/main/java/inji/api/KernelAuthentication.java + checksum: b1223dad2cb33367a3be75ca269d109d767114a52decfa39093dd0ee9edbd21b + - filename: injitest/src/main/resources/config/Kernel.properties + checksum: 3c1582c19a5240bfb6d49f39ca4c8ae024ad0bc675b137249084dffba03403d4 + - filename: injitest/src/main/java/inji/pages/HomePage.java + checksum: 0492a36d2dda148200a3aeb65e22a8a52b91f3b6ecea2047461497348a369f90 + - filename: injitest/src/main/java/inji/api/ConfigManager.java + checksum: c1fced4073a92677e0ea77f036c6d325459d186967f2c7eaaad37a68c2b28123 + - filename: injitest/src/main/resources/config/Kernel_qa-inji.properties + checksum: b3934c2a05c5f44dea30e530446c524ab43a56f330b5d4889597fe2a747ae687 + - filename: injitest/src/main/resources/TestData.json + checksum: 472a1c4481a2097f7517cc0ac50616cd82935cb67f2e8a1b2c1c79cc1046643d + - filename: injitest/src/main/resources/config/Authorization/internalAuthRequest.json + checksum: 8e7297d5581c8908a0c4c9dd827f60bafbbbc21e24e8cf5446d031c5ac8c9da1 + - filename: injitest/src/main/java/inji/api/MockSMTPListener.java + checksum: 6b5e12a98df5deff97a0d1410f29ac90b9d4d2c3e905ed3cc297821d7ea315ff + - filename: injitest/src/test/java/BaseTest/IosBaseTest.java + checksum: 5b8fbc0373d0a9f244214382f3025ef03a415025a75695f80902b9383739bb30 + - filename: injitest/src/main/java/inji/api/KeycloakUserManager.java + checksum: 773eda92fd8ef78e83104fd90b03ba881ba255ffb4aa780a2340b11cef99879d + - filename: injitest/src/main/java/inji/pages/ScanPage.java + checksum: 3598a3a58c4a744545ad7ca2a9742e1c3a3472fc4d2c42709eba42e6dbdd6a99 + - filename: injitest/src/test/java/androidTestCases/ChangeLanguageTest.java + checksum: df5dce1c36a462cf946debd1dcb7672d811f9d563339506b0bb7c79a3327265c + - filename: injitest/src/test/java/androidTestCases/ActivateVcTest.java + checksum: b45bddb5f4833a55de461c160f7c0104def0c46694491002cc73532f6173783e + - filename: injitest/src/main/java/inji/utils/S3Adapter.java + checksum: 99656f012510d144852b104eed544c8a9828ac4e67a83bef8c80fda0e4b7fc4a + - filename: injitest/src/test/java/androidTestCases/GenerateUinOrVidTest.java + checksum: ef69a622ab2e40eb389db8e8dc9d7ab4268fddd177a1005731b622de3e134f8b + - filename: injitest/src/test/java/androidTestCases/DeletingVcTest.java + checksum: 19a555d866fb13789ad1eb3ee8f0bed9008d1616478b4d07d8c593138ef5b446 + - filename: injitest/src/test/java/androidTestCases/PinVcTest.java + checksum: 862610634f5153e9b71664bcc6294bfc8287d7bd43189d7ed2055e4536727d8d + - filename: injitest/src/test/java/androidTestCases/CredentialRegistryTest.java + checksum: c702d0dc7337a6131c01217be84a507a6d383c99e7afbcc32117cb70c2b5c9ab + - filename: injitest/src/test/java/androidTestCases/NoNetworkAndroidTest.java + checksum: 2de62d9ba1a876fe9d601d4a70486ce2f298786d037440106826e110374c294e diff --git a/App.tsx b/App.tsx index d4aeaba87b..80ed0cf9d1 100644 --- a/App.tsx +++ b/App.tsx @@ -1,5 +1,4 @@ import React, {useContext, useEffect} from 'react'; -import AppLoading from 'expo-app-loading'; import {AppLayout} from './screens/AppLayout'; import {useFont} from './shared/hooks/useFont'; import {GlobalContextProvider} from './components/GlobalContextProvider'; @@ -15,15 +14,23 @@ import { import {DualMessageOverlay} from './components/DualMessageOverlay'; import {useApp} from './screens/AppController'; import {Alert} from 'react-native'; -import {configureTelemetry} from './shared/telemetry/TelemetryUtils'; +import { + TelemetryConstants, + configureTelemetry, + getErrorEventData, + sendErrorEvent, +} from './shared/telemetry/TelemetryUtils'; import {MessageOverlay} from './components/MessageOverlay'; import SecureKeystore from 'react-native-secure-keystore'; import {isHardwareKeystoreExists} from './shared/cryptoutil/cryptoUtil'; import i18n from './i18n'; import './shared/flipperConfig'; +import * as SplashScreen from 'expo-splash-screen'; + +SplashScreen.preventAutoHideAsync(); // kludge: this is a bad practice but has been done temporarily to surface -// an occurance of a bug with minimal residual code changes, this should +// an occurrence of a bug with minimal residual code changes, this should // be removed once the bug cause is determined & fixed, ref: INJI-222 const DecryptErrorAlert = (controller, t) => { const heading = t('errors.decryptionFailed'); @@ -43,6 +50,14 @@ const AppLayoutWrapper: React.FC = () => { const isDecryptError = useSelector(appService, selectIsDecryptError); const controller = useApp(); const {t} = useTranslation('WelcomeScreen'); + + useEffect(() => { + async function hideAppLoading() { + await SplashScreen.hideAsync(); + } + hideAppLoading(); + }, []); + if (isDecryptError) { DecryptErrorAlert(controller, t); } @@ -59,9 +74,20 @@ const AppLoadingWrapper: React.FC = () => { ); const controller = useApp(); const {t} = useTranslation('WelcomeScreen'); + useEffect(() => { + if (isKeyInvalidateError) { + configureTelemetry(); + sendErrorEvent( + getErrorEventData( + TelemetryConstants.FlowType.appLogin, + TelemetryConstants.ErrorId.appWasReset, + TelemetryConstants.ErrorMessage.appWasReset, + ), + ); + } + }, [isKeyInvalidateError]); return ( <> - - - - diff --git a/android/settings.gradle b/android/settings.gradle index cf75b94c96..38e206ee8b 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -3,6 +3,7 @@ rootProject.name = 'Inji' apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' includeBuild('../node_modules/react-native-gradle-plugin') - +include ':react-native-android-location-services-dialog-box' +project(':react-native-android-location-services-dialog-box').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-location-services-dialog-box/android') apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle") -useExpoModules() \ No newline at end of file +useExpoModules() diff --git a/assets/pending_activation.png b/assets/pending_activation.png deleted file mode 100644 index b094a451da..0000000000 Binary files a/assets/pending_activation.png and /dev/null differ diff --git a/components/EditableListItem.tsx b/components/EditableListItem.tsx index 54bf378fd3..9250497849 100644 --- a/components/EditableListItem.tsx +++ b/components/EditableListItem.tsx @@ -4,6 +4,7 @@ import {Icon, ListItem, Overlay, Input} from 'react-native-elements'; import {Text, Column, Row, Button} from './ui'; import {Theme} from './ui/styleUtils'; import {useTranslation} from 'react-i18next'; +import testIDProps from '../shared/commonUtil'; export const EditableListItem: React.FC = props => { const {t} = useTranslation('common'); @@ -37,7 +38,7 @@ export const EditableListItem: React.FC = props => { color={Theme.Colors.Icon} /> - + {props.title} @@ -109,6 +110,7 @@ export const EditableListItem: React.FC = props => { }; interface EditableListItemProps { + testID?: string; title: string; content: string; items: ListItemProps[]; diff --git a/components/FaceScanner.tsx b/components/FaceScanner.tsx index 6f200e0eb9..eb074ea169 100644 --- a/components/FaceScanner.tsx +++ b/components/FaceScanner.tsx @@ -1,12 +1,6 @@ import React, {useCallback, useContext, useEffect, useRef} from 'react'; import {Camera} from 'expo-camera'; -import { - Platform, - StyleSheet, - TouchableOpacity, - View, - Image, -} from 'react-native'; +import {TouchableOpacity, View, Image} from 'react-native'; import {Button, Centered, Column, Row, Text} from './ui'; import {useInterpret, useSelector} from '@xstate/react'; import {useTranslation} from 'react-i18next'; @@ -26,7 +20,6 @@ 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'); @@ -86,7 +79,7 @@ export const FaceScanner: React.FC = props => { } return ( - + = props => { align="center" weight="semibold" style={Theme.TextStyles.base} - margin="50 57 0 57"> + margin="0 57"> {t('imageCaptureGuide')} - + {isCapturing || isVerifying ? ( ) : ( - + service.send(FaceScannerEvents.CAPTURE())}> @@ -131,7 +124,7 @@ export const FaceScanner: React.FC = props => { )} - + ); }; diff --git a/components/KebabPopUpController.tsx b/components/KebabPopUpController.tsx index 8c5d0b24f5..d96f5509a9 100644 --- a/components/KebabPopUpController.tsx +++ b/components/KebabPopUpController.tsx @@ -1,8 +1,7 @@ import {useSelector} from '@xstate/react'; import {ActorRefFrom} from 'xstate'; import { - ExistingMosipVCItemEvents, - ExistingMosipVCItemMachine, + selectBindingAuthFailedError, selectEmptyWalletBindingId, selectIsPinned, selectKebabPopUp, @@ -14,22 +13,14 @@ import { selectShowActivities, selectShowWalletBindingError, selectWalletBindingError, +} from '../machines/VCItemMachine/commonSelectors'; +import { + ExistingMosipVCItemEvents, + ExistingMosipVCItemMachine, } from '../machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine'; - import { EsignetMosipVCItemEvents, EsignetMosipVCItemMachine, - selectEmptyWalletBindingId as esignetSelectEmptyWalletBindingId, - selectIsPinned as esignetSelectIsPinned, - selectKebabPopUp as esignetSelectKebabPopUp, - selectKebabPopUpAcceptingBindingOtp as esignetSelectKebabPopUpAcceptingBindingOtp, - selectKebabPopUpBindingWarning as esignetSelectKebabPopUpBindingWarning, - selectKebabPopUpWalletBindingInProgress as esignetSelectKebabPopUpWalletBindingInProgress, - selectOtpError as esignetSelectOtpError, - selectRemoveWalletWarning as esignetSelectRemoveWalletWarning, - selectShowActivities as esignetSelectShowActivities, - selectShowWalletBindingError as esignetSelectShowWalletBindingError, - selectWalletBindingError as esignetSelectWalletBindingError, } from '../machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine'; import {selectActivities} from '../machines/activityLog'; import {GlobalContext} from '../shared/GlobalContext'; @@ -56,55 +47,31 @@ export function useKebabPopUp(props) { const SHOW_ACTIVITY = () => service.send(vcEvents.SHOW_ACTIVITY()); const INPUT_OTP = (otp: string) => service.send(vcEvents.INPUT_OTP(otp)); const RESEND_OTP = () => service.send(vcEvents.RESEND_OTP()); - let isPinned = useSelector(service, selectIsPinned); - let isBindingWarning = useSelector(service, selectKebabPopUpBindingWarning); - let isRemoveWalletWarning = useSelector(service, selectRemoveWalletWarning); - let isAcceptingOtpInput = useSelector( + const isPinned = useSelector(service, selectIsPinned); + const isBindingWarning = useSelector(service, selectKebabPopUpBindingWarning); + const isRemoveWalletWarning = useSelector(service, selectRemoveWalletWarning); + const isAcceptingOtpInput = useSelector( service, selectKebabPopUpAcceptingBindingOtp, ); - let isWalletBindingError = useSelector(service, selectShowWalletBindingError); - let otpError = useSelector(service, selectOtpError); - let walletBindingError = useSelector(service, selectWalletBindingError); - let WalletBindingInProgress = useSelector( + const isWalletBindingError = useSelector( + service, + selectShowWalletBindingError, + ); + const otpError = useSelector(service, selectOtpError); + const walletBindingError = useSelector(service, selectWalletBindingError); + const bindingAuthFailedError = useSelector( + service, + selectBindingAuthFailedError, + ); + const WalletBindingInProgress = useSelector( service, selectKebabPopUpWalletBindingInProgress, ); - let emptyWalletBindingId = useSelector(service, selectEmptyWalletBindingId); - let isKebabPopUp = useSelector(service, selectKebabPopUp); - let isShowActivities = useSelector(service, selectShowActivities); + const emptyWalletBindingId = useSelector(service, selectEmptyWalletBindingId); + const isKebabPopUp = useSelector(service, selectKebabPopUp); + const isShowActivities = useSelector(service, selectShowActivities); - if (props.vcMetadata.isFromOpenId4VCI()) { - isPinned = useSelector(service, esignetSelectIsPinned); - isBindingWarning = useSelector( - service, - esignetSelectKebabPopUpBindingWarning, - ); - isRemoveWalletWarning = useSelector( - service, - esignetSelectRemoveWalletWarning, - ); - isAcceptingOtpInput = useSelector( - service, - esignetSelectKebabPopUpAcceptingBindingOtp, - ); - isWalletBindingError = useSelector( - service, - esignetSelectShowWalletBindingError, - ); - otpError = useSelector(service, esignetSelectOtpError); - walletBindingError = useSelector(service, esignetSelectWalletBindingError); - WalletBindingInProgress = useSelector( - service, - esignetSelectKebabPopUpWalletBindingInProgress, - ); - emptyWalletBindingId = useSelector( - service, - esignetSelectEmptyWalletBindingId, - ); - isKebabPopUp = useSelector(service, esignetSelectKebabPopUp); - isShowActivities = useSelector(service, esignetSelectShowActivities); - } const {appService} = useContext(GlobalContext); const activityLogService = appService.children.get('activityLog'); @@ -124,6 +91,7 @@ export function useKebabPopUp(props) { isAcceptingOtpInput, isWalletBindingError, walletBindingError, + bindingAuthFailedError, otpError, WalletBindingInProgress, emptyWalletBindingId, diff --git a/components/LanguageSelector.tsx b/components/LanguageSelector.tsx index 49d66d56ca..440ca376f3 100644 --- a/components/LanguageSelector.tsx +++ b/components/LanguageSelector.tsx @@ -2,10 +2,11 @@ import React from 'react'; import {SUPPORTED_LANGUAGES} from '../i18n'; import {I18nManager, View} from 'react-native'; import {Picker} from './ui/Picker'; -import Storage from '../shared/storage'; import {useTranslation} from 'react-i18next'; -import i18next from 'i18next'; +import i18next, {i18n} from 'i18next'; import RNRestart from 'react-native-restart'; +import {setItem} from '../machines/store'; +import Keychain from 'react-native-keychain'; export const LanguageSelector: React.FC = props => { const {i18n} = useTranslation(); @@ -13,38 +14,39 @@ export const LanguageSelector: React.FC = props => { ([value, label]) => ({label, value}), ); - const changeLanguage = async (language: string) => { - if (language !== i18n.language) { - await i18n.changeLanguage(language).then(async () => { - await Storage.setItem('language', i18n.language); - const isRTL = i18next.dir(language) === 'rtl' ? true : false; - if (isRTL !== I18nManager.isRTL) { - try { - I18nManager.forceRTL(isRTL); - setTimeout(() => { - RNRestart.Restart(); - }, 150); - } catch (e) { - console.log('error', e); - } - } - }); - } - }; - return ( changeLanguage(i18n, language)} triggerComponent={props.triggerComponent} /> ); }; +export const changeLanguage = async (i18n: i18n, language: string) => { + if (language !== i18n.language) { + await i18n.changeLanguage(language).then(async () => { + const existingCredentials = await Keychain.getGenericPassword(); + await setItem('language', i18n.language, existingCredentials.password); + const isRTL = i18next.dir(language) === 'rtl' ? true : false; + if (isRTL !== I18nManager.isRTL) { + try { + I18nManager.forceRTL(isRTL); + setTimeout(() => { + RNRestart.Restart(); + }, 150); + } catch (e) { + console.log('error', e); + } + } + }); + } +}; + interface LanguageSelectorProps { triggerComponent: React.ReactElement; } diff --git a/components/MessageOverlay.tsx b/components/MessageOverlay.tsx index 2f91480c2a..09cb7f520e 100644 --- a/components/MessageOverlay.tsx +++ b/components/MessageOverlay.tsx @@ -14,7 +14,7 @@ export const MessageOverlay: React.FC = props => { ? props.customHeight : props.progress ? 100 - : 150, + : 170, }, }); return ( @@ -29,6 +29,7 @@ export const MessageOverlay: React.FC = props => { {props.title && ( > = props => { }; export interface MessageOverlayProps { + testID?: string; isVisible: boolean; title?: string; buttonText?: string; diff --git a/components/Passcode.tsx b/components/Passcode.tsx index 1768999e81..a08f17c5d4 100644 --- a/components/Passcode.tsx +++ b/components/Passcode.tsx @@ -8,10 +8,16 @@ import { getImpressionEventData, sendImpressionEvent, } from '../shared/telemetry/TelemetryUtils'; +import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants'; export const Passcode: React.FC = props => { useEffect(() => { - sendImpressionEvent(getImpressionEventData('App Login', 'Passcode')); + sendImpressionEvent( + getImpressionEventData( + TelemetryConstants.FlowType.appLogin, + TelemetryConstants.Screens.passcode, + ), + ); }, []); return ( diff --git a/components/PasscodeVerify.tsx b/components/PasscodeVerify.tsx index 0f58edc8c5..4c60071bcc 100644 --- a/components/PasscodeVerify.tsx +++ b/components/PasscodeVerify.tsx @@ -3,6 +3,11 @@ import {useTranslation} from 'react-i18next'; import {PinInput} from './PinInput'; import {hashData} from '../shared/commonUtil'; import {argon2iConfig} from '../shared/constants'; +import { + getErrorEventData, + sendErrorEvent, +} from '../shared/telemetry/TelemetryUtils'; +import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants'; export const MAX_PIN = 6; @@ -17,9 +22,7 @@ export const PasscodeVerify: React.FC = props => { } }, [isVerified]); - return ( - - ); + return ; async function verify(value: string) { try { @@ -32,6 +35,13 @@ export const PasscodeVerify: React.FC = props => { } } } catch (error) { + sendErrorEvent( + getErrorEventData( + TelemetryConstants.FlowType.appLogin, + TelemetryConstants.ErrorId.mismatch, + error, + ), + ); console.log('error:', error); } } @@ -42,4 +52,5 @@ interface PasscodeVerifyProps { onSuccess: () => void; onError?: (error: string) => void; salt: string; + testID: string; } diff --git a/components/QrScanner.tsx b/components/QrScanner.tsx index 97aa04e37c..af18b06593 100644 --- a/components/QrScanner.tsx +++ b/components/QrScanner.tsx @@ -73,7 +73,7 @@ export const QrScanner: React.FC = props => { ); }; return ( - + {hasPermission == false && } = props => { align="center" weight="semibold" style={Theme.TextStyles.base} - margin="20 57 0 57"> + margin="0 57"> {props.title} )} - + { setCameraType( @@ -112,7 +112,7 @@ export const QrScanner: React.FC = props => { {t('flipCamera')} - + ); function onBarcodeScanned(event: BarCodeEvent) { diff --git a/components/VC/MosipVCItem/MosipVCItem.tsx b/components/VC/MosipVCItem/MosipVCItem.tsx index d6dcf72d07..18442657cf 100644 --- a/components/VC/MosipVCItem/MosipVCItem.tsx +++ b/components/VC/MosipVCItem/MosipVCItem.tsx @@ -61,8 +61,7 @@ export const MosipVCItem: React.FC< selectable={props.selectable} selected={props.selected} service={service} - iconName={props.iconName} - iconType={props.iconType} + isPinned={props.isPinned} onPress={() => props.onPress(service)} isDownloading={props.isDownloading} /> @@ -75,9 +74,14 @@ export const MosipVCItem: React.FC< emptyWalletBindingId={emptyWalletBindingId} showOnlyBindedVc={props.showOnlyBindedVc} /> - + + + - + ) => void; onShow?: (vcRef?: ActorRefFrom) => void; - iconName?: string; - iconType?: string; isSharingVc?: boolean; isDownloading?: boolean; + isPinned?: boolean; } export interface EsignetMosipVCItemProps { @@ -123,8 +126,7 @@ export interface EsignetMosipVCItemProps { showOnlyBindedVc?: boolean; onPress?: (vcRef?: ActorRefFrom) => void; onShow?: (vcRef?: ActorRefFrom) => void; - iconName?: string; - iconType?: string; isSharingVc?: boolean; isDownloading?: boolean; + isPinned?: boolean; } diff --git a/components/VC/MosipVCItem/MosipVCItemActivationStatus.tsx b/components/VC/MosipVCItem/MosipVCItemActivationStatus.tsx index 42c633a666..4e7e5aca23 100644 --- a/components/VC/MosipVCItem/MosipVCItemActivationStatus.tsx +++ b/components/VC/MosipVCItem/MosipVCItemActivationStatus.tsx @@ -14,10 +14,8 @@ const WalletUnverifiedIcon: React.FC = () => { size={Theme.ICON_MID_SIZE} type="material-community" containerStyle={{ - marginStart: 1, - marginEnd: 1, + marginEnd: 5, bottom: 1, - marginRight: -2, }} /> ); @@ -29,7 +27,10 @@ const WalletVerifiedIcon: React.FC = () => { name="verified-user" color={Theme.Colors.VerifiedIcon} size={Theme.ICON_MID_SIZE} - containerStyle={{marginStart: 10, bottom: 1, marginLeft: 10}} + containerStyle={{ + marginEnd: 5, + bottom: 1, + }} /> ); }; @@ -39,29 +40,18 @@ const WalletUnverifiedActivationDetails: React.FC< > = props => { const {t} = useTranslation('VcDetails'); return ( - - - {props.verifiableCredential && } - - + + {props.verifiableCredential && } + ); }; @@ -71,29 +61,20 @@ const WalletVerifiedActivationDetails: React.FC< > = props => { const {t} = useTranslation('WalletBinding'); return ( - - - - - + + + ); }; @@ -102,7 +83,7 @@ export const MosipVCItemActivationStatus: React.FC< ExistingMosipVCItemActivationStatusProps > = props => { return ( - + {props.emptyWalletBindingId ? ( - {props.iconName && ( + {props.isPinned && ( void; isDownloading?: boolean; @@ -347,9 +346,12 @@ export interface EsignetMosipVCItemContentProps { generatedOn: string; selectable: boolean; selected: boolean; - iconName?: string; - iconType?: string; + isPinned?: boolean; service: any; onPress?: () => void; isDownloading?: boolean; } + +MosipVCItemContent.defaultProps = { + isPinned: false, +}; diff --git a/components/VC/MosipVCItem/MosipVCItemDetails.tsx b/components/VC/MosipVCItem/MosipVCItemDetails.tsx index 014013ade8..384964b4ea 100644 --- a/components/VC/MosipVCItem/MosipVCItemDetails.tsx +++ b/components/VC/MosipVCItem/MosipVCItemDetails.tsx @@ -368,7 +368,16 @@ export const MosipVCItemDetails: React.FC< props.isBindingPending ? ( - + service.send(ExistingMosipVCItemEvents.DISMISS()); let KEBAB_POPUP = () => service.send(ExistingMosipVCItemEvents.KEBAB_POPUP()); const isSavingFailedInIdle = useSelector(service, selectIsSavingFailedInIdle); const storeErrorTranslationPath = 'errors.savingFailed'; - let generatedOn = useSelector(service, selectGeneratedOn); + const generatedOn = useSelector(service, selectGeneratedOn); if (props.vcMetadata.isFromOpenId4VCI()) { - context = useSelector(service, esignetSelectContext); - isKebabPopUp = useSelector(service, esignetSelectKebabPopUp); - generatedOn = useSelector(service, esignetSelectGeneratedOn); - emptyWalletBindingId = useSelector( - service, - esignetSelectEmptyWalletBindingId, - ); DISMISS = () => service.send(EsignetMosipVCItemEvents.DISMISS()); KEBAB_POPUP = () => service.send(EsignetMosipVCItemEvents.KEBAB_POPUP()); - verifiableCredential = useSelector( - service, - esignetSelectVerifiableCredentials, - ); } return { service, diff --git a/components/VidItem.tsx b/components/VidItem.tsx index 463be171f4..a0f98badb1 100644 --- a/components/VidItem.tsx +++ b/components/VidItem.tsx @@ -5,9 +5,11 @@ import {CheckBox} from 'react-native-elements'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import {ActorRefFrom} from 'xstate'; import { - createExistingMosipVCItemMachine, selectVerifiableCredential, selectGeneratedOn, +} from '../machines/VCItemMachine/commonSelectors'; +import { + createExistingMosipVCItemMachine, selectId, ExistingMosipVCItemMachine, } from '../machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine'; diff --git a/components/openId4VCI/Issuer.tsx b/components/openId4VCI/Issuer.tsx index 1b6d6489e3..08b9852292 100644 --- a/components/openId4VCI/Issuer.tsx +++ b/components/openId4VCI/Issuer.tsx @@ -1,15 +1,13 @@ import React from 'react'; import {Image, Pressable} from 'react-native'; import {Theme} from '../ui/styleUtils'; -import {useTranslation} from 'react-i18next'; import testIDProps from '../../shared/commonUtil'; import {Text} from '../ui'; +import {displayType} from '../../machines/issuersMachine'; export const Issuer: React.FC = (props: IssuerProps) => { - const {t} = useTranslation('IssuersScreen'); - function getIssuerLogo() { - return {uri: props.logoUrl}; + return {uri: props.displayDetails.logo.url}; } return ( @@ -19,37 +17,36 @@ export const Issuer: React.FC = (props: IssuerProps) => { style={({pressed}) => pressed ? [ - Theme.issuersScreenStyles.issuerBoxContainerPressed, + Theme.IssuersScreenStyles.issuerBoxContainerPressed, Theme.Styles.boxShadow, ] : [ - Theme.issuersScreenStyles.issuerBoxContainer, + Theme.IssuersScreenStyles.issuerBoxContainer, Theme.Styles.boxShadow, ] }> {props.displayDetails.logo.alt_text} - {t('itemHeading', {issuer: props.displayName})} + style={Theme.IssuersScreenStyles.issuerHeading}> + {props.displayDetails.title} - {t('itemSubHeading')} + style={Theme.IssuersScreenStyles.issuerDescription}> + {props.displayDetails.description} ); }; interface IssuerProps { - id: string; - displayName: string; - logoUrl: string; + displayDetails: displayType; onPress: () => void; testID: string; } diff --git a/components/ui/Error.tsx b/components/ui/Error.tsx index 6b7bdeed2c..4bd5f1bebf 100644 --- a/components/ui/Error.tsx +++ b/components/ui/Error.tsx @@ -28,7 +28,7 @@ export const Error: React.FC = props => { {props.tryAgain && (