Skip to content

Commit

Permalink
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -14,8 +14,8 @@ android {
applicationId = "com.zaneschepke.wireguardautotunnel"
minSdk = 26
targetSdk = 34
versionCode = 31900
versionName = "3.1.9"
versionCode = 32000
versionName = "3.2.0"

ksp {
arg("room.schemaLocation", "$projectDir/schemas")
Original file line number Diff line number Diff line change
@@ -12,6 +12,12 @@ class DatabaseListConverters {
@TypeConverter
fun stringToList(value: String): MutableList<String> {
if(value.isEmpty()) return mutableListOf()
return Json.decodeFromString<MutableList<String>>(value)
return try {
Json.decodeFromString<MutableList<String>>(value)
} catch (e : Exception) {
val list = value.split(",").toMutableList()
val json = listToString(list)
Json.decodeFromString<MutableList<String>>(json)
}
}
}
Original file line number Diff line number Diff line change
@@ -159,8 +159,8 @@ fun MainScreen(
scope.launch(Dispatchers.IO) {
try {
viewModel.onTunnelFileSelected(data)
} catch (e : Exception) {
showSnackbarMessage(e.message ?: context.getString(R.string.unknown_error))
} catch (e : WgTunnelException) {
showSnackbarMessage(e.message)
}
}
}
@@ -171,8 +171,8 @@ fun MainScreen(
scope.launch {
try {
viewModel.onTunnelQrResult(it.contents)
} catch (e: Exception) {
showSnackbarMessage(context.getString(R.string.qr_result_failed))
} catch (e: WgTunnelException) {
showSnackbarMessage(e.message)
}
}
}

0 comments on commit e0cce8f

Please sign in to comment.