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

[Wallet] Add reCaptcha verification behind feature flag #5630

Merged
merged 19 commits into from
Oct 31, 2020
Merged
Show file tree
Hide file tree
Changes from 7 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
3 changes: 3 additions & 0 deletions packages/mobile/android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this file looks weird, it's because of SafetyNet. It depends on react-native-securerandom which doesn't support automatic linking, and when doing it manually it threw an error because this file was missing.

This manual linking is the reason for the changes to the settings.gradle and the Podfile as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would love to fork/fix/upstream after wednesday as good citizens of the open source world

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I like doing that sort of stuff too, but the maintainers don't seem very active. The first reason I had to fork was to add support for AndroidX since it was failing for that reason. There's a PR that adds that from almost a year ago: rajivshah3/react-native-google-safetynet#283 which has this message:

Thanks for the PR! I can review and investigate the build failure in a few days when I have some time

(December 2019)

<resources>
</resources>
2 changes: 2 additions & 0 deletions packages/mobile/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
rootProject.name = 'celo'
include ':react-native-securerandom'
project(':react-native-securerandom').projectDir = new File(rootProject.projectDir, '../../../node_modules/react-native-securerandom/android')
apply from: file("../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
1 change: 1 addition & 0 deletions packages/mobile/branding/celo/src/brandingConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const APP_NAME = 'Celo Wallet'
export const WEB_LINK = 'https://celo.org/'
export const CELO_FAUCET_LINK = 'https://celo.org/developers/wallet'
export const CELO_TERMS_LINK = 'https://celo.org/terms'
export const TOS_LINK = 'https://celo.org/user-agreement'
Expand Down
2 changes: 2 additions & 0 deletions packages/mobile/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ target "celo" do
permissions_path = '../../../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"

pod 'RNSecureRandom', :path => '../../../node_modules/react-native-securerandom'

target "celoTests" do
inherit! :search_paths
end
Expand Down
8 changes: 7 additions & 1 deletion packages/mobile/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,8 @@ PODS:
- React
- RNScreens (2.7.0):
- React
- RNSecureRandom (1.0.0):
- React
- RNSentry (1.7.1):
- React
- Sentry (~> 5.2.0)
Expand Down Expand Up @@ -568,6 +570,7 @@ DEPENDENCIES:
- RNPermissions (from `../../../node_modules/react-native-permissions`)
- RNReanimated (from `../../../node_modules/react-native-reanimated`)
- RNScreens (from `../../../node_modules/react-native-screens`)
- RNSecureRandom (from `../../../node_modules/react-native-securerandom`)
- "RNSentry (from `../../../node_modules/@sentry/react-native`)"
- RNShare (from `../../../node_modules/react-native-share`)
- RNSVG (from `../../../node_modules/react-native-svg`)
Expand Down Expand Up @@ -738,6 +741,8 @@ EXTERNAL SOURCES:
:path: "../../../node_modules/react-native-reanimated"
RNScreens:
:path: "../../../node_modules/react-native-screens"
RNSecureRandom:
:path: "../../../node_modules/react-native-securerandom"
RNSentry:
:path: "../../../node_modules/@sentry/react-native"
RNShare:
Expand Down Expand Up @@ -839,6 +844,7 @@ SPEC CHECKSUMS:
RNPermissions: ad71dd4f767ec254f2cd57592fbee02afee75467
RNReanimated: dd8c286ab5dd4ba36d3a7fef8bff7e08711b5476
RNScreens: cf198f915f8a2bf163de94ca9f5bfc8d326c3706
RNSecureRandom: 0dcee021fdb3d50cd5cee5db0ebf583c42f5af0e
RNSentry: 2bae4ffee2e66376ef42cb845a494c3bde17bc56
RNShare: fea1801315aa8875d6db73a4010b14afcd568765
RNSVG: ce9d996113475209013317e48b05c21ee988d42e
Expand All @@ -847,6 +853,6 @@ SPEC CHECKSUMS:
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
Yoga: 3ebccbdd559724312790e7742142d062476b698e

PODFILE CHECKSUM: 470c646f25b89e063843bdec1cd889a649b38781
PODFILE CHECKSUM: e38c669823181b25b0d68e1d32554a4d8041b562

COCOAPODS: 1.9.1
2 changes: 2 additions & 0 deletions packages/mobile/ios/celo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@
"${BUILT_PRODUCTS_DIR}/RNReanimated/RNReanimated.framework",
"${BUILT_PRODUCTS_DIR}/RNSVG/RNSVG.framework",
"${BUILT_PRODUCTS_DIR}/RNScreens/RNScreens.framework",
"${BUILT_PRODUCTS_DIR}/RNSecureRandom/RNSecureRandom.framework",
"${BUILT_PRODUCTS_DIR}/RNSentry/RNSentry.framework",
"${BUILT_PRODUCTS_DIR}/RNShare/RNShare.framework",
"${BUILT_PRODUCTS_DIR}/React-Core/React.framework",
Expand Down Expand Up @@ -586,6 +587,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNReanimated.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNSVG.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNScreens.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNSecureRandom.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNSentry.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNShare.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/React.framework",
Expand Down
5 changes: 3 additions & 2 deletions packages/mobile/locales/en-US/onboarding.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@
"loadingBody": "This can take up to 90 seconds"
},
"verificationEducation": {
"title": "Confirm",
"header": "Confirm phone number",
"title": "Phone Number",
"header": "Connect your phone number",
"body": "To make sure your number is really yours, we’re going to send you three messages that will cost about 0.05 cUSD each.\n\nConfirming your number takes about three minutes.",
"feelessBody": "Connecting takes about three minutes. To confirm your number, you’ll receive three messages.",
"start": "Start",
"resume": "Resume",
"doINeedToConfirm": "Do I need to confirm?",
Expand Down
5 changes: 3 additions & 2 deletions packages/mobile/locales/es-419/onboarding.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@
"loadingBody": "Esto puede tardar hasta 90 segundos"
},
"verificationEducation": {
"title": "Confirmar",
"header": "Confirmar número de teléfono",
"title": "Número de Teléfono",
"header": "Conectá tu número de teléfono",
"body": "Para asegurarnos de que tu número sea realmente tuyo, te enviaremos tres mensajes de texto que costarán alrededor de 0.05 cUSD cada uno.\n\nConfirmar tu número tomará unos tres minutos.",
"feelessBody": "Confirmar tu número tomará unos tres minutos. Para confirmar tu número, recibirás tres mensajes.",
"start": "Comenzar",
"resume": "Reanudar",
"doINeedToConfirm": "¿Necesito confirmar?",
Expand Down
2 changes: 2 additions & 0 deletions packages/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"react-native-fs": "^2.16.6",
"react-native-gesture-handler": "^1.6.1",
"react-native-geth": "https://github.com/celo-org/react-native-geth#5864c09",
"react-native-google-safetynet": "https://github.com/celo-org/react-native-google-safetynet#e698d70",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if you created a PR to get this upstreamed - but usually nice to do

"react-native-keep-awake": "^4.0.0",
"react-native-keyboard-aware-scroll-view": "^0.9.1",
"react-native-keychain": "6.0.0",
Expand All @@ -120,6 +121,7 @@
"react-native-restart-android": "^0.0.7",
"react-native-safe-area-context": "^3.0.6",
"react-native-screens": "^2.7.0",
"react-native-securerandom": "^1.0.0",
"react-native-secure-randombytes": "^3.0.2",
"react-native-send-intent": "git+https://github.com/celo-org/react-native-send-intent#a0f4b00",
"react-native-share": "^3.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/scripts/sync_branding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ echo $mobile_root
cd "$mobile_root"

# Please update the sha when valora branding updates are needed
valora_branding_sha=c8f6b4b
valora_branding_sha=cd51906

if [[ "$branding" == "valora" ]]; then
# prevents git from asking credentials
Expand Down
Binary file modified packages/mobile/secrets.json.enc
Binary file not shown.
6 changes: 6 additions & 0 deletions packages/mobile/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ export const MOONPAY_PUBLIC_KEY = keyOrUndefined(
Config.SECRETS_KEY,
'MOONPAY_PUBLIC_KEY'
)
export const RECAPTCHA_SITE_KEY = keyOrUndefined(
secretsFile,
Config.SECRETS_KEY,
'RECAPTCHA_SITE_KEY'
)
export const SAFETYNET_KEY = keyOrUndefined(secretsFile, Config.SECRETS_KEY, 'SAFETYNET_KEY')
export const MOONPAY_RATE_API = `https://api.moonpay.io/v3/currencies/celo/price?apiKey=${MOONPAY_PUBLIC_KEY}`

export const EXCHANGE_PROVIDER_LINKS: ExternalExchangeProvider[] = [
Expand Down
1 change: 1 addition & 0 deletions packages/mobile/src/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const features = {
SHOW_CASH_OUT: false,
PNP_USE_DEK_FOR_AUTH: true,
USE_PHONE_NUMBER_PRIVACY: true,
KOMENCI: false,
}

export const pausedFeatures = {
Expand Down
1 change: 1 addition & 0 deletions packages/mobile/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ declare module 'react-native-clock-sync'
declare module 'react-native-crypto'
declare module 'react-native-bip39'
declare module 'react-native-flag-secure-android'
declare module 'react-native-google-safetynet'
declare module 'svgs'
declare module 'react-native-languages'
declare module 'react-native-version-check'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ exports[`NameAndNumberScreen renders correctly 1`] = `
<TextInput
allowFontScaling={true}
countryCallingCode="+1"
editable={true}
keyboardType="phone-pad"
onBlur={[Function]}
onChangeText={[Function]}
Expand Down Expand Up @@ -670,6 +671,7 @@ exports[`NameAndNumberScreen renders with an error 1`] = `
<TextInput
allowFontScaling={true}
countryCallingCode="+1"
editable={true}
keyboardType="phone-pad"
onBlur={[Function]}
onChangeText={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,26 @@ exports[`TransferConfirmationCard renders correctly for CELO withdrawal transact
</svg>
</View>
</View>
<Text
<View
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes are due to the change to the implementation of Expandable. It changes nothing visually, it's just wrapping the Text with a View.

style={
Object {
"color": "#9CA4A9",
"fontFamily": "Inter-Regular",
"fontSize": 14,
"lineHeight": 18,
"marginRight": 7,
"alignItems": "center",
"flexDirection": "row",
}
}
/>
>
<Text
style={
Object {
"color": "#9CA4A9",
"fontFamily": "Inter-Regular",
"fontSize": 14,
"lineHeight": 18,
"marginRight": 7,
}
}
/>
</View>
</View>
</View>
<View
Expand Down Expand Up @@ -1027,17 +1036,26 @@ exports[`TransferConfirmationCard renders correctly for received escrow transact
</svg>
</View>
</View>
<Text
<View
style={
Object {
"color": "#9CA4A9",
"fontFamily": "Inter-Regular",
"fontSize": 14,
"lineHeight": 18,
"marginRight": 7,
"alignItems": "center",
"flexDirection": "row",
}
}
/>
>
<Text
style={
Object {
"color": "#9CA4A9",
"fontFamily": "Inter-Regular",
"fontSize": 14,
"lineHeight": 18,
"marginRight": 7,
}
}
/>
</View>
</View>
</View>
<View
Expand Down Expand Up @@ -1494,17 +1512,26 @@ exports[`TransferConfirmationCard renders correctly for received transaction dri
</svg>
</View>
</View>
<Text
<View
style={
Object {
"color": "#9CA4A9",
"fontFamily": "Inter-Regular",
"fontSize": 14,
"lineHeight": 18,
"marginRight": 7,
"alignItems": "center",
"flexDirection": "row",
}
}
/>
>
<Text
style={
Object {
"color": "#9CA4A9",
"fontFamily": "Inter-Regular",
"fontSize": 14,
"lineHeight": 18,
"marginRight": 7,
}
}
/>
</View>
</View>
</View>
<View
Expand Down Expand Up @@ -1961,17 +1988,26 @@ exports[`TransferConfirmationCard renders correctly for sent escrow transaction
</svg>
</View>
</View>
<Text
<View
style={
Object {
"color": "#9CA4A9",
"fontFamily": "Inter-Regular",
"fontSize": 14,
"lineHeight": 18,
"marginRight": 7,
"alignItems": "center",
"flexDirection": "row",
}
}
/>
>
<Text
style={
Object {
"color": "#9CA4A9",
"fontFamily": "Inter-Regular",
"fontSize": 14,
"lineHeight": 18,
"marginRight": 7,
}
}
/>
</View>
</View>
</View>
<View
Expand Down Expand Up @@ -2673,17 +2709,26 @@ exports[`TransferConfirmationCard renders correctly for sent transaction drilldo
</svg>
</View>
</View>
<Text
<View
style={
Object {
"color": "#9CA4A9",
"fontFamily": "Inter-Regular",
"fontSize": 14,
"lineHeight": 18,
"marginRight": 7,
"alignItems": "center",
"flexDirection": "row",
}
}
/>
>
<Text
style={
Object {
"color": "#9CA4A9",
"fontFamily": "Inter-Regular",
"fontSize": 14,
"lineHeight": 18,
"marginRight": 7,
}
}
/>
</View>
</View>
</View>
<View
Expand Down
Loading