diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 0b6fdc1..24b7e80 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -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") diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/repository/DatabaseListConverters.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/repository/DatabaseListConverters.kt index dd5f74f..21c44d9 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/repository/DatabaseListConverters.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/repository/DatabaseListConverters.kt @@ -12,6 +12,12 @@ class DatabaseListConverters { @TypeConverter fun stringToList(value: String): MutableList { if(value.isEmpty()) return mutableListOf() - return Json.decodeFromString>(value) + return try { + Json.decodeFromString>(value) + } catch (e : Exception) { + val list = value.split(",").toMutableList() + val json = listToString(list) + Json.decodeFromString>(json) + } } } \ No newline at end of file diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/MainScreen.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/MainScreen.kt index 1e04c49..7ec21fa 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/MainScreen.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/MainScreen.kt @@ -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) } } }