From 9e120a0dd0875712bc860c6a26a3d58a7a942c1e Mon Sep 17 00:00:00 2001 From: Ry Jones Date: Mon, 6 Jan 2025 09:45:50 -0800 Subject: [PATCH 1/4] Add Homepage and update repo (#1379) Signed-off-by: Ry Jones --- CODEOWNERS | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index bc10528aca..280c4025af 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,3 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -* @hyperledger/aries-mobile-agent-react-native-committers +* @openwallet-foundation/bifold-wallet-maintainers diff --git a/package.json b/package.json index 4d76e034cc..7edff797c0 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,10 @@ "packages/legacy/app" ], "repository": { - "url": "https://github.com/hyperledger/aries-mobile-agent-react-native", + "url": "https://github.com/openwallet-foundation/bifold-wallet/", "type": "git" }, + "homepage": "https://github.com/openwallet-foundation/bifold-wallet/", "scripts": { "clean": "lerna run clean", "build": "lerna run build", From 16208b6bc8d8a17231e48ed7c26b3f0417cbfdfe Mon Sep 17 00:00:00 2001 From: jian4on <96585781+jian4on@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:53:10 -0500 Subject: [PATCH 2/4] feat: add config attribute to enable/disable contacts section in Settings screen, default as enabled (#1374) Signed-off-by: Jian Wang --- packages/legacy/core/App/container-impl.ts | 1 + packages/legacy/core/App/screens/Settings.tsx | 7 +++- packages/legacy/core/App/types/config.ts | 1 + .../core/__tests__/screens/Settings.test.tsx | 36 +++++++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/packages/legacy/core/App/container-impl.ts b/packages/legacy/core/App/container-impl.ts index f8d6eb84cf..3afd86ac69 100644 --- a/packages/legacy/core/App/container-impl.ts +++ b/packages/legacy/core/App/container-impl.ts @@ -60,6 +60,7 @@ export const defaultConfig: Config = { supportedLanguages: [Locales.en, Locales.fr, Locales.ptBr], showPreface: false, disableOnboardingSkip: false, + disableContactsInSettings: false, whereToUseWalletUrl: 'https://example.com', showScanHelp: true, showScanButton: true, diff --git a/packages/legacy/core/App/screens/Settings.tsx b/packages/legacy/core/App/screens/Settings.tsx index eb80c5fbe8..2fd4f952ce 100644 --- a/packages/legacy/core/App/screens/Settings.tsx +++ b/packages/legacy/core/App/screens/Settings.tsx @@ -35,7 +35,7 @@ const Settings: React.FC = ({ navigation }) => { const [store, dispatch] = useStore() const developerOptionCount = useRef(0) const { SettingsTheme, TextTheme, ColorPallet, Assets } = useTheme() - const [{ settings, enableTours, enablePushNotifications }, historyEnabled] = useServices([ + const [{ settings, enableTours, enablePushNotifications, disableContactsInSettings }, historyEnabled] = useServices([ TOKENS.CONFIG, TOKENS.HISTORY_ENABLED, ]) @@ -167,6 +167,11 @@ const Settings: React.FC = ({ navigation }) => { }, ...(settings || []), ] + + // Remove the Contact section from Setting per TOKENS.CONFIG + if (disableContactsInSettings) { + settingsSections.shift(); + } // add optional push notifications menu to settings if (enablePushNotifications) { diff --git a/packages/legacy/core/App/types/config.ts b/packages/legacy/core/App/types/config.ts index f3d537cdc6..e8317aab6e 100644 --- a/packages/legacy/core/App/types/config.ts +++ b/packages/legacy/core/App/types/config.ts @@ -35,6 +35,7 @@ export interface Config { contactHideList?: string[] contactDetailsOptions?: ContactDetailsOptionsParams credentialHideList?: string[] + disableContactsInSettings?: boolean } export interface HistoryEventsLoggerConfig { diff --git a/packages/legacy/core/__tests__/screens/Settings.test.tsx b/packages/legacy/core/__tests__/screens/Settings.test.tsx index 1c03a55247..0650517132 100644 --- a/packages/legacy/core/__tests__/screens/Settings.test.tsx +++ b/packages/legacy/core/__tests__/screens/Settings.test.tsx @@ -1,12 +1,16 @@ import { useNavigation } from '@react-navigation/native' import { render } from '@testing-library/react-native' import React from 'react' +import { container } from 'tsyringe' import { StoreContext } from '../../App' import Settings from '../../App/screens/Settings' import { testIdWithKey } from '../../App/utils/testable' import { testDefaultState } from '../contexts/store' import { BasicAppContext } from '../helpers/app' +import { CustomBasicAppContext } from '../helpers/app' +import { TOKENS } from '../../App/container-api' +import { MainContainer } from '../../App/container-impl' describe('Settings Screen', () => { beforeEach(() => { @@ -127,4 +131,36 @@ describe('Settings Screen', () => { const proofButton = tree.getByTestId(testIdWithKey('ProofRequests')) expect(proofButton).not.toBeNull() }) + + test('If disableContactsInSettings is true, the Contacts section is not shown', async () => { + const customState = { + ...testDefaultState, + preferences: { + ...testDefaultState.preferences, + developerModeEnabled: true, + walletName: 'My Wallet', + }, + } + + const context = new MainContainer(container.createChildContainer()).init() + const config = context.resolve(TOKENS.CONFIG) + context.container.registerInstance(TOKENS.CONFIG, { ...config, disableContactsInSettings: true}) + + const tree = render( + { + return + }, + ]} + > + + + + + ) + const contactsSection = tree.queryByTestId(testIdWithKey('Contacts')) + expect(contactsSection).toBeNull() + }) }) From 5f9c28d7a29ffa5cd721d19cbf74ec9b020f084e Mon Sep 17 00:00:00 2001 From: Bryce McMath <32586431+bryce-mcmath@users.noreply.github.com> Date: Tue, 7 Jan 2025 09:45:49 -0800 Subject: [PATCH 3/4] feat: add opt-in hidden dev mode trigger to pin enter screen (#1377) Signed-off-by: Bryce McMath --- packages/legacy/core/App/screens/PINEnter.tsx | 30 ++++++++++++++++--- packages/legacy/core/App/types/config.ts | 1 + 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/packages/legacy/core/App/screens/PINEnter.tsx b/packages/legacy/core/App/screens/PINEnter.tsx index 825b092a57..789863cdc2 100644 --- a/packages/legacy/core/App/screens/PINEnter.tsx +++ b/packages/legacy/core/App/screens/PINEnter.tsx @@ -1,7 +1,7 @@ import { useNavigation, CommonActions } from '@react-navigation/native' -import React, { useCallback, useEffect, useState } from 'react' +import React, { useCallback, useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' -import { Keyboard, StyleSheet, Text, View, DeviceEventEmitter, InteractionManager } from 'react-native' +import { Keyboard, StyleSheet, Text, View, DeviceEventEmitter, InteractionManager, Pressable } from 'react-native' import Button, { ButtonType } from '../components/buttons/Button' import PINInput from '../components/inputs/PINInput' @@ -50,7 +50,9 @@ const PINEnter: React.FC = ({ setAuthenticated, usage = PINEntryU const [biometricsEnrollmentChange, setBiometricsEnrollmentChange] = useState(false) const { ColorPallet, TextTheme, Assets, PINEnterTheme } = useTheme() const { ButtonLoading } = useAnimatedComponents() - const [logger] = useServices([TOKENS.UTIL_LOGGER]) + const [logger, { enableHiddenDevModeTrigger }] = useServices([TOKENS.UTIL_LOGGER, TOKENS.CONFIG]) + const developerOptionCount = useRef(0) + const touchCountToEnableBiometrics = 9 const [inlineMessageField, setInlineMessageField] = useState() const [inlineMessages] = useServices([TOKENS.INLINE_ERRORS]) const [alertModalMessage, setAlertModalMessage] = useState('') @@ -104,6 +106,20 @@ const PINEnter: React.FC = ({ setAuthenticated, usage = PINEntryU }, }) + const incrementDeveloperMenuCounter = useCallback(() => { + if (developerOptionCount.current >= touchCountToEnableBiometrics) { + developerOptionCount.current = 0 + dispatch({ + type: DispatchAction.ENABLE_DEVELOPER_MODE, + payload: [true], + }) + navigation.navigate(Screens.Developer as never) + return + } + + developerOptionCount.current = developerOptionCount.current + 1 + }, [dispatch, navigation]) + const gotoPostAuthScreens = useCallback(() => { if (store.onboarding.postAuthScreens.length) { const screen = store.onboarding.postAuthScreens[0] @@ -461,7 +477,13 @@ const PINEnter: React.FC = ({ setAuthenticated, usage = PINEntryU - {displayHelpText()} + {usage === PINEntryUsage.WalletUnlock && enableHiddenDevModeTrigger ? ( + + {displayHelpText()} + + ) : ( + displayHelpText() + )} {t('PINEnter.EnterPIN')} { diff --git a/packages/legacy/core/App/types/config.ts b/packages/legacy/core/App/types/config.ts index e8317aab6e..b3c2224cd2 100644 --- a/packages/legacy/core/App/types/config.ts +++ b/packages/legacy/core/App/types/config.ts @@ -23,6 +23,7 @@ export interface Config { enableTours?: boolean enableImplicitInvitations?: boolean enableReuseConnections?: boolean + enableHiddenDevModeTrigger?: boolean showPreface?: boolean showPINExplainer?: boolean disableOnboardingSkip?: boolean From f72c911cb80117e784397c2d45bed5e38e4f817c Mon Sep 17 00:00:00 2001 From: "Jason C. Leach" Date: Tue, 7 Jan 2025 10:39:45 -0800 Subject: [PATCH 4/4] fix: trigger build (#1381) Signed-off-by: Jason C. Leach --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 801d9c73be..1df9de52c5 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,8 @@ To better understand the technical aspects of the Bifold project including how t The organizations or jurisdictions listed below have either deployed a project based on Bifold, are currently assessing the technology, or are actively developing a solution. If you want your organization to be included in this list, please submit a Pull Request against this README.md. - [BC Wallet](https://apps.apple.com/us/app/bc-wallet/id1587380443) - The BC Wallet is a digital wallet app developed by the Government of British Columbia. + +The BC Wallet is a digital wallet app developed by the Government of British Columbia. [contributor-guide]: ./CONTRIBUTING [developers-guide]: ./DEVELOPER.md