Skip to content

Commit

Permalink
Merge pull request #1072 from tw-mosip/inji-577-release
Browse files Browse the repository at this point in the history
[Release 08-12-2023] OIDC4VC enhancements and major bug fixes
  • Loading branch information
swatigoel authored Dec 12, 2023
2 parents 61622d3 + f9f8dcd commit 877abea
Show file tree
Hide file tree
Showing 301 changed files with 17,139 additions and 10,533 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ios-automation-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -121,4 +120,13 @@ android/app/debug.keystore
# Expo
.expo
dist/
web-build/
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/
242 changes: 184 additions & 58 deletions .talismanrc

Large diffs are not rendered by default.

34 changes: 30 additions & 4 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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');
Expand All @@ -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);
}
Expand All @@ -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 (
<>
<AppLoading />
<MessageOverlay
isVisible={isKeyInvalidateError}
title={t('errors.invalidateKeyError.title')}
Expand Down
14 changes: 5 additions & 9 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
plugins {
plugins {
id 'com.gladed.androidgitversion' version '0.4.14'
}

apply plugin: "com.android.application"
apply plugin: "com.facebook.react"

import com.android.build.OutputFile

react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
Expand Down Expand Up @@ -37,6 +35,7 @@ react {
//
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
entryFile = file("../../index.js")
//
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
Expand Down Expand Up @@ -102,9 +101,6 @@ android {
}


namespace 'io.mosip.residentapp'


namespace 'io.mosip.residentapp'

defaultConfig {
Expand All @@ -130,7 +126,7 @@ android {
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}

signingConfigs {
release {
def keystore = file('release.keystore')
Expand Down Expand Up @@ -232,7 +228,7 @@ dependencies {
implementation 'com.facebook.fresco:animated-webp:2.0.0'
}
}

compileOnly project(':react-native-android-location-services-dialog-box')
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
Expand All @@ -252,4 +248,4 @@ dependencies {
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply from: "./eas-build.gradle"
apply from: "./eas-build.gradle"
3 changes: 0 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Expand Down
5 changes: 3 additions & 2 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
useExpoModules()
Binary file removed assets/pending_activation.png
Binary file not shown.
4 changes: 3 additions & 1 deletion components/EditableListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<EditableListItemProps> = props => {
const {t} = useTranslation('common');
Expand Down Expand Up @@ -37,7 +38,7 @@ export const EditableListItem: React.FC<EditableListItemProps> = props => {
color={Theme.Colors.Icon}
/>
<ListItem.Content>
<ListItem.Title style={{paddingTop: 3}}>
<ListItem.Title {...testIDProps(props.testID)} style={{paddingTop: 3}}>
<Text weight="semibold" color={props.titleColor}>
{props.title}
</Text>
Expand Down Expand Up @@ -109,6 +110,7 @@ export const EditableListItem: React.FC<EditableListItemProps> = props => {
};

interface EditableListItemProps {
testID?: string;
title: string;
content: string;
items: ListItemProps[];
Expand Down
19 changes: 6 additions & 13 deletions components/FaceScanner.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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<FaceScannerProps> = props => {
const {t} = useTranslation('FaceScanner');
Expand Down Expand Up @@ -86,7 +79,7 @@ export const FaceScanner: React.FC<FaceScannerProps> = props => {
}

return (
<View>
<Column fill align="space-between">
<View style={Theme.Styles.scannerContainer}>
<Camera
style={Theme.Styles.scanner}
Expand All @@ -98,14 +91,14 @@ export const FaceScanner: React.FC<FaceScannerProps> = props => {
align="center"
weight="semibold"
style={Theme.TextStyles.base}
margin="50 57 0 57">
margin="0 57">
{t('imageCaptureGuide')}
</Text>
<Centered margin="24 0">
<Centered>
{isCapturing || isVerifying ? (
<RotatingIcon name="sync" size={64} />
) : (
<Row align="center" style={{marginTop: 42}}>
<Row align="center">
<Centered style={Theme.Styles.imageCaptureButton}>
<TouchableOpacity
onPress={() => service.send(FaceScannerEvents.CAPTURE())}>
Expand All @@ -131,7 +124,7 @@ export const FaceScanner: React.FC<FaceScannerProps> = props => {
</Row>
)}
</Centered>
</View>
</Column>
);
};

Expand Down
80 changes: 24 additions & 56 deletions components/KebabPopUpController.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {useSelector} from '@xstate/react';
import {ActorRefFrom} from 'xstate';
import {
ExistingMosipVCItemEvents,
ExistingMosipVCItemMachine,
selectBindingAuthFailedError,
selectEmptyWalletBindingId,
selectIsPinned,
selectKebabPopUp,
Expand All @@ -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';
Expand All @@ -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');

Expand All @@ -124,6 +91,7 @@ export function useKebabPopUp(props) {
isAcceptingOtpInput,
isWalletBindingError,
walletBindingError,
bindingAuthFailedError,
otpError,
WalletBindingInProgress,
emptyWalletBindingId,
Expand Down
Loading

0 comments on commit 877abea

Please sign in to comment.