Skip to content

Commit

Permalink
fix: trusted SSIDs bug
Browse files Browse the repository at this point in the history
Fixes bugs where trusted SSIDs were getting whitespace added every time they were saved to the DB.

Fixes file explorer bug on AndroidTV where the app crashes if they do not have a file explorer installed on the device.
  • Loading branch information
zaneschepke committed Sep 25, 2023
1 parent 7fbc51a commit 11aea3f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId = "com.zaneschepke.wireguardautotunnel"
minSdk = 26
targetSdk = 34
versionCode = 30001
versionName = "3.0.1"
versionCode = 30002
versionName = "3.0.2"

multiDexEnabled = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import androidx.room.TypeConverter
class DatabaseListConverters {
@TypeConverter
fun listToString(value: MutableList<String>): String {
return value.joinToString()
return value.joinToString(",")
}
@TypeConverter
fun <T> stringToList(value: String): MutableList<String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ fun MainScreen(
addCategory(Intent.CATEGORY_OPENABLE)
type = Constants.ALLOWED_FILE_TYPES
}
pickFileLauncher.launch(fileSelectionIntent)
if (fileSelectionIntent.resolveActivity(context.packageManager) != null) {
pickFileLauncher.launch(fileSelectionIntent)
} else {
viewModel.showSnackBarMessage(context.getString(R.string.no_file_app))
}
}
.padding(10.dp)
) {
Expand Down Expand Up @@ -271,7 +275,7 @@ fun MainScreen(
.nestedScroll(nestedScrollConnection),
) {
items(tunnels, key = { tunnel -> tunnel.id }) {tunnel ->
val focusRequester = FocusRequester()
val focusRequester = remember { FocusRequester() }
RowListItem(leadingIcon = Icons.Rounded.Circle,
leadingIconColor = if (tunnelName == tunnel.name) when (handshakeStatus) {
HandshakeStatus.HEALTHY -> mint
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,5 @@
<string name="never">Never</string>
<string name="stream_failed">Failed to open file stream.</string>
<string name="unknown_error_message">An unknown error occurred.</string>
<string name="no_file_app">No file app installed.</string>
</resources>

0 comments on commit 11aea3f

Please sign in to comment.