Skip to content

Commit

Permalink
Release 1.18.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Gematik-Entwicklung committed Jan 23, 2024
1 parent 3a3af37 commit 86fbccd
Show file tree
Hide file tree
Showing 218 changed files with 7,470 additions and 5,179 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ documentation-internal
android/src/androidTest
technical_requirements_report.html
keystore
CODEOWNERS
local.cliactions.yaml
34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,30 @@ This repository is an [Kotlin Multiplatform Project](https://kotlinlang.org/docs
### Structure

```text
|-- android
| `-- src
| |-- androidTest
| |-- debug
| |-- main
| |-- release
| |-- sharedTest
| `-- test
|-- app
| `-- android
| `-- src
| |-- androidTest
| |-- main
| `-- test
| `-- android-mock
| `-- src
| |-- androidTest
| |-- main
| `-- test
| `-- demo-mode
| `-- src
| |-- main
| `-- features
| `-- src
| |-- debug
| |-- release
| |-- androidTest
| |-- main
| `-- test
| `-- shared-test
| `-- src
| |-- main
|-- common
| `-- src
| |-- androidMain
Expand Down Expand Up @@ -95,7 +111,7 @@ gradle :android:assemble(Google|Huawei)Pu(External|Internal)(Debug|Release) -Pbu

*Note: Currently the android build variant is derived from the `buildkonfig.flavor` property.*

The resulting `.apk` can be found in e.g. `android/build/outputs/apk/googlePuExternal/debug/`.
The resulting `.apk` can be found in e.g. `app/android/build/outputs/apk/googlePuExternal/debug/`.

#### Visualize Test Tags

Expand Down
6 changes: 6 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Release 1.18.1
- Optimized performance
- UX improvements
- Bug fixes


# Release 1.17.2
- Added Demo mode function
- Added function to change the name of scanned prescriptions
Expand Down
3 changes: 3 additions & 0 deletions app/android-mock/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ android {
resValue("string", "app_label", "E-Rezept Mock")
versionNameSuffix = "-debug"
}
create("minifiedDebug") {
initWith(debug)
}
}

packagingOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ package de.gematik.ti.erp.app
import androidx.lifecycle.ProcessLifecycleOwner
import com.contentsquare.android.Contentsquare
import com.tom_roush.pdfbox.android.PDFBoxResourceLoader
import de.gematik.ti.erp.app.di.allModules
import de.gematik.ti.erp.app.userauthentication.ui.AuthenticationUseCase
import de.gematik.ti.erp.app.di.appModules
import de.gematik.ti.erp.app.di.mockFeatureModule
import de.gematik.ti.erp.app.userauthentication.observer.InactivityTimeoutObserver
import de.gematik.ti.erp.app.userauthentication.observer.ProcessLifecycleObserver
import io.github.aakira.napier.DebugAntilog
import io.github.aakira.napier.Napier
import org.kodein.di.DI
Expand All @@ -21,25 +23,26 @@ class DefaultErezeptMockApp : ErezeptApp(), DIAware {

override val di by DI.lazy {
import(androidXModule(this@DefaultErezeptMockApp))
importAll(allModules)
bindSingleton { AuthenticationUseCase(instance()) }
importAll(appModules)
importAll(mockFeatureModule, allowOverride = true)
bindSingleton { InactivityTimeoutObserver(instance(), instance()) }
bindSingleton { ProcessLifecycleObserver(ProcessLifecycleOwner, instance()) }
bindSingleton { VisibleDebugTree() }
}

private val authUseCase: AuthenticationUseCase by instance()
private val processLifecycleObserver: ProcessLifecycleObserver by instance()

private val visibleDebugTree: VisibleDebugTree by instance()

override fun onCreate() {
super.onCreate()
if (BuildKonfig.INTERNAL) {
Napier.base(DebugAntilog())
Napier.base(visibleDebugTree)
}
ProcessLifecycleOwner.get().lifecycle.apply {
addObserver(authUseCase)
}
Napier.base(DebugAntilog())
Napier.base(visibleDebugTree)

processLifecycleObserver.observeForInactivity()

PDFBoxResourceLoader.init(this)

Contentsquare.start(this)
}
}
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
package de.gematik.ti.erp.app.di

import android.content.Context
import androidx.security.crypto.EncryptedSharedPreferences
import androidx.security.crypto.MasterKey
import de.gematik.ti.erp.app.DispatchProvider
import de.gematik.ti.erp.app.Requirement
import de.gematik.ti.erp.app.analytics.Analytics
import de.gematik.ti.erp.app.analytics.usecase.AnalyticsUseCase
import de.gematik.ti.erp.app.attestation.usecase.integrityModule
import de.gematik.ti.erp.app.cardunlock.cardUnlockModule
import de.gematik.ti.erp.app.cardwall.cardWallModule
import de.gematik.ti.erp.app.featuretoggle.FeatureToggleManager
import de.gematik.ti.erp.app.idp.idpModule
import de.gematik.ti.erp.app.orderhealthcard.orderHealthCardModule
import de.gematik.ti.erp.app.orders.messagesModule
import de.gematik.ti.erp.app.pharmacy.pharmacyMockModule
import de.gematik.ti.erp.app.pkv.pkvModule
import de.gematik.ti.erp.app.prescription.prescriptionModule
import de.gematik.ti.erp.app.prescription.taskModule
import de.gematik.ti.erp.app.profiles.profilesModule
import de.gematik.ti.erp.app.protocol.protocolModule
import de.gematik.ti.erp.app.redeem.redeemModule
import de.gematik.ti.erp.app.settings.settingsModule
import de.gematik.ti.erp.app.vau.vauModule
import org.kodein.di.DI
import org.kodein.di.bindProvider
import org.kodein.di.bindSingleton
import org.kodein.di.instance

/*
* Copyright (c) 2024 gematik GmbH
*
Expand All @@ -46,6 +16,22 @@ import org.kodein.di.instance
*
*/

package de.gematik.ti.erp.app.di

import android.content.Context
import androidx.security.crypto.EncryptedSharedPreferences
import androidx.security.crypto.MasterKey
import de.gematik.ti.erp.app.DispatchProvider
import de.gematik.ti.erp.app.analytics.Analytics
import de.gematik.ti.erp.app.analytics.usecase.AnalyticsUseCase
import de.gematik.ti.erp.app.featuretoggle.FeatureToggleManager
import de.gematik.ti.erp.app.info.mockBuildConfigurationModule
import de.gematik.ti.erp.app.pkv.mockFileProviderAuthorityModule
import org.kodein.di.DI
import org.kodein.di.bindProvider
import org.kodein.di.bindSingleton
import org.kodein.di.instance

private const val PREFERENCES_FILE_NAME = "appPrefs"
private const val NETWORK_SECURE_PREFS_FILE_NAME = "networkingSecurePrefs"
private const val NETWORK_PREFS_FILE_NAME = "networkingPrefs"
Expand All @@ -55,12 +41,7 @@ const val ApplicationPreferencesTag = "ApplicationPreferences"
const val NetworkPreferencesTag = "NetworkPreferences"
const val NetworkSecurePreferencesTag = "NetworkSecurePreferences"

@Requirement(
"A_20184#1",
sourceSpecification = "gemSpec_eRp_FdV",
rationale = "Bind EncryptedSharedPreferences."
)
val allModules = DI.Module("allModules") {
val appModules = DI.Module("appModules") {
bindSingleton<DispatchProvider> { object : DispatchProvider {} }
bindSingleton(ApplicationPreferencesTag) {
val context = instance<Context>()
Expand Down Expand Up @@ -89,25 +70,10 @@ val allModules = DI.Module("allModules") {

bindProvider { AnalyticsUseCase(instance()) }

bindSingleton { Analytics(instance(), instance(ApplicationPreferencesTag), instance()) }
bindSingleton { Analytics(instance(), instance(), instance(), instance()) }

importAll(
cardWallModule,
integrityModule,
networkModule,
realmModule,
idpModule,
messagesModule,
orderHealthCardModule,
pharmacyMockModule,
redeemModule,
prescriptionModule,
profilesModule,
protocolModule,
taskModule,
settingsModule,
vauModule,
cardUnlockModule,
pkvModule
mockBuildConfigurationModule,
mockFileProviderAuthorityModule
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the EUPL, Version 1.2 or – as soon they will be approved by
* the European Commission - subsequent versions of the EUPL (the Licence);
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* https://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*
*/

package de.gematik.ti.erp.app.di

import de.gematik.ti.erp.app.appsecurity.appSecurityModule
import de.gematik.ti.erp.app.authentication.di.authenticationModule
import de.gematik.ti.erp.app.cardunlock.cardUnlockModule
import de.gematik.ti.erp.app.cardwall.cardWallModule
import de.gematik.ti.erp.app.idp.idpModule
import de.gematik.ti.erp.app.idp.idpUseCaseModule
import de.gematik.ti.erp.app.orderhealthcard.orderHealthCardModule
import de.gematik.ti.erp.app.orders.messageRepositoryModule
import de.gematik.ti.erp.app.orders.messagesModule
import de.gematik.ti.erp.app.pharmacy.di.pharmacyRepositoryModule
import de.gematik.ti.erp.app.pharmacy.pharmacyMockModule
import de.gematik.ti.erp.app.pkv.pkvModule
import de.gematik.ti.erp.app.prescription.prescriptionModule
import de.gematik.ti.erp.app.prescription.prescriptionRepositoryModule
import de.gematik.ti.erp.app.prescription.taskModule
import de.gematik.ti.erp.app.prescription.taskRepositoryModule
import de.gematik.ti.erp.app.profiles.profileRepositoryModule
import de.gematik.ti.erp.app.profiles.profilesModule
import de.gematik.ti.erp.app.protocol.protocolModule
import de.gematik.ti.erp.app.protocol.protocolRepositoryModule
import de.gematik.ti.erp.app.redeem.redeemModule
import de.gematik.ti.erp.app.settings.settingsModule
import de.gematik.ti.erp.app.vau.vauModule
import org.kodein.di.DI

val mockFeatureModule = DI.Module("featureModule", allowSilentOverride = true) {
importAll(
cardWallModule,
appSecurityModule,
networkModule,
realmModule,
idpModule,
idpUseCaseModule,
messagesModule,
orderHealthCardModule,
redeemModule,
prescriptionModule,
profilesModule,
protocolModule,
taskModule,
settingsModule,
vauModule,
cardUnlockModule,
pkvModule,
authenticationModule,
profileRepositoryModule,
prescriptionRepositoryModule,
protocolRepositoryModule,
pharmacyRepositoryModule,
messageRepositoryModule,
taskRepositoryModule,
// mocked modules
pharmacyMockModule,
allowOverride = true
)
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright (c) 2024 gematik GmbH
*
* Licensed under the EUPL, Version 1.2 or – as soon they will be approved by
* the European Commission - subsequent versions of the EUPL (the Licence);
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* https://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*
*/

package de.gematik.ti.erp.app.info

import android.content.Context
import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
import de.gematik.ti.erp.app.mock.BuildConfig
import java.util.Locale

private const val DARK_THEME_ON = "an"
private const val DARK_THEME_OFF = "aus"
private const val RELEASE_CANDIDATE = "RC"
private const val SEPARATOR = "-"
private const val SPACE = " "

class MockBuildConfigInformation : BuildConfigInformation {

override fun versionName(): String {
BuildConfig.VERSION_NAME.split(RELEASE_CANDIDATE)
.takeIf {
it.size > 1
}?.let { splits ->
val secondSplit = splits[1].split(SEPARATOR)
if (secondSplit.size > 1) {
// Removes the R from R1.20.23 and makes it 1.20.23
val tag = splits[0].drop(1)
// Takes a 6z&hj4f58dzf9j0890hfj4938that509z97h and makes it 6z&hj4f58
val truncatedCommitHash = secondSplit[1].take(9)
// RC-1 or RC-2
val releaseCandidateNumber = secondSplit[0]
return listOf(
tag,
RELEASE_CANDIDATE,
SEPARATOR,
releaseCandidateNumber,
SEPARATOR,
truncatedCommitHash,
SPACE,
"(${BuildConfig.VERSION_CODE})"
).joinToString(separator = "")
}
}
return "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})"
}

override fun versionCode(): String = "${BuildConfig.VERSION_CODE}"
override fun model(): String = "${Build.MANUFACTURER} ${Build.MODEL} (${Build.PRODUCT})"
override fun language(): String = Locale.getDefault().displayName

@Composable
override fun inDarkTheme(): String = if (isSystemInDarkTheme()) DARK_THEME_ON else DARK_THEME_OFF
override fun nfcInformation(context: Context): String = "nicht vorhanden"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
*
*/

package de.gematik.ti.erp.app.attestation.usecase
package de.gematik.ti.erp.app.info

import org.kodein.di.DI
import org.kodein.di.bindProvider
import org.kodein.di.bind
import org.kodein.di.instance

val integrityModule = DI.Module("integrityModule") {
bindProvider { IntegrityUseCase(instance()) }
val mockBuildConfigurationModule = DI.Module("mockBuildConfigurationModule") {
bind<BuildConfigInformation>() with instance(MockBuildConfigInformation())
}
Loading

0 comments on commit 86fbccd

Please sign in to comment.