Compare commits
5 Commits
b5dbf92b9b
...
f365bfd883
Author | SHA1 | Date |
---|---|---|
dankito | f365bfd883 | |
dankito | c6f93e1d85 | |
dankito | af3dd02509 | |
dankito | 3b72d95234 | |
dankito | abc9ceb29e |
|
@ -23,5 +23,6 @@ xcuserdata
|
|||
**/xcshareddata/WorkspaceSettings.xcsettings
|
||||
**/*.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
|
||||
|
||||
composeApp/release/
|
||||
composeApp/data/
|
||||
BankingPersistence/data/
|
||||
|
|
|
@ -6,6 +6,9 @@ import app.cash.sqldelight.db.SqlDriver
|
|||
import app.cash.sqldelight.db.SqlSchema
|
||||
import app.cash.sqldelight.driver.jdbc.sqlite.JdbcSqliteDriver
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
import kotlin.io.path.Path
|
||||
import kotlin.io.path.absolutePathString
|
||||
|
||||
|
||||
val dataDirectory: File = determineDataDirectory()
|
||||
|
@ -27,10 +30,11 @@ actual fun createSqlDriverDriver(dbName: String, schema: SqlSchema<QueryResult.A
|
|||
|
||||
|
||||
private fun determineDataDirectory(): File {
|
||||
val currentDir = File(System.getProperty("user.dir"))
|
||||
val currentDir = Path(System.getProperty("user.dir"))
|
||||
|
||||
val dataDir = if (currentDir.canWrite()) { // if the current directory is writable, use that one (the default for development)
|
||||
File(currentDir, "data")
|
||||
// if the current directory is writable, use that one (the default for development)
|
||||
val dataDir = if (Files.isWritable(currentDir)) { // couldn't believe it, but java.io.File returned folder is writable for "C:\\Program Files\\"
|
||||
File(currentDir.absolutePathString(), "data")
|
||||
} else { // otherwise use .bankmeister dir in user's home dir (the default for releases)
|
||||
val userHome = System.getProperty("user.home")
|
||||
File(userHome, ".bankmeister")
|
||||
|
|
|
@ -142,8 +142,8 @@ android {
|
|||
applicationId = "net.codinux.banking.android" // the appId of the old Bankmeister app to be able to use the old PlayStore entry
|
||||
minSdk = libs.versions.android.minSdk.get().toInt()
|
||||
targetSdk = libs.versions.android.targetSdk.get().toInt()
|
||||
versionCode = 11
|
||||
versionName = "1.0.0-Alpha-13"
|
||||
versionCode = 12
|
||||
versionName = "1.0.0-Alpha-14"
|
||||
}
|
||||
packaging {
|
||||
resources {
|
||||
|
@ -195,7 +195,7 @@ compose.desktop {
|
|||
modules("java.sql", "java.naming") // java.naming is required by logback
|
||||
|
||||
packageName = "Bankmeister"
|
||||
packageVersion = "1.0.0"
|
||||
packageVersion = "1.0.0" // minor version < 1 (DMG) and dashes as in '1.0.0-Alpha-14' (RPM) are not allowed
|
||||
description = "Datenschutzfreundliche Multi-Banking App für die meisten deutschen Banken"
|
||||
copyright = "© 2024 codinux GmbH & Co.KG. All rights reserved."
|
||||
vendor = "codinux GmbH & Co.KG"
|
||||
|
@ -207,6 +207,13 @@ compose.desktop {
|
|||
iconFile = project.file("../docs/res/AppIcons/distributions/AppIcon.icns")
|
||||
}
|
||||
windows {
|
||||
// a unique ID, which enables users to update an app via installer, when an updated version is newer, than an installed version.
|
||||
// The value must remain constant for a single application. See [the link](https://wixtoolset.org/documentation/manual/v3/howtos/general/generate_guids.html) for details on generating a UUID.
|
||||
upgradeUuid = "F62896E2-382E-4311-9683-1AB3AA4EB9E7"
|
||||
|
||||
menu = true
|
||||
msiPackageVersion = "0.9.0"
|
||||
|
||||
iconFile = project.file("../docs/res/AppIcons/distributions/AppIcon.ico")
|
||||
}
|
||||
linux {
|
||||
|
|
|
@ -31,23 +31,24 @@ fun App(repository: BankingRepository? = null) {
|
|||
val colors = MaterialTheme.colors.copy(primary = Colors.Primary, primaryVariant = Colors.PrimaryDark, onPrimary = Color.White,
|
||||
secondary = Colors.Accent, secondaryVariant = Colors.Accent, onSecondary = Color.White)
|
||||
|
||||
val appSettings = DI.uiState.appSettings.collectAsState().value
|
||||
|
||||
var isLoggedIn by remember(appSettings.authenticationMethod) { mutableStateOf(appSettings.authenticationMethod == AppAuthenticationMethod.None) }
|
||||
|
||||
var isInitialized by remember { mutableStateOf(false) }
|
||||
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
|
||||
try {
|
||||
if (isInitialized == false) {
|
||||
DI.setRepository(repository ?: SqliteBankingRepository())
|
||||
DI.setRepository(repository ?: SqliteBankingRepository()) // setting repository sets AppSettings, which is required below to determine if user needs to log in
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
Log.error(e) { "Could not set repository" }
|
||||
}
|
||||
|
||||
|
||||
val appSettings = DI.uiState.appSettings.collectAsState().value
|
||||
|
||||
var isLoggedIn by remember(appSettings.authenticationMethod) { mutableStateOf(appSettings.authenticationMethod == AppAuthenticationMethod.None) }
|
||||
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
|
||||
|
||||
MaterialTheme(colors = colors, typography = typography) {
|
||||
if (isLoggedIn == false) {
|
||||
LoginScreen(appSettings) {
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 100 KiB |
Loading…
Reference in New Issue