Skip to content

Commit

Permalink
Merge pull request #275 from DP-3T/develop
Browse files Browse the repository at this point in the history
Version 1.3.0
  • Loading branch information
simonroesch committed Dec 22, 2020
2 parents 4898ab6 + 9d049b0 commit 70fac87
Show file tree
Hide file tree
Showing 52 changed files with 4,871 additions and 284 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Sonar Analysis
run: ./gradlew sonarqube -Dsonar.login=${{secrets.SONAR_LOGIN}}
env:
Expand Down
34 changes: 17 additions & 17 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ android {
applicationId "ch.admin.bag.dp3t"
minSdkVersion 23
targetSdkVersion 30
versionCode 12010
versionName "1.2.1"
versionCode 13000
versionName "1.3.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 Down Expand Up @@ -152,36 +152,36 @@ sonarqube {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])

def dp3t_sdk_version = '2.0.0'
def dp3t_sdk_version = '2.0.1'
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.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.fragment:fragment:1.2.4'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.fragment:fragment:1.2.5'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.2.0'
implementation 'androidx.lifecycle:lifecycle-livedata:2.2.0'
implementation 'androidx.viewpager2:viewpager2:1.0.0'
implementation 'androidx.security:security-crypto:1.0.0-rc01'
implementation 'androidx.work:work-runtime:2.3.4'
implementation 'androidx.security:security-crypto:1.0.0-rc03'
implementation 'androidx.work:work-runtime:2.5.0-beta02'

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

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

implementation 'com.squareup.retrofit2:retrofit:2.8.1'
implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'

androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:core:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.work:work-testing:2.3.4'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:core:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.work:work-testing:2.4.0'
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:3.14.7'

}
Binary file not shown.
Binary file not shown.
20 changes: 20 additions & 0 deletions app/src/androidTest/java/ch/admin/bag/dp3t/FakeWorkerTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package ch.admin.bag.dp3t;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.Network;
import android.util.Log;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
Expand All @@ -11,6 +13,8 @@
import androidx.work.testing.TestDriver;
import androidx.work.testing.WorkManagerTestInitHelper;

import junit.framework.TestCase;

import java.io.IOException;
import java.util.List;
import java.util.UUID;
Expand Down Expand Up @@ -83,8 +87,16 @@ public void testInitialTDummy() throws Exception {
assertTrue(SecureStorage.getInstance(context).getTDummy() > System.currentTimeMillis());
}

private void assertIsConnected() {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
Network net = cm.getActiveNetwork();
TestCase.assertNotNull("A network connection is required for this test", net);
}

@Test
public void testCallingReportWhenScheduledIsNotPast() throws Exception {
assertIsConnected();

List<WorkInfo> initialWorkList = WorkManager.getInstance(context).getWorkInfosByTag(FakeWorker.WORK_TAG).get();
assertEquals(0, initialWorkList.size());

Expand All @@ -111,6 +123,8 @@ public MockResponse dispatch(RecordedRequest request) {

@Test
public void testCallingReportWhenScheduledIsPast() throws Exception {
assertIsConnected();

List<WorkInfo> initialWorkList = WorkManager.getInstance(context).getWorkInfosByTag(FakeWorker.WORK_TAG).get();
assertEquals(0, initialWorkList.size());

Expand All @@ -137,6 +151,8 @@ public MockResponse dispatch(RecordedRequest request) {

@Test
public void testCallingReportWhenScheduledIsPastErrorResponse() throws Exception {
assertIsConnected();

List<WorkInfo> initialWorkList = WorkManager.getInstance(context).getWorkInfosByTag(FakeWorker.WORK_TAG).get();
assertEquals(0, initialWorkList.size());

Expand Down Expand Up @@ -164,6 +180,8 @@ public MockResponse dispatch(RecordedRequest request) {

@Test
public void testCallingReportWhenScheduledIs2DaysPast() throws Exception {
assertIsConnected();

List<WorkInfo> initialWorkList = WorkManager.getInstance(context).getWorkInfosByTag(FakeWorker.WORK_TAG).get();
assertEquals(0, initialWorkList.size());

Expand Down Expand Up @@ -207,6 +225,8 @@ public void testSyncInterval() {

@Test
public void testCallingReportMultipleDays() throws Exception {
assertIsConnected();

List<WorkInfo> initialWorkList = WorkManager.getInstance(context).getWorkInfosByTag(FakeWorker.WORK_TAG).get();
assertEquals(0, initialWorkList.size());

Expand Down
16 changes: 16 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

<application
android:name="ch.admin.bag.dp3t.MainApplication"
Expand All @@ -36,6 +38,18 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="cc.admin.ch"
android:scheme="https" />
</intent-filter>

</activity>

<activity
Expand All @@ -50,6 +64,8 @@
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity" />

<receiver android:name=".util.ReminderHelper" />

</application>

</manifest>
Loading

0 comments on commit 70fac87

Please sign in to comment.