Skip to content

Commit

Permalink
Release 1.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Gematik-Entwicklung committed Sep 13, 2023
1 parent 5dfe9e6 commit f9b6f0f
Show file tree
Hide file tree
Showing 60 changed files with 925 additions and 396 deletions.
4 changes: 4 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Release 1.14.0
- Allow devices without NFC to authenticate using 3rd party health insurance apps
- Lots of bugfixes

# Release 1.13.0-RC1
- Fasttrack authentication with external insurance apps works again
- Bugfixes
Expand Down
29 changes: 8 additions & 21 deletions android/src/main/java/de/gematik/ti/erp/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package de.gematik.ti.erp.app

import android.app.Activity
import android.content.Intent
import android.content.SharedPreferences
import android.nfc.NfcAdapter
import android.nfc.Tag
import android.os.Bundle
Expand Down Expand Up @@ -63,7 +62,6 @@ import de.gematik.ti.erp.app.cardwall.ui.ExternalAuthenticatorListViewModel
import de.gematik.ti.erp.app.core.LocalActivity
import de.gematik.ti.erp.app.core.LocalAuthenticator
import de.gematik.ti.erp.app.core.MainContent
import de.gematik.ti.erp.app.di.ApplicationPreferencesTag
import de.gematik.ti.erp.app.mainscreen.ui.MainScreen
import de.gematik.ti.erp.app.apicheck.usecase.CheckVersionUseCase
import de.gematik.ti.erp.app.cardwall.mini.ui.SecureHardwarePrompt
Expand Down Expand Up @@ -93,8 +91,6 @@ import org.kodein.di.bindSingleton
import org.kodein.di.compose.withDI
import org.kodein.di.instance

const val ScreenshotsAllowed = "SCREENSHOTS_ALLOWED"

class NfcNotEnabledException : IllegalStateException()

class MainActivity : AppCompatActivity(), DIAware {
Expand All @@ -116,20 +112,6 @@ class MainActivity : AppCompatActivity(), DIAware {

private val analytics: Analytics by instance()

private val appPrefs: SharedPreferences by instance(ApplicationPreferencesTag)

private val appPrefsListener: SharedPreferences.OnSharedPreferenceChangeListener =
SharedPreferences.OnSharedPreferenceChangeListener { sharedPrefs, key ->
if (key == ScreenshotsAllowed) {
// `gemSpec_eRp_FdV A_20203` default settings are not allow screenshots
if (sharedPrefs.getBoolean(ScreenshotsAllowed, false)) {
this.window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
} else {
this.window?.addFlags(WindowManager.LayoutParams.FLAG_SECURE)
}
}
}

private val intentHandler = IntentHandler(this)

private val _nfcTag = MutableSharedFlow<Tag>()
Expand Down Expand Up @@ -173,8 +155,6 @@ class MainActivity : AppCompatActivity(), DIAware {
installMessageConversionExceptionHandler()
}

appPrefs.registerOnSharedPreferenceChangeListener(appPrefsListener)

WindowCompat.setDecorFitsSystemWindows(window, false)

setContent {
Expand All @@ -192,7 +172,14 @@ class MainActivity : AppCompatActivity(), DIAware {
) {
val authenticator = LocalAuthenticator.current

MainContent { settingscontroller ->
MainContent { settingsController ->
val screenShotState by settingsController.screenshotState

if (screenShotState.screenshotsAllowed) {
this.window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
} else {
this.window.addFlags(WindowManager.LayoutParams.FLAG_SECURE)
}
val auth by produceState<AuthenticationModeAndMethod?>(null) {
launch {
authenticationModeAndMethod.distinctUntilChangedBy { it::class }
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/java/de/gematik/ti/erp/app/Navigation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ object AppNavTypes {
}

@Immutable
open class Route(private val path: String, vararg arguments: NamedNavArgument, val badgeCount: Int = 1) {
open class Route(private val path: String, vararg arguments: NamedNavArgument) {
val route = arguments.fold(Uri.Builder().path(path)) { uri, param ->
uri.appendQueryParameter(param.name, "{${param.name}}")
}.build().toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,7 @@ fun CardWallScreen(
val cardWallController = rememberCardWallController()
val navController = rememberNavController()

val startDestination = when {
cardWallController.hardwareRequirementsFulfilled -> CardWallNavigation.Intro.path()
else -> CardWallNavigation.MissingCapabilities.path()
}
val startDestination = CardWallNavigation.Intro.path()

val context = LocalContext.current
val biometricMode = remember { deviceStrongBiometricStatus(context) }
Expand Down Expand Up @@ -197,7 +194,8 @@ fun CardWallScreen(
onClickAlternateAuthentication = {
navController.navigate(CardWallNavigation.ExternalAuthenticator.path())
},
onClickOrderNow = { navController.navigate(CardWallNavigation.OrderHealthCard.path()) }
onClickOrderNow = { navController.navigate(CardWallNavigation.OrderHealthCard.path()) },
nfcEnabled = cardWallController.isNFCEnabled()
)
}
}
Expand All @@ -206,10 +204,6 @@ fun CardWallScreen(
HealthCardContactOrderScreen(onBack = onBack)
}

composable(CardWallNavigation.MissingCapabilities.route) {
CardWallMissingCapabilities()
}

composable(
CardWallNavigation.CardAccessNumber.route,
CardWallNavigation.CardAccessNumber.arguments
Expand Down
Loading

0 comments on commit f9b6f0f

Please sign in to comment.