diff --git a/.env.sample b/.env.sample index f206c384..dd1dcdd3 100644 --- a/.env.sample +++ b/.env.sample @@ -18,4 +18,7 @@ PROOF_TEMPLATE_URL= # Google Signin GOOGLE_WEB_CLIENT_ID=CLIENT_ID -GOOGLE_IOS_CLIENT_ID=CLIENT_ID \ No newline at end of file +GOOGLE_IOS_CLIENT_ID=CLIENT_ID + +# DATA ENCYPTION KEY +DATA_ENCRYPTION_KEY=DATA_ENCRYPTION_KEY diff --git a/android/app/build.gradle b/android/app/build.gradle index 1761656b..336ca720 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -81,8 +81,8 @@ android { applicationId "id.credebl.adeya" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 12 - versionName "1.0.9" + versionCode 16 + versionName "1.0.10" missingDimensionStrategy 'react-native-camera', 'general' } @@ -114,6 +114,15 @@ android { proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } + + packagingOptions { + pickFirst 'lib/x86/libc++_shared.so' + pickFirst 'lib/x86_64/libjsc.so' + pickFirst 'lib/arm64-v8a/libjsc.so' + pickFirst 'lib/arm64-v8a/libc++_shared.so' + pickFirst 'lib/x86_64/libc++_shared.so' + pickFirst 'lib/armeabi-v7a/libc++_shared.so' + } } dependencies { diff --git a/android/build.gradle b/android/build.gradle index 3b3cb80d..e4389a69 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -3,7 +3,7 @@ buildscript { ext { buildToolsVersion = "33.0.0" - minSdkVersion = 21 + minSdkVersion = 24 compileSdkVersion = 34 targetSdkVersion = 34 diff --git a/app/components/misc/CredentialCard11.tsx b/app/components/misc/CredentialCard11.tsx index e115e3e9..97afb7ee 100644 --- a/app/components/misc/CredentialCard11.tsx +++ b/app/components/misc/CredentialCard11.tsx @@ -137,7 +137,7 @@ const CredentialCard11: React.FC = ({ }, primaryBodyContainer: { flexGrow: 1, - padding, + padding: 15, }, imageAttr: { height: 150, @@ -309,6 +309,7 @@ const CredentialCard11: React.FC = ({ styles.textContainer, { lineHeight: 24, + width: '85%', fontWeight: 'bold', }, ]} @@ -380,7 +381,7 @@ const CredentialCard11: React.FC = ({ { fontWeight: 'bold', lineHeight: 24, - flex: 1, + width: '85%', flexWrap: 'wrap', }, ]}> diff --git a/app/components/record/W3CCredentialRecord.tsx b/app/components/record/W3CCredentialRecord.tsx index caef85f7..71e0791e 100644 --- a/app/components/record/W3CCredentialRecord.tsx +++ b/app/components/record/W3CCredentialRecord.tsx @@ -1,7 +1,7 @@ import { W3cCredentialRecord } from '@adeya/ssi' import React, { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' -import { FlatList, StyleSheet, Text, TouchableOpacity, View } from 'react-native' +import { ActivityIndicator, FlatList, StyleSheet, Text, TouchableOpacity, View } from 'react-native' import { useTheme } from '../../contexts/theme' import { Field, W3CCredentialAttributeField } from '../../types/record' @@ -23,6 +23,7 @@ export interface RecordProps { } } renderCertificate?: () => void + isCertificateLoading?: boolean } const W3CCredentialRecord: React.FC = ({ @@ -32,12 +33,16 @@ const W3CCredentialRecord: React.FC = ({ tables, w3cCredential, renderCertificate, + isCertificateLoading, }) => { const { t } = useTranslation() const [shown, setShown] = useState([]) const [showAll, setShowAll] = useState(true) const { ListItems, TextTheme, ColorPallet } = useTheme() + const isPrettyVcAvailable = + w3cCredential?.credential?.prettyVc && Object.keys(w3cCredential?.credential?.prettyVc).length > 0 + const styles = StyleSheet.create({ linkContainer: { ...ListItems.recordContainer, @@ -56,7 +61,7 @@ const W3CCredentialRecord: React.FC = ({ }, rowContainer: { flexDirection: 'row', - justifyContent: w3cCredential?.credential?.prettyVc ? 'space-between' : 'flex-end', + justifyContent: isPrettyVcAvailable ? 'space-between' : 'flex-end', backgroundColor: ColorPallet.grayscale.white, }, linkText: { @@ -118,19 +123,23 @@ const W3CCredentialRecord: React.FC = ({ {header()} - {w3cCredential?.credential?.prettyVc ? ( + {isPrettyVcAvailable && ( - - {t('Record.ViewCertificate')} - + {isCertificateLoading ? ( + + ) : ( + + {t('Record.ViewCertificate')} + + )} - ) : null} + )} {hideFieldValues ? ( diff --git a/app/constants.ts b/app/constants.ts index 62896aea..42cb2aff 100644 --- a/app/constants.ts +++ b/app/constants.ts @@ -79,3 +79,5 @@ export const domain = 'didcomm://invite' export const tourMargin = 25 export const hitSlop = { top: 44, bottom: 44, left: 44, right: 44 } + +export const CREDENTIAL = 'Credential' diff --git a/app/navigators/RootStack.tsx b/app/navigators/RootStack.tsx index 2ec7db58..6899d576 100644 --- a/app/navigators/RootStack.tsx +++ b/app/navigators/RootStack.tsx @@ -114,10 +114,10 @@ const RootStack: React.FC = () => { } // Try connection based - const { connectionRecord } = await connectFromInvitation(agent, invitationUrl) + const { connectionRecord, outOfBandRecord } = await connectFromInvitation(agent, invitationUrl) navigation.navigate(Stacks.ConnectionStack as any, { screen: Screens.Connection, - params: { connectionId: connectionRecord?.id }, + params: { connectionId: connectionRecord?.id, outOfBandId: outOfBandRecord.id }, }) } catch { try { @@ -146,11 +146,11 @@ const RootStack: React.FC = () => { return } - const { connectionRecord } = await connectFromInvitation(agent, urlData) + const { connectionRecord, outOfBandRecord } = await connectFromInvitation(agent, urlData) navigation.getParent()?.navigate(Stacks.ConnectionStack, { screen: Screens.Connection, - params: { connectionId: connectionRecord?.id }, + params: { connectionId: connectionRecord?.id, outOfBandId: outOfBandRecord.id }, }) return } diff --git a/app/screens/Chat.tsx b/app/screens/Chat.tsx index 21add545..3fef5617 100644 --- a/app/screens/Chat.tsx +++ b/app/screens/Chat.tsx @@ -223,9 +223,18 @@ const Chat: React.FC = ({ navigation, route }) => { [ProofState.PresentationSent]: toProofDetails, [ProofState.PresentationReceived]: toProofDetails, [ProofState.RequestReceived]: () => { - navigation.navigate(Stacks.ContactStack as any, { - screen: Screens.ProofRequest, - params: { proofId: record.id }, + agent.proofs.getFormatData(record.id).then(value => { + if (value?.request?.indy) { + navigation.navigate(Stacks.ContactStack as any, { + screen: Screens.ProofRequest, + params: { proofId: record.id }, + }) + } else { + navigation.navigate(Stacks.ContactStack as any, { + screen: Screens.ProofRequestW3C, + params: { proofId: record.id }, + }) + } }) }, } diff --git a/app/screens/Connection.tsx b/app/screens/Connection.tsx index b390f316..049c4481 100644 --- a/app/screens/Connection.tsx +++ b/app/screens/Connection.tsx @@ -11,7 +11,7 @@ import Button, { ButtonType } from '../components/buttons/Button' import { useAnimatedComponents } from '../contexts/animated-components' import { useConfiguration } from '../contexts/configuration' import { useTheme } from '../contexts/theme' -import { useOutOfBandByConnectionId } from '../hooks/connections' +import { useOutOfBandById } from '../hooks/connections' import { useNotifications } from '../hooks/notifications' import { Screens, TabStacks, DeliveryStackParams, Stacks } from '../types/navigators' import { useAppAgent } from '../utils/agent' @@ -35,7 +35,7 @@ const Connection: React.FC = ({ navigation, route }) => { // delay message, the user should be redirected to the home screen. const { connectionTimerDelay, autoRedirectConnectionToHome } = useConfiguration() const connTimerDelay = connectionTimerDelay ?? 10000 // in ms - const { connectionId, threadId } = route.params + const { connectionId, outOfBandId, threadId } = route.params const timerRef = useRef(null) const connection = connectionId ? useConnectionById(connectionId) : undefined const { t } = useTranslation() @@ -43,7 +43,7 @@ const Connection: React.FC = ({ navigation, route }) => { const { ColorPallet, TextTheme } = useTheme() const { ConnectionLoading } = useAnimatedComponents() const { agent } = useAppAgent() - const oobRecord = useOutOfBandByConnectionId(agent, connectionId ?? '') + const oobRecord = useOutOfBandById(agent, outOfBandId ?? '') const goalCode = oobRecord?.outOfBandInvitation.goalCode const merge: MergeFunction = (current, next) => ({ ...current, ...next }) const [state, dispatch] = useReducer(merge, { @@ -52,6 +52,7 @@ const Connection: React.FC = ({ navigation, route }) => { shouldShowDelayMessage: false, connectionIsActive: false, }) + const styles = StyleSheet.create({ container: { height: '100%', @@ -168,7 +169,7 @@ const Connection: React.FC = ({ navigation, route }) => { if (state.notificationRecord && goalCode) { goalCodeAction(goalCode)() } - }, [connection, goalCode, state.notificationRecord]) + }, [connection, oobRecord, goalCode, state.notificationRecord]) useMemo(() => { startTimer() diff --git a/app/screens/CreateWallet.tsx b/app/screens/CreateWallet.tsx index 73c46bdd..9f96732b 100644 --- a/app/screens/CreateWallet.tsx +++ b/app/screens/CreateWallet.tsx @@ -2,7 +2,7 @@ import { useNavigation } from '@react-navigation/core' import React, { useState } from 'react' import { useTranslation } from 'react-i18next' import { View, StyleSheet, Text, Platform, Modal, TouchableOpacity } from 'react-native' -import Icon from 'react-native-vector-icons/FontAwesome' +import Icon from 'react-native-vector-icons/MaterialIcons' import Button, { ButtonType } from '../components/buttons/Button' import { useTheme } from '../contexts/theme' @@ -20,7 +20,9 @@ const CreateWallet: React.FC = () => { const proceedWithRestore = () => { toggleModal() - navigation.navigate(Screens.ImportWalletVerify as never) + setTimeout(() => { + navigation.navigate(Screens.ImportWalletVerify as never) + }, 300) } const styles = StyleSheet.create({ @@ -101,9 +103,7 @@ const CreateWallet: React.FC = () => { {t('Restore.RestoreInstructions')} {Platform.OS === 'ios' && ( - - For iOS users: {t('Restore.RestoreInstructionsIOS')} - + {t('Restore.RestoreInstructionsIOS')} )}