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

Simplify interface and rename to Private Kit #16

Merged
merged 1 commit into from
Mar 11, 2020
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
25 changes: 6 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# SafePaths.app
# PrivacyKit

A digital privacy preserving solution to allow an individual to learn their own exposure and risks based on earlier contact with infected patients, reduce panic and prevent overwhelming the health care infrastructure. The idea is to send the user's GPS location homomorphically encrypted to a server and compare that information to others while not knowing when or where users were
A personal location vault that nobody else can access. It will allow you to log your location privately every five minutes. No information will leaves the phone.

## Behavior

1. Get consent to locally track location and send an encoded version online.
2. Locally cache a minute-by-minute database of: ``` Time | GPS Lat | GPS Lon ```
3. Homomorphically encrypts each record and uploads to our server hourly. Result codes ```success, fail, success-with-notification```
3.1 When a success-with-notification is received, the server has a message to be retrieved and displayed to the user as an Alert.
4. There will be a button where the user can self-report if they are diagnosed as Infected. Record the timestamp when that is reported.
5. There will be an Opt Out to turn the tracking off.
2. Locally cache loction info once every 5 minutes: ``` Time | GPS Lat | GPS Lon ```

# Development

Expand All @@ -19,18 +15,9 @@ This is a React Native app version 61.5

Android is currently being optimized. iOS will need to be tested, optimized, and prepared for launch.

## Requirements
## Developer Setup

* Git
* NVM
* Node (10.1 or newer)
* Yarn
* Watchman
* OpenJDK (for Android building and installing)
* Android Studio (SDK, AVD)
* CocoaPods (Required for installing iOS dependencies)
* XCode (for iOS Dev)
* ios-deploy (installing your app on a physical device with the CLI)
Refer to and run the dev_setup.sh for needed tools.

## Running

Expand Down Expand Up @@ -59,4 +46,4 @@ App is deployed to MIT's PlayStore account: https://play.google.com/store/apps/d

# References

Website: http://SafePaths.app
Website: http://privacykit.mit.edu
98 changes: 46 additions & 52 deletions app/views/LocationTracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LocationTracking extends Component {
stopOnTerminate: true,
locationProvider: BackgroundGeolocation.ACTIVITY_PROVIDER,
interval: 20000,
fastestInterval: 60000, // Time (in milliseconds) between location information polls. E.g. 60000 = 1 minute
fastestInterval: 60000*5, // Time (in milliseconds) between location information polls. E.g. 60000*5 = 5 minutes
activitiesInterval: 20000,
stopOnStillActivity: false,
postTemplate: {
Expand All @@ -56,6 +56,7 @@ class LocationTracking extends Component {
GetStoreData('LOCATION_DATA')
.then(locationArray => {
var locationData;

if (locationArray !== null) {
locationData = JSON.parse(locationArray);
} else {
Expand Down Expand Up @@ -154,16 +155,8 @@ class LocationTracking extends Component {
)
}

render() {
return (
<SafeAreaView style={styles.container} >
<View style={styles.header}>
<Text style={styles.headerTitle}>Safe Paths</Text>
</View>

<View style={styles.main}>

<View>
/*
<View>
<Text style={styles.sectionDescription, {fontSize: 18, marginLeft: 5, marginTop: 10}}>Latest News:</Text>
</View>

Expand All @@ -173,25 +166,42 @@ class LocationTracking extends Component {
style={{ }}
/>
</View>
*/

render() {
return (
<SafeAreaView style={styles.container} >

<View style={styles.main}>
<View style={styles.topView}>
<View style={styles.intro} >

<Text style={styles.headerTitle}>Private Kit</Text>

<Text style={styles.sectionDescription}>Private Kit is your personal vault that nobody else can access.</Text>
<Text style={styles.sectionDescription}>It will allow you to log your location privately every five minutes. Your location information will NOT leave your phone.</Text>

<View style={styles.block}>
<View>
<Button title={"Stop Recording Location"} onPress={() => this.optOut()} />
</View>
</View>


<View style={styles.block}>
<Button title={"Stop Recording Location"} onPress={() => this.optOut()} />
<Text style={{ padding: 20, justifyContent: 'center', }} >Private Kit is logging location once every 5 minutes.</Text>
</View>

</View>

<View style={styles.footer}>
<Text style={styles.sectionDescription, { textAlign: 'center', paddingTop: 15 }}>For more information visit the SafePaths homepage:</Text>
<Text style={styles.sectionDescription, { color: 'blue', textAlign: 'center' }} onPress={() => Linking.openURL('https://safepaths.mit.edu')}>safepaths.mit.edu</Text>
<Text style={styles.sectionDescription, { textAlign: 'center', paddingTop: 15 }}>For more information visit the Private Kit hompage:</Text>
<Text style={styles.sectionDescription, { color: 'blue', textAlign: 'center' }} onPress={() => Linking.openURL('https://privatekit.mit.edu')}>privatekit.mit.edu</Text>
</View>
</SafeAreaView>
)
}
}

const styles = StyleSheet.create({
// Container covers the entire screen
container: {
flex: 1,
flexDirection: 'column',
Expand All @@ -201,9 +211,9 @@ const styles = StyleSheet.create({
backgroundColor: colors.APP_BACKGROUND,
},
headerTitle: {
textAlign: 'center',
fontWeight: "bold",
fontSize: 24,
textAlign: 'center',
fontWeight: "bold",
fontSize: 38,
padding: 15
},
main: {
Expand All @@ -217,46 +227,30 @@ const styles = StyleSheet.create({
margin: 20,
width: "100%"
},
containerWebview: {
flex: 1,
width: "100%",
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'stretch',
margin : 10
},
scrollView: {
padding: 10,
height: '100%',
topView: {
flex: 1,
},
engine: {
position: 'absolute',
right: 0,
},
sectionContainer: {
marginTop: 32,
paddingHorizontal: 24,
},
sectionTitle: {
fontSize: 24,
fontWeight: '600'
},
sectionDescription: {
marginTop: 8,
fontSize: 18,
fontWeight: '400'
},
highlight: {
fontWeight: '700',
},
footer: {
textAlign: 'center',
fontSize: 12,
fontWeight: '600',
padding: 4,
padding: 4,
paddingBottom: 10
},
intro: {
flex: 1,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'stretch',
},
sectionDescription: {
fontSize: 18,
lineHeight: 24,
fontWeight: '400',
marginTop: 20,
marginLeft: 10,
marginRight: 10
}
});

export default LocationTracking;
31 changes: 13 additions & 18 deletions app/views/Welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,34 +40,29 @@ class Welcome extends Component {
render() {
return (
<SafeAreaView style={styles.container}>
<View style={styles.header}>

</View>

<View style={styles.main}>

<View style={styles.topView}>
<View style={styles.intro} >

<Text style={styles.headerTitle}>Safe Paths</Text>

<Text style={styles.sectionDescription}> {'\u2022'} SafePaths records your location every 5 minutes. </Text>
<Text style={styles.sectionDescription}> {'\u2022'} Location data is kept on your phone. </Text>
<Text style={styles.sectionDescription}> {'\u2022'} No location information is uploaded or shared with anyone. </Text>

<Text style={styles.headerTitle}>Private Kit</Text>

<Text style={styles.sectionDescription}>Private Kit is your personal vault that nobody else can access.</Text>
<Text style={styles.sectionDescription}>It will allow you to log your location privately every five minutes. Your location information will NOT leave your phone.</Text>

</View>
</View>

<View style={styles.block}>
<Button title="Accept"
onPress={() => this.willParticipate()} />
<Button title="Start Logging Location" onPress={() => this.willParticipate()} />
<Text style={{ padding: 25, justifyContent: 'center', }} >NOTE: After clicking this button you may be prompted to grant Private Kit access to your location.</Text>
</View>

</View>

<View style={styles.footer}>
<Text style={styles.sectionDescription, { textAlign: 'center', paddingTop: 15 }}>For more information visit the SafePaths homepage:</Text>
<Text style={styles.sectionDescription, { color: 'blue', textAlign: 'center' }} onPress={() => Linking.openURL('https://safepaths.mit.edu')}>safepaths.mit.edu</Text>
<Text style={styles.sectionDescription, { textAlign: 'center', paddingTop: 15 }}>For more information visit the Private Kit hompage:</Text>
<Text style={styles.sectionDescription, { color: 'blue', textAlign: 'center' }} onPress={() => Linking.openURL('https://privatekit.mit.edu')}>privatekit.mit.edu</Text>
</View>
</SafeAreaView>
)
Expand All @@ -85,9 +80,9 @@ const styles = StyleSheet.create({
backgroundColor: colors.APP_BACKGROUND,
},
headerTitle: {
textAlign: 'center',
fontWeight: "bold",
fontSize: 38,
textAlign: 'center',
fontWeight: "bold",
fontSize: 38,
padding: 15
},
main: {
Expand All @@ -108,7 +103,7 @@ const styles = StyleSheet.create({
textAlign: 'center',
fontSize: 12,
fontWeight: '600',
padding: 4,
padding: 4,
paddingBottom: 10
},
intro: {
Expand Down