diff --git a/ios/patching/020-social-app-ios-bypass-age-assurance.patch b/ios/patching/020-social-app-ios-bypass-age-assurance.patch index 9eca21d..b463685 100644 --- a/ios/patching/020-social-app-ios-bypass-age-assurance.patch +++ b/ios/patching/020-social-app-ios-bypass-age-assurance.patch @@ -1,17 +1,22 @@ diff --git a/src/ageAssurance/index.tsx b/src/ageAssurance/index.tsx -index 9a0a9c9d5..5a6563e52 100644 --- a/src/ageAssurance/index.tsx +++ b/src/ageAssurance/index.tsx -@@ -88,19 +88,16 @@ function InnerProvider({children}: {children: React.ReactNode}) { +@@ -90,25 +90,16 @@ function InnerProvider({children}: {children: React.ReactNode}) { return ( { - const chatDisabled = state.access !== AgeAssuranceAccess.Full -- const isUnderage = data?.birthdate -- ? isUserUnderAdultAge(data.birthdate) +- const isUnderAdultAge = data?.birthdate +- ? isUnderAge(data.birthdate, 18) - : true +- const isOverRegionMinAccessAge = data?.birthdate +- ? !isUnderAge(data.birthdate, config.minAccessAge) +- : false +- const isOverAppMinAccessAge = data?.birthdate +- ? !isUnderAge(data.birthdate, MIN_ACCESS_AGE) +- : false - const adultContentDisabled = -- state.access !== AgeAssuranceAccess.Full || isUnderage +- state.access !== AgeAssuranceAccess.Full || isUnderAdultAge return { Access: AgeAssuranceAccess, Status: AgeAssuranceStatus, @@ -23,8 +28,12 @@ index 9a0a9c9d5..5a6563e52 100644 flags: { - adultContentDisabled, - chatDisabled, +- isOverRegionMinAccessAge, +- isOverAppMinAccessAge, + adultContentDisabled: false, + chatDisabled: false, ++ isOverRegionMinAccessAge: true, ++ isOverAppMinAccessAge: true, }, } - }, [state, data])}> + }, [state, data, config])}> diff --git a/ios/patching/027-social-app-ios-remove-birthdate.patch b/ios/patching/027-social-app-ios-remove-birthdate.patch index 4e2fc17..44c4f2a 100644 --- a/ios/patching/027-social-app-ios-remove-birthdate.patch +++ b/ios/patching/027-social-app-ios-remove-birthdate.patch @@ -1,23 +1,37 @@ -diff --git a/src/screens/Signup/StepInfo/index.tsx b/src/screens/Signup/StepInfo/index.tsx --- a/src/screens/Signup/StepInfo/index.tsx +++ b/src/screens/Signup/StepInfo/index.tsx -@@ -7,11 +7,9 @@ - - import {isEmailMaybeInvalid} from '#/lib/strings/email' +@@ -9,44 +9,17 @@ import {logger} from '#/logger' --import {is13, is18, useSignupContext} from '#/screens/Signup/state' -+import {useSignupContext} from '#/screens/Signup/state' - import {Policies} from '#/screens/Signup/StepInfo/Policies' + import {isNative} from '#/platform/detection' + import {useSignupContext} from '#/screens/Signup/state' +-import {Policies} from '#/screens/Signup/StepInfo/Policies' import {atoms as a, native} from '#/alf' +-import * as Admonition from '#/components/Admonition' +-import * as Dialog from '#/components/Dialog' +-import {DeviceLocationRequestDialog} from '#/components/dialogs/DeviceLocationRequestDialog' -import * as DateField from '#/components/forms/DateField' -import {type DateFieldRef} from '#/components/forms/DateField/types' import {FormError} from '#/components/forms/FormError' import {HostingProvider} from '#/components/forms/HostingProvider' import * as TextField from '#/components/forms/TextField' -@@ -22,16 +20,6 @@ + import {Envelope_Stroke2_Corner0_Rounded as Envelope} from '#/components/icons/Envelope' + import {Lock_Stroke2_Corner0_Rounded as Lock} from '#/components/icons/Lock' + import {Ticket_Stroke2_Corner0_Rounded as Ticket} from '#/components/icons/Ticket' +-import {createStaticClick, SimpleInlineLinkText} from '#/components/Link' + import {Loader} from '#/components/Loader' import {usePreemptivelyCompleteActivePolicyUpdate} from '#/components/PolicyUpdateOverlay/usePreemptivelyCompleteActivePolicyUpdate' +-import * as Toast from '#/components/Toast' +-import { +- isUnderAge, +- MIN_ACCESS_AGE, +- useAgeAssuranceRegionConfigWithFallback, +-} from '#/ageAssurance/util' +-import { +- useDeviceGeolocationApi, +- useIsDeviceGeolocationGranted, +-} from '#/geolocation' import {BackNextButtons} from '../BackNextButtons' - + -function sanitizeDate(date: Date): Date { - if (!date || date.toString() === 'Invalid Date') { - logger.error(`Create account: handled invalid date for birthDate`, { @@ -31,26 +45,40 @@ diff --git a/src/screens/Signup/StepInfo/index.tsx b/src/screens/Signup/StepInfo export function StepInfo({ onPressBack, isServerError, -@@ -55,7 +43,6 @@ - +@@ -70,21 +43,6 @@ + const emailInputRef = useRef(null) const passwordInputRef = useRef(null) - const birthdateInputRef = useRef(null) - +- +- const aaRegionConfig = useAgeAssuranceRegionConfigWithFallback() +- const {setDeviceGeolocation} = useDeviceGeolocationApi() +- const locationControl = Dialog.useDialogControl() +- const isOverRegionMinAccessAge = state.dateOfBirth +- ? !isUnderAge(state.dateOfBirth.toISOString(), aaRegionConfig.minAccessAge) +- : true +- const isOverAppMinAccessAge = state.dateOfBirth +- ? !isUnderAge(state.dateOfBirth.toISOString(), MIN_ACCESS_AGE) +- : true +- const isOverMinAdultAge = state.dateOfBirth +- ? !isUnderAge(state.dateOfBirth.toISOString(), 18) +- : true +- const isDeviceGeolocationGranted = useIsDeviceGeolocationGranted() + const [hasWarnedEmail, setHasWarnedEmail] = React.useState(false) - -@@ -76,10 +63,6 @@ + +@@ -105,10 +63,6 @@ const emailChanged = prevEmailValueRef.current !== email const password = passwordValueRef.current - -- if (!is13(state.dateOfBirth)) { + +- if (!isOverRegionMinAccessAge) { - return - } - if (state.serviceDescription?.inviteCodeRequired && !inviteCode) { return dispatch({ type: 'setError', -@@ -246,44 +229,21 @@ +@@ -275,107 +229,16 @@ secureTextEntry autoComplete="new-password" autoCapitalize="none" @@ -83,18 +111,79 @@ diff --git a/src/screens/Signup/StepInfo/index.tsx b/src/screens/Signup/StepInfo - maximumDate={new Date()} - /> - - +- +- +- +- +- {!isOverRegionMinAccessAge || !isOverAppMinAccessAge ? ( +- +- +- +- +- +- {!isOverAppMinAccessAge ? ( +- +- You must be {MIN_ACCESS_AGE} years of age or older +- to create an account. +- +- ) : ( +- +- You must be {aaRegionConfig.minAccessAge} years of +- age or older to create an account in your region. +- +- )} +- +- {isNative && +- !isDeviceGeolocationGranted && +- isOverAppMinAccessAge && ( +- +- +- Have we got your location wrong?{' '} +- { +- locationControl.open() +- })}> +- Tap here to confirm your location with GPS. +- +- +- +- )} +- +- +- +- ) : !isOverMinAdultAge ? ( +- +- +- If you are not yet an adult according to the laws of your +- country, your parent or legal guardian must read these Terms +- on your behalf. +- +- +- ) : undefined} +- +- +- {isNative && ( +- { +- props.closeDialog(() => { +- // set this after close! +- setDeviceGeolocation(props.geolocation) +- Toast.show(_(msg`Your location has been updated.`), { +- type: 'success', +- }) +- }) +- }} +- /> +- )} ) : undefined}