Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): react-native-keychain upgrade + migrate to @interaxyz fork #6470

Merged
merged 7 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ const keychainMock = {
SECURE_HARDWARE: 'SECURE_HARDWARE',
ANY: 'ANY',
},
STORAGE_TYPE: {
FB: 'MOCK_FacebookConceal',
AES: 'MOCK_KeystoreAESCBC',
AES_CBC: 'MOCK_KeystoreAESCBC',
AES_GCM_NO_AUTH: 'MOCK_KeystoreAESGCM_NoAuth',
AES_GCM: 'MOCK_KeystoreAESGCM',
RSA: 'MOCK_KeystoreRSAECB',
},
setGenericPassword: jest.fn(async (username, password, options) => {
mockedItems.set(options.service, { username, password, options })
return true
Expand Down
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
apply plugin: 'kotlin-android'

import com.android.build.OutputFile
import groovy.json.JsonSlurper
Expand Down
9 changes: 5 additions & 4 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,8 @@ PODS:
- RNGestureHandler (2.21.2):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- RNKeychain (8.2.0):
- RNKeychain (9.2.2):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- RNLocalize (3.3.0):
- React-Core
Expand Down Expand Up @@ -947,7 +948,7 @@ DEPENDENCIES:
- "RNFBRemoteConfig (from `../node_modules/@react-native-firebase/remote-config`)"
- RNFS (from `../node_modules/react-native-fs`)
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNKeychain (from `../node_modules/react-native-keychain`)
- "RNKeychain (from `../node_modules/@interaxyz/react-native-keychain`)"
- RNLocalize (from `../node_modules/react-native-localize`)
- RNPermissions (from `../node_modules/react-native-permissions`)
- RNPersonaInquiry2 (from `../node_modules/react-native-persona`)
Expand Down Expand Up @@ -1170,7 +1171,7 @@ EXTERNAL SOURCES:
RNGestureHandler:
:path: "../node_modules/react-native-gesture-handler"
RNKeychain:
:path: "../node_modules/react-native-keychain"
:path: "../node_modules/@interaxyz/react-native-keychain"
RNLocalize:
:path: "../node_modules/react-native-localize"
RNPermissions:
Expand Down Expand Up @@ -1317,7 +1318,7 @@ SPEC CHECKSUMS:
RNFBRemoteConfig: 1c92f072b1772b91663247b07a711cd4e9e191e8
RNFS: 89de7d7f4c0f6bafa05343c578f61118c8282ed8
RNGestureHandler: b81313e62e717cc165ea3b99436aa305d04c57b4
RNKeychain: bbe2f6d5cc008920324acb49ef86ccc03d3b38e4
RNKeychain: 91dc223bc77e3bb8576a3c75cdd28863bc2cb26e
RNLocalize: d024afa9204c13885e61dc88b8190651bcaabac9
RNPermissions: 1d002266e43df33d7080d5355a64b7d12bdb5e75
RNPersonaInquiry2: 4202f797d7a172af2908f271954123858abe47bf
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"@fiatconnect/fiatconnect-types": "^13.3.10",
"@gorhom/bottom-sheet": "^5.0.6",
"@interaxyz/react-navigation-bottom-sheet": "^0.3.2",
"@interaxyz/react-native-keychain": "^9.2.2",
"@interaxyz/react-native-webview": "^13.13.4",
"@json-rpc-tools/utils": "^1.7.6",
"@noble/secp256k1": "^1.7.1",
Expand Down Expand Up @@ -149,7 +150,6 @@
"react-native-gesture-handler": "^2.21.2",
"react-native-haptic-feedback": "^2.3.3",
"react-native-in-app-review": "^4.3.3",
"react-native-keychain": "^8.2.0",
"react-native-launch-arguments": "^4.0.2",
"react-native-linear-gradient": "^2.8.3",
"react-native-localize": "^3.3.0",
Expand Down
13 changes: 0 additions & 13 deletions patches/react-native-keychain+8.2.0.patch

This file was deleted.

12 changes: 6 additions & 6 deletions src/account/ProfileSubmenu.test.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import * as Keychain from '@interaxyz/react-native-keychain'
import { act, fireEvent, render, waitFor } from '@testing-library/react-native'
import { FetchMock } from 'jest-fetch-mock/types'
import * as React from 'react'
import 'react-native'
import { Provider } from 'react-redux'
import ProfileSubmenu from 'src/account/ProfileSubmenu'
import { Screens } from 'src/navigator/Screens'
import Logger from 'src/utils/Logger'
import networkConfig from 'src/web3/networkConfig'
import MockedNavigator from 'test/MockedNavigator'
import { FetchMock } from 'jest-fetch-mock/types'
import { createMockStore, getMockStackScreenProps } from 'test/utils'
import { mockE164Number } from 'test/values'
import networkConfig from 'src/web3/networkConfig'
import { act, fireEvent, render, waitFor } from '@testing-library/react-native'
import * as Keychain from 'react-native-keychain'
const mockFetch = fetch as FetchMock
const mockedKeychain = jest.mocked(Keychain)
import Logger from 'src/utils/Logger'

jest.mock('src/utils/Logger')

mockedKeychain.getGenericPassword.mockResolvedValue({
username: 'some username',
password: 'someSignedMessage',
service: 'some service',
storage: 'some string',
storage: Keychain.STORAGE_TYPE.RSA,
})

describe('ProfileSubmenu', () => {
Expand Down
32 changes: 16 additions & 16 deletions src/account/SecuritySubmenu.test.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import * as Keychain from '@interaxyz/react-native-keychain'
import { BIOMETRY_TYPE } from '@interaxyz/react-native-keychain'
import { act, fireEvent, render, waitFor } from '@testing-library/react-native'
import { FetchMock } from 'jest-fetch-mock/types'
import * as React from 'react'
import 'react-native'
import { Provider } from 'react-redux'
import SecuritySubmenu from 'src/account/SecuritySubmenu'
import { Screens } from 'src/navigator/Screens'
import MockedNavigator from 'test/MockedNavigator'
import { createMockStore } from 'test/utils'
import { fireEvent, render, waitFor, act } from '@testing-library/react-native'
import { ensurePincode, navigate } from 'src/navigator/NavigationService'
import { FetchMock } from 'jest-fetch-mock/types'
import * as Keychain from 'react-native-keychain'
import { setAnalyticsEnabled } from 'src/app/actions'
import { showError } from 'src/alert/actions'
import { ErrorMessages } from 'src/app/ErrorMessages'
import { setPincodeSuccess } from 'src/account/actions'
import { mockE164Number } from 'test/values'
import { BIOMETRY_TYPE } from 'react-native-keychain'
import { PincodeType } from 'src/account/reducer'
import { removeStoredPin, setPincodeWithBiometry } from 'src/pincode/authentication'
import SecuritySubmenu from 'src/account/SecuritySubmenu'
import { showError } from 'src/alert/actions'
import AppAnalytics from 'src/analytics/AppAnalytics'
import { SettingsEvents } from 'src/analytics/Events'
import { getFeatureGate } from 'src/statsig/index'
import { setAnalyticsEnabled } from 'src/app/actions'
import { ErrorMessages } from 'src/app/ErrorMessages'
import { deleteKeylessBackupStarted, hideDeleteKeylessBackupError } from 'src/keylessBackup/slice'
import { KeylessBackupDeleteStatus } from 'src/keylessBackup/types'
import { ensurePincode, navigate } from 'src/navigator/NavigationService'
import { Screens } from 'src/navigator/Screens'
import { removeStoredPin, setPincodeWithBiometry } from 'src/pincode/authentication'
import { getFeatureGate } from 'src/statsig/index'
import networkConfig from 'src/web3/networkConfig'
import MockedNavigator from 'test/MockedNavigator'
import { createMockStore } from 'test/utils'
import { mockE164Number } from 'test/values'

const mockedEnsurePincode = jest.mocked(ensurePincode)
const mockFetch = fetch as FetchMock
Expand All @@ -31,7 +31,7 @@ mockedKeychain.getGenericPassword.mockResolvedValue({
username: 'some username',
password: 'someSignedMessage',
service: 'some service',
storage: 'some string',
storage: Keychain.STORAGE_TYPE.RSA,
})

jest.mock('src/analytics/AppAnalytics')
Expand Down
4 changes: 2 additions & 2 deletions src/account/saga.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Keychain from '@interaxyz/react-native-keychain'
import { FetchMock } from 'jest-fetch-mock/types'
import * as Keychain from 'react-native-keychain'
import { expectSaga } from 'redux-saga-test-plan'
import * as matchers from 'redux-saga-test-plan/matchers'
import { throwError } from 'redux-saga-test-plan/providers'
Expand Down Expand Up @@ -103,7 +103,7 @@ describe('generateSignedMessage', () => {
username: 'some username',
password: 'someSignedMessage',
service: 'some service',
storage: 'some string',
storage: Keychain.STORAGE_TYPE.RSA,
})

await expectSaga(generateSignedMessage)
Expand Down
2 changes: 1 addition & 1 deletion src/app/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BIOMETRY_TYPE } from 'react-native-keychain'
import { BIOMETRY_TYPE } from '@interaxyz/react-native-keychain'
import { RemoteConfigValues } from 'src/app/saga'
import { Screens } from 'src/navigator/Screens'

Expand Down
2 changes: 1 addition & 1 deletion src/app/reducers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BIOMETRY_TYPE } from '@interaxyz/react-native-keychain'
import { Platform } from 'react-native'
import { BIOMETRY_TYPE } from 'react-native-keychain'
import { Actions, ActionTypes, AppState } from 'src/app/actions'
import { CeloNewsConfig } from 'src/celoNews/types'
import { DEEP_LINK_URL_SCHEME } from 'src/config'
Expand Down
2 changes: 1 addition & 1 deletion src/app/saga.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BIOMETRY_TYPE } from 'react-native-keychain'
import { BIOMETRY_TYPE } from '@interaxyz/react-native-keychain'
import * as RNLocalize from 'react-native-localize'
import { expectSaga } from 'redux-saga-test-plan'
import * as matchers from 'redux-saga-test-plan/matchers'
Expand Down
2 changes: 1 addition & 1 deletion src/app/saga.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as Keychain from '@interaxyz/react-native-keychain'
import locales from 'locales'
import { AppState, Platform } from 'react-native'
import DeviceInfo from 'react-native-device-info'
import InAppReview from 'react-native-in-app-review'
import * as Keychain from 'react-native-keychain'
import { findBestLanguageTag } from 'react-native-localize'
import { eventChannel } from 'redux-saga'
import AppAnalytics from 'src/analytics/AppAnalytics'
Expand Down
2 changes: 1 addition & 1 deletion src/backup/BackupPhrase.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Keychain from '@interaxyz/react-native-keychain'
import { fireEvent, render } from '@testing-library/react-native'
import * as React from 'react'
import 'react-native'
import * as Keychain from 'react-native-keychain'
import { Provider } from 'react-redux'
import BackupPhrase from 'src/backup/BackupPhrase'
import { navigate } from 'src/navigator/NavigationService'
Expand Down
4 changes: 2 additions & 2 deletions src/onboarding/registration/EnableBiometry.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { BIOMETRY_TYPE } from '@interaxyz/react-native-keychain'
import { act, fireEvent, render } from '@testing-library/react-native'
import * as React from 'react'
import { BIOMETRY_TYPE } from 'react-native-keychain'
import { Provider } from 'react-redux'
import { setPincodeSuccess } from 'src/account/actions'
import { PincodeType } from 'src/account/reducer'
import { OnboardingEvents } from 'src/analytics/Events'
import AppAnalytics from 'src/analytics/AppAnalytics'
import { OnboardingEvents } from 'src/analytics/Events'
import { Screens } from 'src/navigator/Screens'
import EnableBiometry from 'src/onboarding/registration/EnableBiometry'
import { goToNextOnboardingScreen } from 'src/onboarding/steps'
Expand Down
2 changes: 1 addition & 1 deletion src/onboarding/registration/EnableBiometry.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as Keychain from '@interaxyz/react-native-keychain'
import { useHeaderHeight } from '@react-navigation/elements'
import { NativeStackScreenProps } from '@react-navigation/native-stack'
import React, { useEffect, useLayoutEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { Image, ScrollView, StyleSheet, Text, View } from 'react-native'
import * as Keychain from 'react-native-keychain'
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context'
import { setPincodeSuccess } from 'src/account/actions'
import { PincodeType } from 'src/account/reducer'
Expand Down
2 changes: 1 addition & 1 deletion src/onboarding/steps.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BIOMETRY_TYPE } from 'react-native-keychain'
import { BIOMETRY_TYPE } from '@interaxyz/react-native-keychain'
import { initializeAccount } from 'src/account/actions'
import { KeylessBackupFlow } from 'src/keylessBackup/types'
import { navigate, navigateClearingStack, popToScreen } from 'src/navigator/NavigationService'
Expand Down
2 changes: 1 addition & 1 deletion src/onboarding/steps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BIOMETRY_TYPE } from 'react-native-keychain'
import { BIOMETRY_TYPE } from '@interaxyz/react-native-keychain'
import { createSelector } from 'reselect'
import { initializeAccount } from 'src/account/actions'
import {
Expand Down
2 changes: 1 addition & 1 deletion src/pincode/PincodeLock.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BIOMETRY_TYPE } from '@interaxyz/react-native-keychain'
import { act, fireEvent, render, waitFor } from '@testing-library/react-native'
import * as React from 'react'
import { BIOMETRY_TYPE } from 'react-native-keychain'
import { Provider } from 'react-redux'
import { PincodeType } from 'src/account/reducer'
import { appUnlock } from 'src/app/actions'
Expand Down
2 changes: 1 addition & 1 deletion src/pincode/PincodeSet.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* This is a reactnavigation SCREEN, which we use to set a PIN.
*/
import { BIOMETRY_TYPE } from '@interaxyz/react-native-keychain'
import { NativeStackScreenProps } from '@react-navigation/native-stack'
import * as React from 'react'
import { WithTranslation } from 'react-i18next'
import { StyleSheet } from 'react-native'
import { BIOMETRY_TYPE } from 'react-native-keychain'
import { SafeAreaView } from 'react-native-safe-area-context'
import { connect } from 'react-redux'
import { initializeAccount, setPincodeSuccess } from 'src/account/actions'
Expand Down
Loading