diff --git a/.flowconfig b/.flowconfig deleted file mode 100644 index 4afc766a29..0000000000 --- a/.flowconfig +++ /dev/null @@ -1,75 +0,0 @@ -[ignore] -; We fork some components by platform -.*/*[.]android.js - -; Ignore "BUCK" generated dirs -/\.buckd/ - -; Ignore polyfills -node_modules/react-native/Libraries/polyfills/.* - -; These should not be required directly -; require from fbjs/lib instead: require('fbjs/lib/warning') -node_modules/warning/.* - -; Flow doesn't support platforms -.*/Libraries/Utilities/LoadingView.js - -[untyped] -.*/node_modules/@react-native-community/cli/.*/.* - -[include] - -[libs] -node_modules/react-native/Libraries/react-native/react-native-interface.js -node_modules/react-native/flow/ - -[options] -emoji=true - -esproposal.optional_chaining=enable -esproposal.nullish_coalescing=enable - -module.file_ext=.js -module.file_ext=.json -module.file_ext=.ios.js - -munge_underscores=true - -module.name_mapper='^react-native$' -> '/node_modules/react-native/Libraries/react-native/react-native-implementation' -module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' -module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' - -suppress_type=$FlowIssue -suppress_type=$FlowFixMe -suppress_type=$FlowFixMeProps -suppress_type=$FlowFixMeState - -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+ -suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError - -[lints] -sketchy-null-number=warn -sketchy-null-mixed=warn -sketchy-number=warn -untyped-type-import=warn -nonstrict-import=warn -deprecated-type=warn -unsafe-getters-setters=warn -inexact-spread=warn -unnecessary-invariant=warn -signature-verification-failure=warn -deprecated-utility=error - -[strict] -deprecated-type -nonstrict-import -sketchy-null -unclear-type -unsafe-getters-setters -untyped-import -untyped-type-import - -[version] -^0.105.0 diff --git a/App.js b/App.js index 9a33f07946..bdd69097f7 100644 --- a/App.js +++ b/App.js @@ -1,5 +1,4 @@ import React, { useEffect } from 'react'; -import { MenuProvider } from 'react-native-popup-menu'; import SplashScreen from 'react-native-splash-screen'; import { Provider } from 'react-redux'; import { PersistGate } from 'redux-persist/integration/react'; @@ -15,11 +14,9 @@ import BackgroundTaskService from './app/services/BackgroundTaskService'; // For snapshot testing. In tests, we provide a mock store wrapper if needed. export const UnconnectedApp = () => ( - - - - - + + + ); const App = () => { diff --git a/__tests__/__snapshots__/App.spec.js.snap b/__tests__/__snapshots__/App.spec.js.snap index 05041b3f5e..16b61c5312 100644 --- a/__tests__/__snapshots__/App.spec.js.snap +++ b/__tests__/__snapshots__/App.spec.js.snap @@ -10,8 +10,6 @@ exports[`renders correctly 1`] = ` } } > - - - + `; diff --git a/app/Entry.js b/app/Entry.js index b71b353a8f..40a33fa8ef 100644 --- a/app/Entry.js +++ b/app/Entry.js @@ -22,12 +22,10 @@ import { LicensesScreen } from './views/Licenses'; import { ExportStart, ExportLocally } from './gps/Export'; import ExposureHistoryScreen from './views/ExposureHistory'; -import NextSteps from './views/ExposureHistory/NextSteps'; import MoreInfo from './views/ExposureHistory/MoreInfo'; import ImportFromUrl from './views/Settings/ImportFromUrl'; import { FeatureFlagsScreen } from './views/FeatureFlagToggles'; import ImportScreen from './views/Import'; -import { EnableExposureNotifications } from './views/onboarding/EnableExposureNotifications'; import Welcome from './views/onboarding/Welcome'; import PersonalPrivacy from './views/onboarding/PersonalPrivacy'; import NotificationDetails from './views/onboarding/NotificationDetails'; @@ -77,7 +75,6 @@ const ExposureHistoryStack = ({ navigation }) => { name={Screens.ExposureHistory} component={ExposureHistoryScreen} /> - ); @@ -224,10 +221,6 @@ const OnboardingStack = () => ( name={Screens.OnboardingLocationPermissions} component={LocationsPermissions} /> - ); diff --git a/app/assets/images/permissionDenied.svg b/app/assets/images/permissionDenied.svg deleted file mode 100644 index 38b3255e15..0000000000 --- a/app/assets/images/permissionDenied.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/app/assets/images/permissionGranted.svg b/app/assets/images/permissionGranted.svg deleted file mode 100644 index 38b3255e15..0000000000 --- a/app/assets/images/permissionGranted.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/app/assets/images/permissionUnknown.svg b/app/assets/images/permissionUnknown.svg deleted file mode 100644 index 8e0590ce8f..0000000000 --- a/app/assets/images/permissionUnknown.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/app/assets/svgs/TabBarNav/index.ts b/app/assets/svgs/TabBarNav/index.ts index c69121a3ea..2aed08996d 100644 --- a/app/assets/svgs/TabBarNav/index.ts +++ b/app/assets/svgs/TabBarNav/index.ts @@ -4,5 +4,4 @@ export { LocationsActive, LocationsInactive } from './Locations'; export { MoreActive, MoreInactive } from './More'; export { ShieldActive, ShieldInactive } from './Shield'; export { NotificationIcon } from './NotificationIcon'; -export { SelfAssessmentActive, SelfAssessmentInactive } from './SelfAssessment'; export { CalendarActive, CalendarInactive } from './Calendar'; diff --git a/app/assets/svgs/check.js b/app/assets/svgs/check.js deleted file mode 100644 index e8318b9cd7..0000000000 --- a/app/assets/svgs/check.js +++ /dev/null @@ -1,2 +0,0 @@ -export default ` -`; diff --git a/app/assets/svgs/index.ts b/app/assets/svgs/index.ts index ac2c2069c9..3656dfc307 100644 --- a/app/assets/svgs/index.ts +++ b/app/assets/svgs/index.ts @@ -17,7 +17,6 @@ import LocationPin from './locationPin'; import Publish from './publish'; import QuestionMark from './questionMark'; import RadioWave from './radioWave'; -import SelfAssessment from './selfAssessment'; import StateNoContact from './stateNoContact'; import StateUnknown from './stateUnknown'; import Upload from './upload'; @@ -42,7 +41,6 @@ export const Icons = { Publish, QuestionMark, RadioWave, - SelfAssessment, StateNoContact, StateUnknown, Upload, diff --git a/app/assets/svgs/selfAssessment.ts b/app/assets/svgs/selfAssessment.ts deleted file mode 100644 index 9c5b845fdf..0000000000 --- a/app/assets/svgs/selfAssessment.ts +++ /dev/null @@ -1,6 +0,0 @@ -export default ` - - - - -`; diff --git a/app/components/IconButton.tsx b/app/components/IconButton.tsx index 6de3916e7b..f143f0662c 100644 --- a/app/components/IconButton.tsx +++ b/app/components/IconButton.tsx @@ -1,7 +1,7 @@ -import styled from '@emotion/native'; import React from 'react'; import { SvgXml } from 'react-native-svg'; import { Colors } from '../styles'; +import { TouchableOpacity } from 'react-native'; interface IconButtonProps { icon: string; @@ -19,18 +19,19 @@ export const IconButton = ({ ...otherProps }: IconButtonProps): JSX.Element => { return ( - + - + ); }; - -const Container = styled.TouchableOpacity` - align-items: center; - align-content: center; -`; diff --git a/app/encryption/intersection.py b/app/encryption/intersection.py deleted file mode 100644 index 9869d45f71..0000000000 --- a/app/encryption/intersection.py +++ /dev/null @@ -1,135 +0,0 @@ -import numpy as np -import hashlib -import random - -# ########################################################################## -# Example of an encrypted system in operation. This works with a few -# assumptions that can be adjusted: -# * Getting within approximately 70' is close enough to note -# * "Infection" sticks around for 2 hours -# -# Questions can be directed to TripleBlind, Inc. This code and algorithm -# is donated to the Private Kit project. - - -# ########################################################################## -# InfectedUser - -class InfectedUser: - def __init__(self): - self.salt = str(random.randint(0, 2 ** 100)).encode("utf-8") - - def infected_helper_generation(self, location, thresholds): - distance_threshold = thresholds[0] - time_threshold = int(thresholds[1] / 2) - lat = int(location[0] * 10 ** 6) - long = int(location[1] * 10 ** 6) - time_ = int( - location[2] + time_threshold / 2 - ) # an origin for time is needed let's say the day the app is released - template = [lat, long, time_] - random_x = random.randint( - int((-90 * 10 ** 6) / (2 * distance_threshold)), - int((90 * 10 ** 6) / (2 * distance_threshold)), - ) - random_y = random.randint( - int((-180 * 10 ** 6) / (2 * distance_threshold)), - int((180 * 10 ** 6) / (2 * distance_threshold)), - ) - random_time = random.randint(0, 2 ** 50) - lattice_point_x = random_x * 2 * distance_threshold - lattice_point_y = random_y * 2 * distance_threshold - lattice_point_z = random_time * 2 * time_threshold - lattice_point = np.array([lattice_point_x, lattice_point_y, lattice_point_z]) - translation_vector = lattice_point - template - hash_complexity = 1000000 - dk = hashlib.pbkdf2_hmac( - "sha256", str(lattice_point).encode("utf-8"), self.salt, hash_complexity - ) - - return translation_vector, dk.hex() - -# ######################################################################### - -def user_hash_generation(query, translation_vector, salt, thresholds): - lat = int(query[0] * 10 ** 6) - long = int(query[1] * 10 ** 6) - time_ = int(query[2]) - distance_threshold = thresholds[0] - time_threshold = int(thresholds[1] / 2) - query = np.array([lat, long, time_]) - translated_query = query + translation_vector - - quantized_query = ( - 2 - * distance_threshold - * np.ceil( - (translated_query[0:2] - distance_threshold) / (2 * distance_threshold) - ).astype(np.int64) - ) - quantized_time = ( - 2 - * time_threshold - * np.ceil((translated_query[2] - time_threshold) / (2 * time_threshold)).astype( - np.int64 - ) - ) - quantized_out = np.array([quantized_query[0], quantized_query[1], quantized_time]) - encoded = str(quantized_out).encode("utf-8") - hash_complexity = 1000000 - dk = hashlib.pbkdf2_hmac("sha256", encoded, salt, hash_complexity) - return dk.hex() - -# -# The infected user do the following -# * Store a set of points in GPS lat/lon coordinate system -# * Generate the unique hash and helper data - - -user1_locations = np.array( - [[41.403380, 39.289342, 32], [2.192491, 145.293971, 55]] -) # [lat,long,time] -inf_user = InfectedUser() -thresholds = [300, 2] # .000300 is approximately 70 feet #TODO: More accurate threshold -# 2 hours threshold - -user1_helper_data = [] -for i in range(user1_locations.shape[0]): - user1_helper_data.append( - inf_user.infected_helper_generation(user1_locations[i], thresholds) - ) - - -print(user1_helper_data[0][1], "infected point hash") -""" -The hash of the infected point is stored at the server but the other helper data translation vector, salt -is sent to all users - - -""" - -translation_vector = user1_helper_data[0][0] -salt = inf_user.salt -current_location1 = np.array([41.403380, 39.289342, 32]) # exact match -current_location2 = np.array([41.403280, 39.289142, 33]) # within threshold ( -current_location3 = np.array([41.403280, 39.289142, 31]) # before the infection -current_location4 = np.array([41.401380, 39.289342, 31]) # safe area -print( - user_hash_generation(current_location1, translation_vector, salt, thresholds), - "This point is close to an infected point within 2 hours", -) -print( - user_hash_generation(current_location2, translation_vector, salt, thresholds), - "This point is close to an infected point within 2 hours", -) -print( - user_hash_generation(current_location3, translation_vector, salt, thresholds), - "This point is safe", -) -print( - user_hash_generation(current_location4, translation_vector, salt, thresholds), - "This point is safe", -) - - -"""The Hash is sent to the server and server perform the matching """ diff --git a/app/navigation/index.ts b/app/navigation/index.ts index 416d69bf86..2bbcdcd8c1 100644 --- a/app/navigation/index.ts +++ b/app/navigation/index.ts @@ -25,9 +25,7 @@ export type Screen = | 'ExportComplete' | 'ExposureHistory' | 'ExportLocally' - | 'NextSteps' | 'MoreInfo' - | 'ExposureListDebugScreen' | 'Settings' | 'About' | 'Licenses' @@ -67,9 +65,7 @@ export const Screens: { [key in Screen]: Screen } = { ExportComplete: 'ExportComplete', ExposureHistory: 'ExposureHistory', ExportLocally: 'ExportLocally', - NextSteps: 'NextSteps', MoreInfo: 'MoreInfo', - ExposureListDebugScreen: 'ExposureListDebugScreen', Settings: 'Settings', About: 'About', Licenses: 'Licenses', diff --git a/app/styles/typography.ts b/app/styles/typography.ts index f4b18d8d6c..1663caba52 100644 --- a/app/styles/typography.ts +++ b/app/styles/typography.ts @@ -275,13 +275,6 @@ export const buttonTextTinyDark: TextStyle = { ...tinyFont, }; -// Assessment -export const assessmentInstruction: TextStyle = { - ...mediumFont, - color: Colors.secondaryHeaderText, - lineHeight: smallerLineHeight, -}; - export const inputLabel: TextStyle = { ...bold, color: Colors.primaryText, diff --git a/app/views/ExposureHistory/NextSteps.tsx b/app/views/ExposureHistory/NextSteps.tsx deleted file mode 100644 index dd8354ae4a..0000000000 --- a/app/views/ExposureHistory/NextSteps.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import React from 'react'; -import { TouchableOpacity, View, StyleSheet, Linking } from 'react-native'; -import { useNavigation } from '@react-navigation/native'; -import { useTranslation } from 'react-i18next'; -import { SvgXml } from 'react-native-svg'; -import env from 'react-native-config'; - -import { Typography } from '../../components/Typography'; -import { NavigationBarWrapper } from '../../components/NavigationBarWrapper'; -import { Screens, useStatusBarEffect } from '../../navigation'; - -import { Buttons, Spacing, Typography as TypographyStyles } from '../../styles'; -import { Icons } from '../../assets'; - -import { Colors } from '../../styles'; - -const { GAEN_AUTHORITY_NAME: healthAuthorityName, AUTHORITY_ADVICE_URL } = env; - -const NextSteps = (): JSX.Element => { - const navigation = useNavigation(); - const { t } = useTranslation(); - useStatusBarEffect('light-content'); - - const handleOnBackPress = () => { - navigation.goBack(); - }; - - const footerText = t('exposure_history.next_steps.ha_self_assessment', { - healthAuthorityName, - }); - const contentTextOne = t( - 'exposure_history.next_steps.possible_crossed_paths', - ); - const contentTextTwo = t( - 'exposure_history.next_steps.possible_infection_precaution', - ); - const buttonText = t('exposure_history.next_steps.button_text'); - - const handleOnPressTakeAssessment = () => { - AUTHORITY_ADVICE_URL - ? Linking.openURL(AUTHORITY_ADVICE_URL) - : navigation.navigate(Screens.SelfAssessment); - }; - - return ( - - - - {contentTextOne} - {contentTextTwo} - - - {footerText} - - {buttonText} - - - - - - ); -}; - -const styles = StyleSheet.create({ - container: { - flex: 1, - padding: Spacing.medium, - }, - headerContainer: { - flex: 1, - }, - footerText: { - ...TypographyStyles.footer, - marginBottom: Spacing.medium, - }, - contentText: { - ...TypographyStyles.mainContent, - paddingTop: Spacing.small, - }, - buttonContainer: { - flex: 1, - justifyContent: 'flex-end', - }, - button: { - ...Buttons.largeBlue, - padding: Spacing.xxLarge, - justifyContent: 'space-between', - }, - buttonText: { - ...TypographyStyles.buttonTextLight, - }, -}); - -export default NextSteps; diff --git a/app/views/assessment/Agreement.js b/app/views/assessment/Agreement.js deleted file mode 100644 index 80df1d7c8c..0000000000 --- a/app/views/assessment/Agreement.js +++ /dev/null @@ -1,57 +0,0 @@ -import React from 'react'; -import { StyleSheet } from 'react-native'; -import { useTranslation } from 'react-i18next'; - -import { InfoText } from './components/InfoText'; -import { Button } from './components/Button'; -import { Info } from './Info'; -import { Typography } from '../../components/Typography'; -import { Colors } from '../../styles'; -import { Icons } from '../../assets'; - -/** @type {React.FunctionComponent<{}>} */ -export const Agreement = ({ navigation }) => { - let { t } = useTranslation(); - - const handleAgreementPress = () => navigation.push('EmergencyAssessment'); - - return ( - - }> - - - ); -}; - -const AgreementFooter = ({ description, onPress, buttonTitle }) => ( - <> -