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

Translation branch update #127

Merged
merged 54 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
355bc1f
Implement submission done fragment (#20)
kolyaopahle May 30, 2020
21d92cb
Moved QR code scan and registration fragment to submission package (#21)
kolyaopahle May 30, 2020
21db916
Dependency Updates and Gradle Fixes (#34)
jakobmoellerdev May 30, 2020
75dfa27
Fix #23: Typo in onboarding screen (#31)
Bananeweizen May 30, 2020
88b4396
Submission UI Additions (#25)
kolyaopahle May 30, 2020
a5a6d24
Enable diagnosis key upload to backend (#35)
tklingbeil May 30, 2020
c96ede0
Removed ExposureNotificationIntentService, the functionality is handl…
htooisap May 30, 2020
0ddb419
Fixing tele tan registration (#45)
kolyaopahle May 31, 2020
a7a9e4c
Merge pull request #36 from corona-warn-app/dev
jakobmoellerdev May 31, 2020
67ff4a2
Release/0.5.5 (#48)
jakobmoellerdev May 31, 2020
4149e40
Release/0.5.5
jakobmoellerdev May 31, 2020
006635d
Hotfix for resetting Gradle Version (internal pipeline confirmation) …
jakobmoellerdev May 31, 2020
7d82e61
Gradle Reset to 0.5.4 (#53)
jakobmoellerdev May 31, 2020
125c6b5
Minify and Shrink Disabled (#56)
jakobmoellerdev May 31, 2020
16c1d9e
Merge remote-tracking branch 'origin/master' into dev
jakobmoellerdev May 31, 2020
90c49ae
0.5.6
jakobmoellerdev May 31, 2020
cb229b6
Update known issues and fixing typo in readme (#44)
harambasicluka Jun 1, 2020
153ee3a
Updated strings, introduced more details on app-information screens (…
marcmuschko Jun 1, 2020
e16d2af
Cleanup pull_request_template.md (#54)
tkowark Jun 2, 2020
9c821d5
Add Support for lower case characters in the teleTAN screen (#66)
kolyaopahle Jun 2, 2020
c7d444b
Correct typos in architecture overview (#67)
robert-scheck Jun 2, 2020
5456dfe
Bluetooth & connection card (#97)
harambasicluka Jun 2, 2020
1fbcd44
Fix typo in class documentation (#71)
MrDyro Jun 2, 2020
1bbbd50
spelling fixes (#87)
ka7 Jun 2, 2020
d965427
Moves creation of notification channel to app startup (#32)
timbrueggenthies Jun 2, 2020
2db640b
Tracing start/stop fix due to missing handling inside tracing (#99)
harambasicluka Jun 2, 2020
b29232b
Switch the DB Password to use the KeyStore MasterKey (#98)
jakobmoellerdev Jun 2, 2020
0302bf9
Shared prefs ktx shorthand (#38)
jakobmoellerdev Jun 2, 2020
11f0adb
Add persistance of timestamp and whether user is allowed to submit ke…
tklingbeil Jun 2, 2020
a4c1e5e
set "enabled" for include_settings_switch_row in notifications settin…
harambasicluka Jun 2, 2020
062abc7
fix #82 (#94)
mseele Jun 2, 2020
fdf0330
Add ShareHelper (#85)
JSteegmueller Jun 2, 2020
1722aff
Replace the current exposure status with a positive result card when …
kolyaopahle Jun 2, 2020
113bad0
Added loading indicator to test result fragment (#100)
kolyaopahle Jun 2, 2020
fbf1a50
Adjusted onboarding flow, adjusted contribution file, small fixes in …
marcmuschko Jun 2, 2020
4511c4c
Submission Contact Fragment & StepView Custom View (#102)
Fabian-K Jun 2, 2020
95ab1c9
Notifications when risk value has changed between low and high. (#76)
htooisap Jun 2, 2020
a66d2eb
added onboarding strings (#109)
marcmuschko Jun 2, 2020
dddaa8b
disable colored output for ktlint (#105)
Fabian-K Jun 2, 2020
fb39fb0
Limit number of keys to be uploaded to server (#107)
tklingbeil Jun 2, 2020
e5e9943
Fix white space, informal language and spelling of Docker in Readme (…
snipem Jun 2, 2020
8f6645e
Update build.gradle (#111)
oemerb Jun 2, 2020
dc216c9
Merge remote-tracking branch 'origin/master' into dev
jakobmoellerdev Jun 2, 2020
fda1599
Build.Gradle Conflict Resolving (0.8.0) (#112)
jakobmoellerdev Jun 2, 2020
472f095
Merge branch 'dev' of github.com:corona-warn-app/cwa-app-android into…
jakobmoellerdev Jun 2, 2020
7570748
Minify and proguard fix (#113)
AlexanderAlferov Jun 2, 2020
5136f5e
Circle progress bar (#96)
harambasicluka Jun 2, 2020
cafc42d
TracingStatusHelper unit test (#114)
htooisap Jun 2, 2020
e1a94be
Prevent screenshot of the app for all activities (#108)
htooisap Jun 2, 2020
09625c5
Feature: Bluetooth callback (#115)
harambasicluka Jun 2, 2020
0b0e544
Added main overview page to main menu (#120)
marcmuschko Jun 3, 2020
7573920
Fixed screen orientation to portrait (#121)
pwoessner Jun 3, 2020
9ed0159
changed local config that a high match can be generated via QR code, …
pwoessner Jun 3, 2020
6a6dbe5
Feature: Translation preparation (#126)
harambasicluka Jun 3, 2020
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
7 changes: 5 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ jobs:
ndk-version: "android-ndk-r21b"
- restore-build-cache
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "Corona-Warn-App/build.gradle" }}
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:
command: ./gradlew quickBuild
environment:
Expand All @@ -26,7 +29,7 @@ jobs:
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "Corona-Warn-App/build.gradle" }}
key: jars-{{ checksum "build.gradle" }}-{{ checksum "Corona-Warn-App/build.gradle" }}-{{ checksum "Server-Protocol-Buffer/build.gradle" }}
- store_artifacts:
path: Corona-Warn-App/build/reports
destination: reports
Expand Down
5 changes: 2 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ Before submitting, please take the time to check the points below and provide so

* [ ] Test your changes as thoroughly as possible before you commit them. Preferably, automate your test by unit/integration tests.
* [ ] If this PR comes from a fork, please [Allow edits from maintainers](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork)
* [ ] Set a speaking title. Format: {task_name} (closes #{issue_number}). For example: Use logger (closes #41)
* [ ] Set a speaking title. Format: {task_name} (closes #{issue_number}). For example: Use logger (closes # 41)
* [ ] [Link your Pull Request to an issue](https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue) (if applicable)
* [ ] Create Work In Progress [WIP] pull requests only if you need clarification or an explicit review before you can continue your work item.
* [ ] Make sure that your PR is not introducing _unncessary_ reformatting (e.g., introduced by on-save hooks in your IDE)
* [ ] Check our [Contribution Guidelines](https://github.com/corona-warn-app/cwa-app-android/blob/master/CONTRIBUTING.md)
* [ ] Make sure that your PR is not introducing _unnecessary_ reformatting (e.g., introduced by on-save hooks in your IDE)

## Description
<!-- Please be brief in describing which issue is solved by your PR or which enhancement it brings -->
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The following rule governs documentation contributions:

## Pull Request Checklist

* Branch from the master branch and, if needed, rebase to the current master branch before submitting your pull request. If it doesn't merge cleanly with master, you may be asked to rebase your changes.
* Branch from the dev branch and ensure it is up to date with the current dev branch before submitting your pull request. If it doesn't merge cleanly with dev, you may be asked to resolve the conflicts. Pull requests to master will be closed.

* Commits should be as small as possible while ensuring that each commit is correct independently (i.e., each commit should compile and pass tests).

Expand Down
9 changes: 2 additions & 7 deletions Corona-Warn-App/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ android {
applicationId 'de.rki.coronawarnapp'
minSdkVersion 23
targetSdkVersion 29
versionCode 4
versionName "0.5.4"
versionCode 7
versionName "0.8.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

buildConfigField "String", "DOWNLOAD_CDN_URL", "\"$DOWNLOAD_CDN_URL\""
Expand Down Expand Up @@ -135,11 +135,6 @@ android {

}

configurations.all {
resolutionStrategy.force "org.antlr:antlr4-runtime:4.7.1"
resolutionStrategy.force "org.antlr:antlr4-tool:4.7.1"
}

dependencies {
api fileTree(dir: 'libs', include: ['play-services-nearby-18.0.2-eap.aar'])
implementation project(":Server-Protocol-Buffer")
Expand Down
7 changes: 6 additions & 1 deletion Corona-Warn-App/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +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
-keepattributes SourceFile,LineNumberTable

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

This file was deleted.

7 changes: 0 additions & 7 deletions Corona-Warn-App/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@
android:exported="false"
android:screenOrientation="fullSensor"
tools:replace="screenOrientation" />

<service
android:name=".notification.ExposureNotificationIntentService"
android:enabled="true"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />

</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,18 +1,95 @@
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() {
class CoronaWarnApplication : Application(), LifecycleObserver,
Application.ActivityLifecycleCallbacks {

companion object {
val TAG: String? = CoronaWarnApplication::class.simpleName
private lateinit var instance: CoronaWarnApplication

/* describes if the app is in foreground
* Initialized to false, because app could also be started by a background job.
* For the cases where the app is started via the launcher icon, the onAppForegrounded
* event will be called, setting it to true
*/
var isAppInForeground = false

fun getAppContext(): Context =
instance.applicationContext
}

override fun onCreate() {
instance = this
NotificationHelper.createNotificationChannel()
super.onCreate()
ProcessLifecycleOwner.get().lifecycle.addObserver(this)
registerActivityLifecycleCallbacks(this)
}

/**
* Callback when the app is open but backgrounded
*/
@OnLifecycleEvent(Lifecycle.Event.ON_STOP)
fun onAppBackgrounded() {
isAppInForeground = false
Log.v(TAG, "App backgrounded")
}

/**
* Callback when the app is foregrounded
*/
@OnLifecycleEvent(Lifecycle.Event.ON_START)
fun onAppForegrounded() {
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()
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.rki.coronawarnapp.exception

class RiskLevelCalculationException(cause: Throwable) :
Exception("an exception occured during risk level calculation", cause)
Exception("an exception occurred during risk level calculation", cause)
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ object WebRequestBuilder {
) =
suspendCoroutine<String> { cont ->
val requestID = UUID.randomUUID()
val getTestResultRequest =
val getTANRequest =
TanRequest(
url,
requestID,
Expand All @@ -203,13 +203,13 @@ object WebRequestBuilder {
Response.Listener { response ->
Log.d(
TAG,
"$requestID: Test Result Request successful"
"$requestID: TAN Request successful"
)
cont.resume(response)
},
RequestErrorListener(requestID, cont)
)
RequestQueueHolder.addToRequestQueue(getTestResultRequest)
RequestQueueHolder.addToRequestQueue(getTANRequest)
Log.d(TAG, "$requestID: Added $url to queue.")
}

Expand Down Expand Up @@ -254,7 +254,7 @@ object WebRequestBuilder {
Response.ErrorListener {
override fun onErrorResponse(error: VolleyError?) {
if (error != null) {
val webRequestException = WebRequestException("an error occured during a webrequest", error)
val webRequestException = WebRequestException("an error occurred during a webrequest", error)
webRequestException.report(de.rki.coronawarnapp.exception.ExceptionCategory.HTTP)
cont.resumeWithException(webRequestException)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class KeySubmissionRequest(
val headers = HashMap<String, String>(super.getHeaders())
if (faked) headers["cwa-fake"] = Math.random().toInt().toString()
else headers["cwa-fake"] = "0"
headers["cwa-authorization"] = "TAN 123456"
headers["cwa-authorization"] = authCode
this.addMarker("headers:$headers")
return headers
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.android.volley.RetryPolicy
import com.android.volley.toolbox.HttpHeaderParser
import de.rki.coronawarnapp.exception.ExceptionCategory.HTTP
import de.rki.coronawarnapp.exception.report
import de.rki.coronawarnapp.service.submission.SubmissionConstants
import org.json.JSONException
import org.json.JSONObject
import java.io.UnsupportedEncodingException
Expand Down Expand Up @@ -37,12 +38,17 @@ class RegistrationTokenRequest(

override fun getBody(): ByteArray {
val body = JSONObject()
val md = MessageDigest.getInstance("SHA-256")
val keyDigest = md.digest(key.toByteArray())

var keyStr = ""
for (b in keyDigest) {
keyStr += String.format("%02x", b)
if (keyType == SubmissionConstants.QR_CODE_KEY_TYPE) {
val md = MessageDigest.getInstance("SHA-256")
val keyDigest = md.digest(key.toByteArray())

for (b in keyDigest) {
keyStr += String.format("%02x", b)
}
} else {
keyStr = key
}

body.put("keyType", keyType)
Expand Down
Loading