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 5 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
6 changes: 3 additions & 3 deletions packages/mobile/locales/en-US/onboarding.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"loadingBody": "This can take up to 90 seconds"
},
"verificationEducation": {
"title": "Confirm",
"header": "Confirm 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.",
"title": "Phone Number",
"header": "Connect your phone number",
"body": "Connecting takes about three minutes. To confirm your number, you’ll receive three messages.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to keep this text for the fallback version? cc @tarikbellamine

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah good catch. We will want to keep all the old text because both feeless and non-feeless flows will be possible.

"start": "Start",
"resume": "Resume",
"doINeedToConfirm": "Do I need to confirm?",
Expand Down
6 changes: 3 additions & 3 deletions packages/mobile/locales/es-419/onboarding.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"loadingBody": "Esto puede tardar hasta 90 segundos"
},
"verificationEducation": {
"title": "Confirmar",
"header": "Confirmar 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.",
"title": "Número de Teléfono",
"header": "Conectá tu número de teléfono",
"body": "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": "^0.3.1",
"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