Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
0.8.1 Release
Browse files Browse the repository at this point in the history
0.8.1
  • Loading branch information
jakobmoellerdev authored Jun 3, 2020
2 parents 36921e5 + 5e54ea9 commit 6746f48
Show file tree
Hide file tree
Showing 98 changed files with 1,923 additions and 967 deletions.
9 changes: 3 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@ commands:
jobs:
quickBuildReleaseWithTestsAndChecks:
executor: android/android

steps:
- checkout
- install-ndk:
ndk-sha: "50250fcba479de477b45801e2699cca47f7e1267"
ndk-version: "android-ndk-r21b"
ndk-sha: "c81a5bcb4672a18d3647bf6898cd4dbcb978d0e8"
ndk-version: "android-ndk-r21c"
- restore-build-cache
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "Corona-Warn-App/build.gradle" }}-{{ checksum "Server-Protocol-Buffer/build.gradle" }}
- run:
name: Sudo GradleWrapper
command: chmod +x ./gradlew
- run:
name: Quick Build
command: ./gradlew quickBuild
environment:
JVM_OPTS: -Xmx2048m
Expand Down
39 changes: 23 additions & 16 deletions Corona-Warn-App/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,19 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: 'jacoco'

android {
ndkVersion "21.1.6352462"
ndkVersion "21.2.6472646"
compileSdkVersion 29
buildToolsVersion "29.0.3"

defaultConfig {
applicationId 'de.rki.coronawarnapp'
minSdkVersion 23
targetSdkVersion 29
versionCode 7
versionName "0.8.0"
versionCode 8
versionName "0.8.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

buildConfigField "String", "DOWNLOAD_CDN_URL", "\"$DOWNLOAD_CDN_URL\""
Expand Down Expand Up @@ -62,14 +63,14 @@ android {

buildTypes {
release {
minifyEnabled false
shrinkResources false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
releaseForTest {
applicationIdSuffix '.dev'
minifyEnabled false
shrinkResources false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Expand All @@ -86,18 +87,16 @@ android {
}
}

dataBinding {
enabled true
}
buildFeatures {
dataBinding {
enabled true
}

viewBinding {
enabled true
viewBinding {
enabled true
}
}

// To inline the bytecode built with JVM target 1.8 into
// bytecode that is being built with JVM target 1.6. (e.g. navArgs)


compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -135,6 +134,13 @@ android {

}

task jacocoTestReport(type: JacocoReport, dependsOn: ['testDeviceReleaseUnitTest']) {
reports {
xml.enabled = true
html.enabled = true
}
}

dependencies {
api fileTree(dir: 'libs', include: ['play-services-nearby-18.0.2-eap.aar'])
implementation project(":Server-Protocol-Buffer")
Expand All @@ -153,6 +159,7 @@ dependencies {
implementation 'androidx.work:work-runtime-ktx:2.3.4'
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.squareup.okhttp3:okhttp:4.7.2'
implementation 'com.google.android.play:core:1.7.3'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.google.guava:guava:29.0-android'
Expand Down
6 changes: 5 additions & 1 deletion Corona-Warn-App/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@
private public protected *;
}

-keep class * extends com.google.crypto.tink.shaded.protobuf.GeneratedMessageLite { *; }
-keep class net.sqlcipher.** { *; }
-dontwarn net.sqlcipher.**

# Uncomment this to preserve the line number information for
# debugging stack traces.
-keepattributes SourceFile,LineNumberTable

-dontobfuscate
#-dontobfuscate
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
package de.rki.coronawarnapp

import android.annotation.SuppressLint
import android.app.Activity
import android.app.Application
import android.content.Context
import android.content.pm.ActivityInfo
import android.os.Bundle
import android.util.Log
import android.view.WindowManager
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent
import androidx.lifecycle.ProcessLifecycleOwner
import de.rki.coronawarnapp.notification.NotificationHelper

class CoronaWarnApplication : Application(), LifecycleObserver {
class CoronaWarnApplication : Application(), LifecycleObserver,
Application.ActivityLifecycleCallbacks {

companion object {
val TAG: String? = CoronaWarnApplication::class.simpleName
Expand All @@ -31,6 +37,7 @@ class CoronaWarnApplication : Application(), LifecycleObserver {
NotificationHelper.createNotificationChannel()
super.onCreate()
ProcessLifecycleOwner.get().lifecycle.addObserver(this)
registerActivityLifecycleCallbacks(this)
}

/**
Expand All @@ -50,4 +57,39 @@ class CoronaWarnApplication : Application(), LifecycleObserver {
isAppInForeground = true
Log.v(TAG, "App foregrounded")
}

override fun onActivityPaused(activity: Activity) {
// does not override function. Empty on intention
}

override fun onActivityStarted(activity: Activity) {
// does not override function. Empty on intention
}

override fun onActivityDestroyed(activity: Activity) {
// does not override function. Empty on intention
}

override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {
// does not override function. Empty on intention
}

override fun onActivityStopped(activity: Activity) {
// does not override function. Empty on intention
}

@SuppressLint("SourceLockedOrientationActivity")
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
// prevents screenshot of the app for all activities
activity.window.setFlags(
WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE
)
// set screen orientation to portrait
activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
}

override fun onActivityResumed(activity: Activity) {
// does not override function. Empty on intention
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import de.rki.coronawarnapp.server.protocols.AppleLegacyKeyExchange
import de.rki.coronawarnapp.sharing.ExposureSharingService
import de.rki.coronawarnapp.storage.AppDatabase
import de.rki.coronawarnapp.storage.ExposureSummaryRepository
import de.rki.coronawarnapp.storage.LocalData
import de.rki.coronawarnapp.storage.tracing.TracingIntervalRepository
import de.rki.coronawarnapp.transaction.RiskLevelTransaction
import de.rki.coronawarnapp.transaction.SubmitDiagnosisKeysTransaction
Expand Down Expand Up @@ -76,6 +77,8 @@ class TestForAPIFragment : Fragment(), InternalExposureNotificationPermissionHel
companion object {
val TAG: String? = TestForAPIFragment::class.simpleName

const val CONFIG_SCORE = 8

fun keysToJson(keys: List<TemporaryExposureKey>): String {
return Gson().toJson(keys).toString()
}
Expand Down Expand Up @@ -308,6 +311,7 @@ class TestForAPIFragment : Fragment(), InternalExposureNotificationPermissionHel
showToast("No other keys provided. Please fill the EditText with the JSON containing keys")
} else {
token = UUID.randomUUID().toString()
LocalData.googleApiToken(token)

val appleKeyList = mutableListOf<AppleLegacyKeyExchange.Key>()

Expand Down Expand Up @@ -344,7 +348,7 @@ class TestForAPIFragment : Fragment(), InternalExposureNotificationPermissionHel
// only testing implementation: this is used to wait for the broadcastreceiver of the OS / EN API
InternalExposureNotificationClient.asyncProvideDiagnosisKeys(
googleFileList,
ExposureConfiguration.ExposureConfigurationBuilder().build(),
getCustomConfig(),
token!!
)
showToast("Provided ${appleKeyList.size} keys to Google API with token $token")
Expand Down Expand Up @@ -442,4 +446,48 @@ class TestForAPIFragment : Fragment(), InternalExposureNotificationPermissionHel
keysToJson(keys)
updateKeysDisplay()
}

private fun getCustomConfig(): ExposureConfiguration = ExposureConfiguration
.ExposureConfigurationBuilder()
.setAttenuationScores(
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE
)
.setDaysSinceLastExposureScores(
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE
)
.setDurationScores(
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE
)
.setTransmissionRiskScores(
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE,
CONFIG_SCORE
)
.build()
}

This file was deleted.

Loading

0 comments on commit 6746f48

Please sign in to comment.