diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index c9ccec1cd0de..8499c03acd49 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -323,14 +323,12 @@ dependencies { playImplementation(project(Dependencies.Mullvad.billingLib)) implementation(Dependencies.commonsValidator) - implementation(Dependencies.AndroidX.constraintlayout) implementation(Dependencies.AndroidX.coreKtx) implementation(Dependencies.AndroidX.lifecycleRuntimeKtx) implementation(Dependencies.AndroidX.lifecycleViewmodelKtx) implementation(Dependencies.Compose.constrainLayout) implementation(Dependencies.Compose.foundation) implementation(Dependencies.Compose.material3) - implementation(Dependencies.Compose.uiController) implementation(Dependencies.Compose.ui) implementation(Dependencies.Compose.uiUtil) implementation(Dependencies.Compose.destinations) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/SplitTunnelingCell.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/SplitTunnelingCell.kt index db241664d5dd..80b7d107b815 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/SplitTunnelingCell.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/SplitTunnelingCell.kt @@ -77,7 +77,8 @@ fun SplitTunnelingCell( .clickable(onClick = onCellClicked) ) { Image( - painter = icon?.let { iconImage -> BitmapPainter(iconImage) } + painter = + icon?.let { iconImage -> BitmapPainter(iconImage) } ?: painterResource(id = R.drawable.ic_icons_missing), contentDescription = null, modifier = diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/LocationInfo.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/LocationInfo.kt index 97602ed592ee..5bdb448483fc 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/LocationInfo.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/LocationInfo.kt @@ -100,8 +100,7 @@ fun LocationInfo( TransportProtocol.Udp -> stringResource(id = R.string.udp) } "${inAddress.first}:${inAddress.second} $protocol" - } - ?: "" + } ?: "" Text( text = "${stringResource(id = R.string.in_address)} $textInAddress", color = colorExpanded, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/TopBar.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/TopBar.kt index 73bec5f14f1c..319cd9e9542d 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/TopBar.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/TopBar.kt @@ -315,8 +315,7 @@ fun MullvadTopBarWithDeviceName( text = deviceName?.let { stringResource(id = R.string.top_bar_device_name, deviceName) - } - ?: "", + } ?: "", maxLines = 1, overflow = TextOverflow.Ellipsis, style = MaterialTheme.typography.bodySmall, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt index 96f2894a23f2..fa5ce34c775d 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt @@ -248,8 +248,7 @@ private fun DeviceListItem( text = deviceUiState.device.created.parseAsDateTime()?.let { creationDate -> stringResource(id = R.string.created_x, creationDate.formatDate()) - } - ?: "", + } ?: "", style = MaterialTheme.typography.listItemSubText, color = MaterialTheme.colorScheme.onPrimary diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/relaylist/RelayListExtensions.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/relaylist/RelayListExtensions.kt index 71d4701e41dc..6462ed9f4151 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/relaylist/RelayListExtensions.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/relaylist/RelayListExtensions.kt @@ -237,8 +237,7 @@ private fun List.expandItemForSelection( } } } - } - ?: this + } ?: this } private const val MIN_SEARCH_LENGTH = 2 diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/DeviceRepository.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/DeviceRepository.kt index 7df83816e28b..a13c3e9bc98b 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/DeviceRepository.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/DeviceRepository.kt @@ -122,8 +122,7 @@ class DeviceRepository( withTimeoutOrNull(timeoutMillis) { deviceListEvents.onStart { refreshDeviceList(accountToken) }.firstOrNull() ?: DeviceListEvent.Error - } - ?: DeviceListEvent.Error + } ?: DeviceListEvent.Error if (shouldOverrideCache) { updateCache(result, accountToken) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/usecase/OutOfTimeUseCase.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/usecase/OutOfTimeUseCase.kt index ba7ce83172af..267a76f9961d 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/usecase/OutOfTimeUseCase.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/usecase/OutOfTimeUseCase.kt @@ -50,8 +50,7 @@ class OutOfTimeUseCase( private fun TunnelState.isTunnelErrorStateDueToExpiredAccount(): Boolean { return ((this as? TunnelState.Error)?.errorState?.cause as? ErrorStateCause.AuthFailed) - ?.isCausedByExpiredAccount() - ?: false + ?.isCausedByExpiredAccount() ?: false } private fun pastAccountExpiry(): Flow = diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModel.kt index 69a75bea7f25..9b5a6c1e0013 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModel.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModel.kt @@ -94,10 +94,10 @@ class ConnectViewModel( ConnectUiState( location = when (tunnelRealState) { - is TunnelState.Disconnected -> tunnelRealState.location() - ?: lastKnownDisconnectedLocation - is TunnelState.Connecting -> tunnelRealState.location - ?: relayLocation?.location?.location + is TunnelState.Disconnected -> + tunnelRealState.location() ?: lastKnownDisconnectedLocation + is TunnelState.Connecting -> + tunnelRealState.location ?: relayLocation?.location?.location is TunnelState.Connected -> tunnelRealState.location is TunnelState.Disconnecting -> lastKnownDisconnectedLocation is TunnelState.Error -> null diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceRevokedViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceRevokedViewModel.kt index fed739905080..5027d1cf13d3 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceRevokedViewModel.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceRevokedViewModel.kt @@ -38,8 +38,7 @@ class DeviceRevokedViewModel( } else { DeviceRevokedUiState.UNSECURED } - } - ?: flowOf(DeviceRevokedUiState.UNKNOWN) + } ?: flowOf(DeviceRevokedUiState.UNKNOWN) } .stateIn( scope = CoroutineScope(dispatcher), diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/FilterViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/FilterViewModel.kt index bd0703e6ae6f..4a9fb709fde1 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/FilterViewModel.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/FilterViewModel.kt @@ -39,8 +39,7 @@ class FilterViewModel( ) { allProviders, selectedConstraintProviders -> selectedConstraintProviders.toSelectedProviders(allProviders) } - .first() - ?: emptyList() + .first() ?: emptyList() val ownershipConstraint = relayListFilterUseCase.selectedOwnership().first() selectedOwnership.value = ownershipConstraint.toNullableOwnership() diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SplitTunnelingViewModelState.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SplitTunnelingViewModelState.kt index 7e258869fabe..05bc6fb0720a 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SplitTunnelingViewModelState.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SplitTunnelingViewModelState.kt @@ -23,7 +23,6 @@ data class SplitTunnelingViewModelState( .sortedBy { it.name }, showSystemApps = showSystemApps ) - } - ?: SplitTunnelingUiState.Loading + } ?: SplitTunnelingUiState.Loading } } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt index 80b51a811c31..7a7332eb2a2f 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt @@ -67,10 +67,10 @@ class VpnSettingsViewModel( isLocalNetworkSharingEnabled = settings?.allowLan ?: false, isCustomDnsEnabled = settings?.isCustomDnsEnabled() ?: false, customDnsList = settings?.addresses()?.asStringAddressList() ?: listOf(), - contentBlockersOptions = settings?.contentBlockersSettings() - ?: DefaultDnsOptions(), - selectedObfuscation = settings?.selectedObfuscationSettings() - ?: SelectedObfuscation.Off, + contentBlockersOptions = + settings?.contentBlockersSettings() ?: DefaultDnsOptions(), + selectedObfuscation = + settings?.selectedObfuscationSettings() ?: SelectedObfuscation.Off, quantumResistant = settings?.quantumResistant() ?: QuantumResistantState.Off, selectedWireguardPort = settings?.getWireguardPort() ?: Constraint.Any(), customWireguardPort = customWgPort, diff --git a/android/buildSrc/src/main/kotlin/Dependencies.kt b/android/buildSrc/src/main/kotlin/Dependencies.kt index c68e6b417c42..9893cadc167a 100644 --- a/android/buildSrc/src/main/kotlin/Dependencies.kt +++ b/android/buildSrc/src/main/kotlin/Dependencies.kt @@ -19,8 +19,6 @@ object Dependencies { object AndroidX { const val appcompat = "androidx.appcompat:appcompat:${Versions.AndroidX.appcompat}" - const val constraintlayout = - "androidx.constraintlayout:constraintlayout:${Versions.AndroidX.constraintlayout}" const val coreKtx = "androidx.core:core-ktx:${Versions.AndroidX.coreKtx}" const val fragmentTestning = "androidx.fragment:fragment-testing:${Versions.AndroidX.fragment}" @@ -53,8 +51,6 @@ object Dependencies { const val material3 = "androidx.compose.material3:material3:${Versions.Compose.material3}" const val testManifest = "androidx.compose.ui:ui-test-manifest:${Versions.Compose.base}" const val ui = "androidx.compose.ui:ui:${Versions.Compose.base}" - const val uiController = - "com.google.accompanist:accompanist-systemuicontroller:${Versions.Compose.uiController}" const val uiTestManifest = "androidx.compose.ui:ui-test-manifest:${Versions.Compose.base}" const val uiTooling = "androidx.compose.ui:ui-tooling:${Versions.Compose.base}" const val uiToolingAndroidPreview = diff --git a/android/buildSrc/src/main/kotlin/Versions.kt b/android/buildSrc/src/main/kotlin/Versions.kt index 02b2ed4225fc..58aa769cb7b7 100644 --- a/android/buildSrc/src/main/kotlin/Versions.kt +++ b/android/buildSrc/src/main/kotlin/Versions.kt @@ -1,5 +1,5 @@ object Versions { - const val commonsValidator = "1.7" + const val commonsValidator = "1.8.0" const val jodaTime = "2.12.5" const val junit = "5.10.0" const val jvmTarget = "17" @@ -9,7 +9,7 @@ object Versions { const val kotlinx = "1.7.3" const val leakCanary = "2.12" const val mockk = "1.13.8" - const val mockWebserver = "4.11.0" + const val mockWebserver = "4.12.0" const val turbine = "1.0.0" const val billingClient = "6.0.1" @@ -23,10 +23,9 @@ object Versions { object AndroidX { const val appcompat = "1.6.1" - const val coreKtx = "1.9.0" - const val constraintlayout = "2.1.4" + const val coreKtx = "1.12.0" const val espresso = "3.5.1" - const val lifecycle = "2.6.1" + const val lifecycle = "2.7.0" const val fragment = "1.6.1" const val test = "1.5.0" const val testMonitor = "1.6.1" @@ -41,7 +40,6 @@ object Versions { const val constrainLayout = "1.0.1" const val foundation = base const val material3 = "1.1.1" - const val uiController = "0.30.1" } object Plugin { @@ -54,14 +52,14 @@ object Versions { const val dependencyCheck = "8.3.1" const val gradleVersions = "0.47.0" const val junit5 = "1.10.0.0" - const val ktfmt = "0.13.0" + const val ktfmt = "0.16.0" // Ksp version is linked with kotlin version, find matching release here: // https://github.com/google/ksp/releases const val ksp = "${kotlin}-1.0.14" } object Koin { - const val base = "3.4.3" - const val compose = "3.4.6" + const val base = "3.5.3" + const val compose = "3.5.3" } } diff --git a/android/gradle/verification-metadata.xml b/android/gradle/verification-metadata.xml index 7c5730b241f5..05ce1e2cc124 100644 --- a/android/gradle/verification-metadata.xml +++ b/android/gradle/verification-metadata.xml @@ -45,14 +45,6 @@ - - - - - - - - @@ -61,14 +53,6 @@ - - - - - - - - @@ -90,14 +74,6 @@ - - - - - - - - @@ -116,14 +92,6 @@ - - - - - - - - @@ -132,14 +100,6 @@ - - - - - - - - @@ -178,6 +138,9 @@ + + + @@ -431,11 +394,6 @@ - - - - - @@ -704,14 +662,6 @@ - - - - - - - - @@ -736,6 +686,14 @@ + + + + + + + + @@ -765,6 +723,14 @@ + + + + + + + + @@ -872,14 +838,6 @@ - - - - - - - - @@ -888,12 +846,12 @@ - - - + + + - - + + @@ -904,6 +862,14 @@ + + + + + + + + @@ -912,6 +878,14 @@ + + + + + + + + @@ -920,6 +894,14 @@ + + + + + + + + @@ -962,6 +944,14 @@ + + + + + + + + @@ -978,6 +968,14 @@ + + + + + + + + @@ -999,6 +997,14 @@ + + + + + + + + @@ -1033,9 +1039,12 @@ - - - + + + + + + @@ -1054,6 +1063,14 @@ + + + + + + + + @@ -1078,6 +1095,14 @@ + + + + + + + + @@ -1107,6 +1132,14 @@ + + + + + + + + @@ -1128,6 +1161,14 @@ + + + + + + + + @@ -1157,17 +1198,20 @@ - - - + + + + + + - - - + + + - - + + @@ -1186,6 +1230,14 @@ + + + + + + + + @@ -1215,6 +1267,14 @@ + + + + + + + + @@ -1297,11 +1357,6 @@ - - - - - @@ -1447,20 +1502,20 @@ - - - + + + - - + + - - - + + + - - + + @@ -1865,9 +1920,9 @@ - - - + + + @@ -1973,14 +2028,6 @@ - - - - - - - - @@ -2135,6 +2182,11 @@ + + + + + @@ -2271,12 +2323,12 @@ - - - + + + - - + + @@ -2438,12 +2490,12 @@ - - - + + + - - + + @@ -2454,6 +2506,14 @@ + + + + + + + + @@ -2463,8 +2523,13 @@ - - + + + + + + + @@ -2475,6 +2540,14 @@ + + + + + + + + @@ -2540,11 +2613,21 @@ + + + + + + + + + + @@ -2652,68 +2735,68 @@ - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -3187,20 +3270,20 @@ - - - + + + - - + + - - - + + + - - + + @@ -3261,6 +3344,11 @@ + + + + + @@ -3291,6 +3379,11 @@ + + + + + @@ -3481,6 +3574,11 @@ + + + + + @@ -3546,6 +3644,11 @@ + + + + + @@ -3562,6 +3665,17 @@ + + + + + + + + + + + @@ -3577,6 +3691,11 @@ + + + + + @@ -3587,6 +3706,11 @@ + + + + + @@ -3627,6 +3751,11 @@ + + + + + @@ -3652,11 +3781,6 @@ - - - - - @@ -3667,12 +3791,17 @@ - - - + + + - - + + + + + + + @@ -3683,9 +3812,12 @@ - - - + + + + + + @@ -3693,9 +3825,9 @@ - - - + + + @@ -3703,6 +3835,11 @@ + + + + + @@ -3711,6 +3848,14 @@ + + + + + + + + @@ -3831,11 +3976,6 @@ - - - - - @@ -3876,14 +4016,6 @@ - - - - - - - - @@ -3923,6 +4055,11 @@ + + + + + diff --git a/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AccountCache.kt b/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AccountCache.kt index 64459dbfb985..093f13403d27 100644 --- a/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AccountCache.kt +++ b/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AccountCache.kt @@ -44,8 +44,7 @@ class AccountCache(private val endpoint: ServiceEndpoint) { deviceState .token() .also { cachedAccountToken = it } - ?.let { fetchAccountExpiry(it) } - ?: AccountExpiry.Missing + ?.let { fetchAccountExpiry(it) } ?: AccountExpiry.Missing } } diff --git a/android/test/mockapi/src/main/kotlin/net/mullvad/mullvadvpn/test/mockapi/MockApiDispatcher.kt b/android/test/mockapi/src/main/kotlin/net/mullvad/mullvadvpn/test/mockapi/MockApiDispatcher.kt index 821a95f68a67..39818d195ca1 100644 --- a/android/test/mockapi/src/main/kotlin/net/mullvad/mullvadvpn/test/mockapi/MockApiDispatcher.kt +++ b/android/test/mockapi/src/main/kotlin/net/mullvad/mullvadvpn/test/mockapi/MockApiDispatcher.kt @@ -103,8 +103,7 @@ class MockApiDispatcher : Dispatcher() { .setResponseCode(200) .addJsonHeader() .setBody(accountInfoJson(id = DUMMY_ID_1, expiry = expiry).toString()) - } - ?: MockResponse().setResponseCode(400) + } ?: MockResponse().setResponseCode(400) } private fun handleDeviceInfoRequest(deviceId: String): MockResponse { @@ -121,8 +120,7 @@ class MockApiDispatcher : Dispatcher() { ) .toString() ) - } - ?: MockResponse().setResponseCode(400) + } ?: MockResponse().setResponseCode(400) } private fun handleDeviceCreationRequest(body: Buffer): MockResponse { @@ -149,8 +147,7 @@ class MockApiDispatcher : Dispatcher() { .addJsonHeader() .setBody(tooManyDevicesJsonResponse().toString()) } - } - ?: MockResponse().setResponseCode(400) + } ?: MockResponse().setResponseCode(400) } private fun handleDeviceListRequest(): MockResponse { @@ -167,8 +164,7 @@ class MockApiDispatcher : Dispatcher() { ) } MockResponse().setResponseCode(200).addJsonHeader().setBody(body.toString()) - } - ?: MockResponse().setResponseCode(400) + } ?: MockResponse().setResponseCode(400) } private fun handleAccountCreationRequest(): MockResponse { @@ -184,7 +180,6 @@ class MockApiDispatcher : Dispatcher() { ) .toString() ) - } - ?: MockResponse().setResponseCode(400) + } ?: MockResponse().setResponseCode(400) } } diff --git a/android/tile/src/main/kotlin/net/mullvad/mullvadvpn/tile/MullvadTileService.kt b/android/tile/src/main/kotlin/net/mullvad/mullvadvpn/tile/MullvadTileService.kt index d8b1c85a6bf4..ae80bedef8cf 100644 --- a/android/tile/src/main/kotlin/net/mullvad/mullvadvpn/tile/MullvadTileService.kt +++ b/android/tile/src/main/kotlin/net/mullvad/mullvadvpn/tile/MullvadTileService.kt @@ -51,8 +51,7 @@ class MullvadTileService : TileService() { delay(unlockCheckDelayMillis) } return@withTimeoutOrNull true - } - ?: false + } ?: false } unlockAndRun {