Skip to content

Commit

Permalink
Merge pull request #392 from SwissCovid/develop
Browse files Browse the repository at this point in the history
Version 2.0.0
  • Loading branch information
simonroesch committed Jun 23, 2021
2 parents 61b00f1 + a0ab877 commit a6d3916
Show file tree
Hide file tree
Showing 356 changed files with 19,593 additions and 5,077 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Android Check Build

on:
push:
branches: [ master, develop ]
branches: [ master, develop, feature/v2 ]
pull_request:
branches: [ master, develop ]
branches: [ master, develop, feature/v2 ]

jobs:
build:
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/appcenter_test.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM gradle:6.6.1-jdk8

ENV ANDROID_SDK_URL https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
ENV ANDROID_BUILD_TOOLS_VERSION 29.0.3
ENV ANDROID_BUILD_TOOLS_VERSION 30.0.1
ENV ANDROID_HOME /usr/local/android-sdk-linux
ENV ANDROID_VERSION 29
ENV ANDROID_VERSION 30
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools

RUN mkdir "$ANDROID_HOME" .android && \
Expand Down
59 changes: 31 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
# SwissCovid: DP3T Android App for Switzerland
<h1 align="center">SwissCovid Android App</h1>
<br />
<div align="center">
<img width="180" height="180" src="app/src/main/ic_launcher-playstore.png" />
<br />
<div>
<!-- App Store -->
<a href="https://play.google.com/store/apps/details?id=ch.admin.bag.dp3t">
<img height="40" src="https://bag-coronavirus.ch/wp-content/uploads/2020/04/play-store.png" alt="Download on the PlayStore" />
</a>
</div>
</div>

[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://github.com/DP-3T/dp3t-app-android-ch/blob/master/LICENSE)
![Android Build](https://github.com/DP-3T/dp3t-app-android-ch/workflows/Android%20Build/badge.svg)
[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://github.com/SwissCovid/swisscovid-app-android/blob/master/LICENSE)
![Android Build](https://github.com/SwissCovid/swisscovid-app-android/workflows/Android%20Build/badge.svg)

SwissCovid is the official contact tracing app of Switzerland. The app can be installed from the [Google Play Store](https://play.google.com/store/apps/details?id=ch.admin.bag.dp3t). The SwissCovid 2.0 app uses two types of contact tracing to prevent the spread of COVID-19.

## DP3T
The Decentralised Privacy-Preserving Proximity Tracing (DP-3T) project is an open protocol for COVID-19 proximity tracing using Bluetooth Low Energy functionality on mobile devices that ensures personal data and computation stays entirely on an individual's phone. It was produced by a core team of over 25 scientists and academic researchers from across Europe. It has also been scrutinized and improved by the wider community.
With proximity tracing close contacts are detected using the bluetooth technology. For this the [DP3T Android SDK](https://github.com/DP-3T/dp3t-sdk-android) is used that builds on top of the Google & Apple Exposure Notifications. This feature is called SwissCovid encounters.

DP-3T is a free-standing effort started at EPFL and ETHZ that produced this protocol and that is implementing it in an open-sourced app and server.
With presence tracing people that are at the same venue at the same time are detected. For this the [CrowdNotifier Android SDK](https://github.com/CrowdNotifier/crowdnotifier-sdk-android) is used that provides a secure, decentralized, privacy-preserving presence tracing system. This feature is called SwissCovid Check-in.


## Introduction
This is a COVID-19 tracing client using the [DP3T Android SDK](https://github.com/DP-3T/dp3t-sdk-android). It is based on the previously released demo app, but uses the newest version of the SDK. This project will be released as the official COVID-19 tracing solution for Switzerland, therefore UX, messages and flows are optimized for this specific case. Nevertheless, the source code should be a solid foundation to build a similar app for other countries and demostrate how the SDK can be used in a real app.
The app design, UX and implementation was done by [Ubique](https://www.ubique.ch?app=github).
<p align="center">
<img src="documentation/screenshots/en/screenshot1.png" width="20%">
<img src="documentation/screenshots/en/screenshot2.png" width="20%">
<img src="documentation/screenshots/en/screenshot3.png" width="20%">
<img src="documentation/screenshots/en/screenshot4.png" width="20%">
</p>
Please see the [SwissCovid documentation repository](https://github.com/SwissCovid/swisscovid-doc) for more details.

## Contribution Guide

Expand All @@ -29,18 +31,19 @@ Bugs or potential problems should be reported using Github issues. We welcome al
Platform independent UX and design discussions should be reported in [dp3t-ux-screenflows-ch](https://github.com/DP-3T/dp3t-ux-screenflows-ch)

## Repositories
* Android SDK & Calibration app: [dp3t-sdk-android](https://github.com/DP-3T/dp3t-sdk-android)
* iOS SDK & Calibration app: [dp3t-sdk-ios](https://github.com/DP-3T/dp3t-sdk-ios)
* Android App: [dp3t-app-android](https://github.com/DP-3T/dp3t-app-android-ch)
* iOS App: [dp3t-app-ios](https://github.com/DP-3T/dp3t-app-ios-ch)
* Backend SDK: [dp3t-sdk-backend](https://github.com/DP-3T/dp3t-sdk-backend)
* UX & Screenflows [dp3t-ux-screenflows-ch](https://github.com/DP-3T/dp3t-ux-screenflows-ch)


## Further Documentation
The full set of documents for DP3T is at https://github.com/DP-3T/documents. Please refer to the technical documents and whitepapers for a description of the implementation.

A description of the usage of the Google Exposure Notifcation API can be found [here](https://github.com/DP-3T/dp3t-sdk-android/blob/master/EXPOSURE_NOTIFICATION_API_USAGE.md).
* Android App: [swisscovid-app-android](https://github.com/SwissCovid/swisscovid-app-android)
* iOS App: [swisscovid-app-ios](https://github.com/SwissCovid/swisscovid-app-ios)
* CovidCode Web-App: [CovidCode-UI](https://github.com/admin-ch/CovidCode-UI)
* CovidCode Backend: [CovidCode-Service](https://github.com/admin-ch/CovidCode-service)
* Config Backend: [swisscovid-config-backend](https://github.com/SwissCovid/swisscovid-config-backend)
* Additional Info Backend: [swisscovid-additionalinfo-backend](https://github.com/SwissCovid/swisscovid-additionalinfo-backend)
* QR Code Landingpage: [swisscovid-qr-landingpage](https://github.com/SwissCovid/swisscovid-qr-landingpage)
* DP3T Android SDK & Calibration app: [dp3t-sdk-android](https://github.com/DP-3T/dp3t-sdk-android)
* DP3T iOS SDK & Calibration app: [dp3t-sdk-ios](https://github.com/DP-3T/dp3t-sdk-ios)
* DP3T Backend SDK: [dp3t-sdk-backend](https://github.com/DP-3T/dp3t-sdk-backend)
* CrowdNotifier Android SDK: [crowdnotifier-sdk-android](https://github.com/CrowdNotifier/crowdnotifier-sdk-android)
* CrowdNotifier iOS SDK: [crowdnotifier-sdk-ios](https://github.com/CrowdNotifier/crowdnotifier-sdk-ios)
* CrowdNotifier Backend: [swisscovid-cn-backend](https://github.com/SwissCovid/swisscovid-cn-backend)

## Installation and Building

Expand Down
95 changes: 54 additions & 41 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,20 @@ plugins {
id 'com.android.application'
id 'kotlin-android'
id 'org.sonarqube' version '2.8'

}

apply from: 'backend_certs.gradle'

ext.readProperty = { paramName -> readPropertyWithDefault(paramName, null) }
ext.readPropertyWithDefault = { paramName, defaultValue ->
if (project.hasProperty(paramName)) {
return project.getProperties().get(paramName)
} else {
Properties properties = new Properties()
if (project.rootProject.file('local.properties').exists()) {
properties.load(project.rootProject.file('local.properties').newDataInputStream())
}
if (properties.getProperty(paramName) != null) {
return properties.getProperty(paramName)
} else {
return defaultValue
}
}
}

android {
compileSdkVersion 30
buildToolsVersion "29.0.3"

defaultConfig {
applicationId "ch.admin.bag.dp3t"
minSdkVersion 23
targetSdkVersion 30
versionCode 15000
versionName "1.5.0"
versionCode 20002
versionName "2.0.0"
resConfigs "en", "fr", "de", "it", "pt", "es", "sq", "bs", "hr", "sr", "rm", "tr", "ti"

buildConfigField "long", "BUILD_TIME", readPropertyWithDefault('buildTimestamp', System.currentTimeMillis()) + 'L'
Expand All @@ -68,20 +51,13 @@ android {
buildConfigField 'String', 'BUCKET_URL', '"https://www.pt-d.bfs.admin.ch/"'
buildConfigField 'String', 'REPORT_URL', '"https://www.pt1-d.bfs.admin.ch/"'
buildConfigField 'String', 'STATS_URL', '"https://www.pt-d.bfs.admin.ch/"'
buildConfigField 'String', 'PUBLISHED_CROWDNOTIFIER_KEYS_BASE_URL', '"https://www.pt-d.bfs.admin.ch/"'
buildConfigField "String", "ENTRY_QR_CODE_HOST", '"qr-d.swisscovid.ch"'
buildConfigField "String", "QR_MASTER_PUBLIC_KEY_BASE_64", '"lW5voTRVR-jgYMiWLd04hjvyyFQG7QOyBLw0D7XbASlqlg0AviQMqgjbABZk9PcCip27szrqFyv_1YtKZE8eyzt7vtN4qKfJdWrItLRzRtjb83piN3cDt_yNo7siohQV"'
buildConfigField 'String', 'CONFIG_CERTIFICATE', "\"${project.backend_certs.dev.CONFIG_CERTIFICATE}\""
buildConfigField 'String', 'BUCKET_PUBLIC_KEY', "\"${project.backend_certs.dev.BUCKET_PUBLIC_KEY}\""
applicationIdSuffix '.dev'
}
tescht {
buildConfigField 'boolean', 'DEV_HISTORY', 'true'
buildConfigField 'String', 'AUTH_CODE_URL', '"https://codegen-service-t.bag.admin.ch/"'
buildConfigField 'String', 'CONFIG_URL', '"https://www.pt-t.bfs.admin.ch/"'
buildConfigField 'String', 'BUCKET_URL', '"https://www.pt-t.bfs.admin.ch/"'
buildConfigField 'String', 'REPORT_URL', '"https://www.pt1-t.bfs.admin.ch/"'
buildConfigField 'String', 'STATS_URL', '"https://www.pt-t.bfs.admin.ch/"'
buildConfigField 'String', 'CONFIG_CERTIFICATE', "\"${project.backend_certs.test.CONFIG_CERTIFICATE}\""
buildConfigField 'String', 'BUCKET_PUBLIC_KEY', "\"${project.backend_certs.test.BUCKET_PUBLIC_KEY}\""
applicationIdSuffix '.test'
manifestPlaceholders = [qrCodeHostName: "qr-d.swisscovid.ch"]
}
abnahme {
buildConfigField 'boolean', 'DEV_HISTORY', 'true'
Expand All @@ -90,9 +66,13 @@ android {
buildConfigField 'String', 'BUCKET_URL', '"https://www.pt-a.bfs.admin.ch/"'
buildConfigField 'String', 'REPORT_URL', '"https://www.pt1-a.bfs.admin.ch/"'
buildConfigField 'String', 'STATS_URL', '"https://www.pt-a.bfs.admin.ch/"'
buildConfigField 'String', 'PUBLISHED_CROWDNOTIFIER_KEYS_BASE_URL', '"https://www.pt-a.bfs.admin.ch/"'
buildConfigField "String", "ENTRY_QR_CODE_HOST", '"qr-a.swisscovid.ch"'
buildConfigField "String", "QR_MASTER_PUBLIC_KEY_BASE_64", '"RHk4TO95YVnihWuCSVnbQ3ow-AcO-BXZ9caWeO_GP7o-vEiowJXTkKSUAf77n4oAmzshDvFVLkQFsA72JfBcaC8QSIT9owk83tnDuwpUuDfFgiBq_KXqcA2UcxaInmQS"'
buildConfigField 'String', 'CONFIG_CERTIFICATE', "\"${project.backend_certs.abnahme.CONFIG_CERTIFICATE}\""
buildConfigField 'String', 'BUCKET_PUBLIC_KEY', "\"${project.backend_certs.abnahme.BUCKET_PUBLIC_KEY}\""
applicationIdSuffix '.abnahme'
manifestPlaceholders = [qrCodeHostName: "qr-a.swisscovid.ch"]
}
prod {
buildConfigField 'boolean', 'DEV_HISTORY', 'false'
Expand All @@ -101,8 +81,12 @@ android {
buildConfigField 'String', 'BUCKET_URL', '"https://www.pt.bfs.admin.ch/"'
buildConfigField 'String', 'REPORT_URL', '"https://www.pt1.bfs.admin.ch/"'
buildConfigField 'String', 'STATS_URL', '"https://www.pt.bfs.admin.ch/"'
buildConfigField 'String', 'PUBLISHED_CROWDNOTIFIER_KEYS_BASE_URL', '"https://www.pt.bfs.admin.ch/"'
buildConfigField "String", "ENTRY_QR_CODE_HOST", '"qr.swisscovid.ch"'
buildConfigField "String", "QR_MASTER_PUBLIC_KEY_BASE_64", '"mAofNDGOKcmVJt4fo7kWruvFRee2g0irAfIdjH6EFyd6vHY_uTb6ZXOf9eFVzTUEiZLDLL-Q2w8kZkPscWyXi3X59zuqeI25qloOF-sowHo1_-HiH7Z_4COOA030mm8J"'
buildConfigField 'String', 'CONFIG_CERTIFICATE', "\"${project.backend_certs.prod.CONFIG_CERTIFICATE}\""
buildConfigField 'String', 'BUCKET_PUBLIC_KEY', "\"${project.backend_certs.prod.BUCKET_PUBLIC_KEY}\""
manifestPlaceholders = [qrCodeHostName: "qr.swisscovid.ch"]
}
log {
buildConfigField 'boolean', 'DEV_HISTORY', 'true'
Expand All @@ -111,16 +95,20 @@ android {
buildConfigField 'String', 'BUCKET_URL', '"https://www.pt.bfs.admin.ch/"'
buildConfigField 'String', 'REPORT_URL', '"https://www.pt1.bfs.admin.ch/"'
buildConfigField 'String', 'STATS_URL', '"https://www.pt.bfs.admin.ch/"'
buildConfigField 'String', 'PUBLISHED_CROWDNOTIFIER_KEYS_BASE_URL', '"https://www.pt.bfs.admin.ch/"'
buildConfigField "String", "ENTRY_QR_CODE_HOST", '"qr.swisscovid.ch"'
buildConfigField "String", "QR_MASTER_PUBLIC_KEY_BASE_64", '"mAofNDGOKcmVJt4fo7kWruvFRee2g0irAfIdjH6EFyd6vHY_uTb6ZXOf9eFVzTUEiZLDLL-Q2w8kZkPscWyXi3X59zuqeI25qloOF-sowHo1_-HiH7Z_4COOA030mm8J"'
buildConfigField 'String', 'CONFIG_CERTIFICATE', "\"${project.backend_certs.prod.CONFIG_CERTIFICATE}\""
buildConfigField 'String', 'BUCKET_PUBLIC_KEY', "\"${project.backend_certs.prod.BUCKET_PUBLIC_KEY}\""
manifestPlaceholders = [qrCodeHostName: "qr.swisscovid.ch"]
}
}

signingConfigs {
release {
storeFile file(readPropertyWithDefault('keystoreFile', 'testKeystore'))
storePassword readProperty('keystorePassword')
keyAlias 'keyAlias'
keyAlias readPropertyWithDefault('keyAlias', 'keyAlias')
keyPassword readProperty('keyAliasPassword')
}
}
Expand All @@ -137,13 +125,17 @@ android {
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
coreLibraryDesugaringEnabled true
}

kotlinOptions {
jvmTarget = "1.8"
}
}

buildFeatures {
viewBinding true
}
}

sonarqube {
properties {
Expand All @@ -154,35 +146,56 @@ sonarqube {
}
}


dependencies {

implementation project(":common")

implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'

def dp3t_sdk_version = '2.2.0'
def dp3t_sdk_version = '2.3.0'
devImplementation "org.dpppt:dp3t-sdk-android:$dp3t_sdk_version-calibration"
teschtImplementation "org.dpppt:dp3t-sdk-android:$dp3t_sdk_version"
abnahmeImplementation "org.dpppt:dp3t-sdk-android:$dp3t_sdk_version"
prodImplementation "org.dpppt:dp3t-sdk-android:$dp3t_sdk_version"
logImplementation "org.dpppt:dp3t-sdk-android:$dp3t_sdk_version"

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.fragment:fragment:1.3.2'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.2.0'
implementation 'androidx.lifecycle:lifecycle-livedata:2.2.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0'
implementation 'androidx.fragment:fragment-ktx:1.3.3'
implementation "androidx.activity:activity-ktx:1.2.3"
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.viewpager2:viewpager2:1.0.0'
implementation 'androidx.security:security-crypto:1.0.0-rc03'
implementation 'androidx.security:security-crypto:1.0.0'
implementation 'androidx.work:work-runtime-ktx:2.5.0'
implementation "androidx.datastore:datastore:1.0.0-beta01"

implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
implementation 'io.reactivex.rxjava3:rxjava:3.0.0'

implementation 'com.google.android.material:material:1.2.1'
implementation 'com.google.android.gms:play-services-base:17.5.0'

implementation 'com.google.protobuf:protobuf-lite:3.0.1'
implementation('com.squareup.retrofit2:converter-protobuf:2.9.0') { transitive = false }
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'

// QR code scanning
def camerax_version = "1.0.0-rc04"
implementation "androidx.camera:camera-camera2:${camerax_version}"
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
implementation "androidx.camera:camera-view:1.0.0-alpha23"
//DO NOT UPDATE ZXING TO 3.4.0! (3.4.0 is not compatible with API Level 23 or lower)
implementation "com.google.zxing:core:3.3.0"

implementation 'androidx.biometric:biometric:1.1.0'

implementation 'io.github.ShawnLin013:number-picker:2.4.13'

coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'

androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:core:1.3.0'
Expand Down
4 changes: 3 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@
-dontobfuscate

-keep class ch.admin.bag.dp3t.inform.models.** { *; }
-keep class ch.admin.bag.dp3t.networking.models.** { *; }
-keep class ch.admin.bag.dp3t.networking.models.** { *; }

-keep class com.sun.jna.** { *; }
Loading

0 comments on commit a6d3916

Please sign in to comment.