CrunchyBagel / TracePrivately

A privacy-focused app using Apple's soon-to-be-released contact tracing framework.
MIT License
351 stars 27 forks source link

TracePrivately

A functioning app using Apple's contact tracing framework, as documented here:

https://www.apple.com/covid19/contacttracing

7 May 2020: App is now updated for iOS 13.5 beta 2 changes. The framework now has a more defined structure for how the server should work, so we'll likely be making some additional changes to further integrate with protocol buffers.

Note: To run the app the Apple framework, a special entitlement is required, only available to authorized organizations. More Info

This app will be evolving quickly as I'm trying to publish new functionality as quickly as possible.

Objectives

How Can You Help?

There are a number of ways you can help. You can:

Instructions

Key Server

The mobile app communicates with a server to retrieve infected keys. API specification: https://github.com/CrunchyBagel/TracePrivately/blob/master/KeyServer/KeyServer.yaml

Current server options:

  1. PHP: This project contains a reference implementation in PHP: https://github.com/CrunchyBagel/TracePrivately/tree/master/KeyServer
  2. Ruby: https://github.com/tatey/trace_privately by @tatey.
    • Includes a 1-click setup process for quick deployment
  3. Vapor (Swift): https://github.com/kevinrmblr/traceprivately-server
  4. Go: https://github.com/dstotijn/ct-diag-server
  5. Create your own, either according to the above OpenAPI specification or by creating your own adapter implementing KeyServerAdapter.

iOS App

  1. Configure KeyServer.plist to point to your server
    • The endpoints are constructed by joining BaseUrl with each corresponding endpoint value.
    • Authentication is optional. Remove the Authenticaftion key to disable. Otherwise, the types available are:
      • receipt: Submit the App Store receipt data to the auth endpoint. This data isn't available in development
      • deviceCheck: Submit the info from DeviceCheck to the auth endpoint. This is only available from iOS 11.
  2. Configure ExposureNotifications.plist to control how exposures are scored.
    • This is based on weighting of attenuation, duration, days since exposed and risk level.
    • Defaults in app are based on Apple's example in their documentation.
    • Refer to Apple's documentation for more info: https://www.apple.com/covid19/contacttracing
  3. Configure SubmitConfig.plist if you want the user to submit additional information with a positive diagnosis.
    • This system is extensible and localizable.
    • You will need to configure your server to save and use this data accordingly.
    • For example, your workflow for approving new infected keys may involve reviewing this data before approving the submission.
  4. Build and run in Xcode

Workflow

If you're using the sample PHP implementation, it goes something like:

  1. App: Enable tracing in the app
  2. App: Submit that you're infected
  3. Server: Approve submission using the ./tools/pending.php and ./tools/approve.php scripts.

Those keys are now in the infected list so they can be matched against.

Localizations

If you can help translate the app, please help our crowd-sourced effort here:

https://traceprivately.oneskyapp.com/collaboration/project?id=170066

Currently available in: English, French, Spanish (ES, MX), Portuguese (PT, BR), German, Chinese (Simplified and Traditional), Croatian, Serbian, Japanese, Estonian, Latvian, Dutch, Italian, Ukrainian, Hindi, Arabic, Catalan, Hebrew.

Screenshots

Screenshots

This screenshot shows how you can use the start/stop tracing shortcuts with automations. User is still manually prompted to start tracing, but this will initiate it automatically when you leave home:

Siri Shortcuts

Other

License

Refer to the LICENSE file.