mirror of
https://github.com/wgtunnel/android.git
synced 2026-07-03 14:07:49 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 756d7cbea0 | |||
| 8a3d781bb3 | |||
| 99cd1d917a | |||
| 7940b97329 | |||
| 99419ebe9f | |||
| 3e2ffc1b64 |
@@ -76,7 +76,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
@@ -191,7 +191,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
+14
-11
@@ -138,19 +138,22 @@ constructor(
|
||||
}
|
||||
|
||||
val host =
|
||||
{
|
||||
val parts = allowedIpStr.split("/")
|
||||
val internalIp = if (parts.size == 2) parts[0] else allowedIpStr
|
||||
tunnelConf.pingTarget
|
||||
?: {
|
||||
val parts = allowedIpStr.split("/")
|
||||
val internalIp =
|
||||
if (parts.size == 2) parts[0] else allowedIpStr
|
||||
|
||||
val prefix =
|
||||
if (parts.size == 2) parts[1].toIntOrNull() ?: 32 else 32
|
||||
if (prefix <= 1) {
|
||||
tunnelConf.pingTarget ?: CLOUDFLARE_IPV4_IP
|
||||
} else {
|
||||
internalIp.removeSurrounding("[", "]")
|
||||
val prefix =
|
||||
if (parts.size == 2) parts[1].toIntOrNull() ?: 32
|
||||
else 32
|
||||
if (prefix <= 1) {
|
||||
CLOUDFLARE_IPV4_IP
|
||||
} else {
|
||||
internalIp.removeSurrounding("[", "]")
|
||||
}
|
||||
}
|
||||
}
|
||||
.invoke()
|
||||
.invoke()
|
||||
|
||||
val attemptTime = System.currentTimeMillis()
|
||||
runCatching {
|
||||
|
||||
+8
-6
@@ -38,13 +38,13 @@ class GitHubUpdateRepository(
|
||||
gitHubApi.getLatestRelease(githubOwner, githubRepo).onFailure(Timber::e)
|
||||
}
|
||||
release.map { release ->
|
||||
val apkAsset =
|
||||
val standaloneApkAsset =
|
||||
release.assets.find { asset ->
|
||||
asset.name.startsWith("wgtunnel-${Constants.STANDALONE_FLAVOR}-v") &&
|
||||
asset.name.endsWith(".apk")
|
||||
asset.name.endsWith(".apk")
|
||||
}
|
||||
val newVersion =
|
||||
apkAsset
|
||||
standaloneApkAsset
|
||||
?.name
|
||||
?.removePrefix("wgtunnel-${Constants.STANDALONE_FLAVOR}-v")
|
||||
?.removeSuffix(".apk") ?: return@map null
|
||||
@@ -53,7 +53,9 @@ class GitHubUpdateRepository(
|
||||
if (isNightly && newVersion != currentVersion)
|
||||
return@map GitHubReleaseMapper.toAppUpdate(release, newVersion)
|
||||
if (NumberUtils.compareVersions(newVersion, currentVersion) > 0) {
|
||||
GitHubReleaseMapper.toAppUpdate(release, newVersion)
|
||||
GitHubReleaseMapper.toAppUpdate(release.copy(
|
||||
assets = listOf(standaloneApkAsset)
|
||||
), newVersion)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
@@ -63,7 +65,7 @@ class GitHubUpdateRepository(
|
||||
override suspend fun downloadApk(
|
||||
apkUrl: String,
|
||||
fileName: String,
|
||||
onProgress: (Float) -> Unit,
|
||||
onProgress: suspend (Float) -> Unit,
|
||||
): Result<File> =
|
||||
withContext(ioDispatcher) {
|
||||
try {
|
||||
@@ -101,4 +103,4 @@ class GitHubUpdateRepository(
|
||||
Result.failure(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -9,6 +9,6 @@ interface UpdateRepository {
|
||||
suspend fun downloadApk(
|
||||
apkUrl: String,
|
||||
fileName: String,
|
||||
onProgress: (Float) -> Unit,
|
||||
onProgress: suspend (Float) -> Unit,
|
||||
): Result<File>
|
||||
}
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ fun ConfigScreen(
|
||||
if (save) {
|
||||
try {
|
||||
appViewModel.handleEvent(
|
||||
AppEvent.SaveTunnelUniquely(
|
||||
AppEvent.SaveTunnel(
|
||||
uiState.configProxy.buildTunnelConfFromState(uiState.tunnelName, tunnelConf)
|
||||
)
|
||||
)
|
||||
|
||||
+8
-2
@@ -4,21 +4,25 @@ import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.zaneschepke.wireguardautotunnel.BuildConfig
|
||||
import com.zaneschepke.wireguardautotunnel.R
|
||||
import com.zaneschepke.wireguardautotunnel.di.MainDispatcher
|
||||
import com.zaneschepke.wireguardautotunnel.domain.model.AppUpdate
|
||||
import com.zaneschepke.wireguardautotunnel.domain.repository.UpdateRepository
|
||||
import com.zaneschepke.wireguardautotunnel.util.FileUtils
|
||||
import com.zaneschepke.wireguardautotunnel.util.StringValue
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import jakarta.inject.Inject
|
||||
import kotlinx.coroutines.CoroutineDispatcher
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
@HiltViewModel
|
||||
class SupportViewModel
|
||||
@Inject
|
||||
constructor(private val updateRepository: UpdateRepository, private val fileUtils: FileUtils) :
|
||||
constructor(private val updateRepository: UpdateRepository, private val fileUtils: FileUtils,
|
||||
@MainDispatcher private val mainDispatcher: CoroutineDispatcher) :
|
||||
ViewModel() {
|
||||
|
||||
private val _uiState = MutableStateFlow(SupportUiState())
|
||||
@@ -62,7 +66,9 @@ constructor(private val updateRepository: UpdateRepository, private val fileUtil
|
||||
_uiState.update { it.copy(isLoading = true) }
|
||||
updateRepository
|
||||
.downloadApk(appUpdate.apkUrl, appUpdate.apkFileName) { progress ->
|
||||
_uiState.update { it.copy(downloadProgress = progress) }
|
||||
withContext(mainDispatcher) {
|
||||
_uiState.update { it.copy(downloadProgress = progress) }
|
||||
}
|
||||
}
|
||||
.onSuccess { apk ->
|
||||
_uiState.update { it.copy(isLoading = false) }
|
||||
|
||||
@@ -263,7 +263,7 @@ constructor(
|
||||
saveSettings(
|
||||
state.appSettings.copy(tunnelPingTimeoutSeconds = event.timeout)
|
||||
)
|
||||
is AppEvent.SaveTunnelUniquely -> saveTunnelsUniquely(listOf(event.tunnel))
|
||||
is AppEvent.SaveTunnel -> saveTunnel(event.tunnel)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ sealed class AppEvent {
|
||||
|
||||
data class SetTheme(val theme: Theme) : AppEvent()
|
||||
|
||||
data class SaveTunnelUniquely(val tunnel: TunnelConf) : AppEvent()
|
||||
data class SaveTunnel(val tunnel: TunnelConf) : AppEvent()
|
||||
|
||||
data class SaveMonitoringSettings(
|
||||
val pingInterval: Int,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
object Constants {
|
||||
const val VERSION_NAME = "3.9.4"
|
||||
const val VERSION_CODE = 39400
|
||||
const val VERSION_NAME = "3.9.5"
|
||||
const val VERSION_CODE = 39500
|
||||
const val TARGET_SDK = 35
|
||||
const val MIN_SDK = 26
|
||||
const val APP_ID = "com.zaneschepke.wireguardautotunnel"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
What's new:
|
||||
- Fix for tunnel sort bug
|
||||
- Improved location permissions flow
|
||||
- Location permission detection and notifications
|
||||
- Fix for AndroidTV apps detection for split tunneling
|
||||
- Improved tunnel monitoring and reboot recovery
|
||||
- Fix tunnel slow reconnect from sleep
|
||||
@@ -1,7 +1,7 @@
|
||||
[versions]
|
||||
accompanist = "0.37.3"
|
||||
activityCompose = "1.10.1"
|
||||
amneziawgAndroid = "1.6.1"
|
||||
amneziawgAndroid = "1.6.2"
|
||||
androidx-junit = "1.3.0"
|
||||
icmp4a = "1.0.0"
|
||||
roomdatabasebackup = "1.1.0"
|
||||
@@ -27,7 +27,7 @@ semver4j = "3.1.0"
|
||||
slf4jAndroid = "1.7.36"
|
||||
timber = "5.0.1"
|
||||
tunnel = "1.4.0"
|
||||
androidGradlePlugin = "8.12.0"
|
||||
androidGradlePlugin = "8.11.0"
|
||||
kotlin = "2.2.0"
|
||||
ksp = "2.2.0-2.0.2"
|
||||
composeBom = "2025.07.00"
|
||||
|
||||
Reference in New Issue
Block a user