mirror of
https://github.com/wgtunnel/android.git
synced 2026-07-03 14:07:49 +02:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a0c72d3972 | |||
| d3d70ab2e7 | |||
| 9b2d4a3fb5 | |||
| d7741c37c5 | |||
| 6046e4131f | |||
| 4b2d2d20db | |||
| a09501aaf5 |
@@ -171,7 +171,7 @@
|
||||
android:exported="false"
|
||||
android:directBootAware="true">
|
||||
<intent-filter>
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<action android:name="android.intent.action.SCREEN_ON" />
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
|
||||
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON" />
|
||||
|
||||
+3
@@ -8,6 +8,7 @@ import com.zaneschepke.wireguardautotunnel.core.tunnel.TunnelManager
|
||||
import com.zaneschepke.wireguardautotunnel.di.ApplicationScope
|
||||
import com.zaneschepke.wireguardautotunnel.di.IoDispatcher
|
||||
import com.zaneschepke.wireguardautotunnel.domain.repository.AppDataRepository
|
||||
import com.zaneschepke.wireguardautotunnel.util.extensions.isRunningOnTv
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import javax.inject.Inject
|
||||
import kotlinx.coroutines.CoroutineDispatcher
|
||||
@@ -29,6 +30,8 @@ class RestartReceiver : BroadcastReceiver() {
|
||||
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
Timber.d("RestartReceiver triggered with action: ${intent.action}")
|
||||
// screen on for Android TV only to help with sleep shutdowns
|
||||
if (intent.action == Intent.ACTION_SCREEN_ON && !context.isRunningOnTv()) return
|
||||
serviceManager.updateTunnelTile()
|
||||
serviceManager.updateAutoTunnelTile()
|
||||
applicationScope.launch(ioDispatcher) {
|
||||
|
||||
@@ -35,7 +35,7 @@ class RepositoryModule {
|
||||
AppDatabase::class.java,
|
||||
context.getString(R.string.db_name),
|
||||
)
|
||||
.fallbackToDestructiveMigration()
|
||||
.fallbackToDestructiveMigration(true)
|
||||
.addCallback(DatabaseCallback())
|
||||
.build()
|
||||
}
|
||||
|
||||
+11
-4
@@ -50,6 +50,7 @@ constructor(
|
||||
tunnelId?.let { loadInitialState(it) }
|
||||
}
|
||||
|
||||
// TODO improve this loading experience
|
||||
private fun loadInitialState(tunnelId: Int) =
|
||||
viewModelScope.launch {
|
||||
val tunnel = tunnelRepository.getById(tunnelId) ?: return@launch
|
||||
@@ -108,6 +109,7 @@ constructor(
|
||||
loading = false,
|
||||
tunnelConf = tunnel,
|
||||
tunneledApps = tunneledApps,
|
||||
queriedApps = tunneledApps,
|
||||
splitOption = splitOption,
|
||||
)
|
||||
}
|
||||
@@ -116,14 +118,14 @@ constructor(
|
||||
fun onSearchQuery(query: String) {
|
||||
val filteredApps =
|
||||
if (query.isBlank()) {
|
||||
allTunneledApps
|
||||
_uiState.value.tunneledApps
|
||||
} else {
|
||||
allTunneledApps.filter {
|
||||
_uiState.value.tunneledApps.filter {
|
||||
it.first.name.contains(query, ignoreCase = true) ||
|
||||
it.first.`package`.contains(query, ignoreCase = true)
|
||||
}
|
||||
}
|
||||
_uiState.update { it.copy(searchQuery = query, tunneledApps = filteredApps) }
|
||||
_uiState.update { it.copy(searchQuery = query, queriedApps = filteredApps) }
|
||||
}
|
||||
|
||||
fun updateSplitOption(newOption: SplitOption) {
|
||||
@@ -136,7 +138,12 @@ constructor(
|
||||
currentState.tunneledApps.map { (app, selected) ->
|
||||
if (app.`package` == packageName) Pair(app, !selected) else Pair(app, selected)
|
||||
}
|
||||
_uiState.value = currentState.copy(tunneledApps = updatedApps)
|
||||
val updatedQueryApps =
|
||||
currentState.queriedApps.map { (app, selected) ->
|
||||
if (app.`package` == packageName) Pair(app, !selected) else Pair(app, selected)
|
||||
}
|
||||
_uiState.value =
|
||||
currentState.copy(tunneledApps = updatedApps, queriedApps = updatedQueryApps)
|
||||
}
|
||||
|
||||
fun saveChanges() =
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ fun SplitTunnelContent(
|
||||
)
|
||||
if (uiState.splitOption != SplitOption.ALL) {
|
||||
AppListSection(
|
||||
apps = uiState.tunneledApps,
|
||||
apps = uiState.queriedApps,
|
||||
onAppSelectionToggle = onAppSelectionToggle,
|
||||
onQueryChange = onQueryChange,
|
||||
uiState.searchQuery,
|
||||
|
||||
+1
@@ -6,6 +6,7 @@ data class SplitTunnelUiState(
|
||||
val loading: Boolean = true,
|
||||
val tunnelConf: TunnelConf? = null,
|
||||
val tunneledApps: SplitTunnelApps = emptyList(),
|
||||
val queriedApps: SplitTunnelApps = emptyList(),
|
||||
val splitOption: SplitOption = SplitOption.ALL,
|
||||
val searchQuery: String = "",
|
||||
val success: Boolean? = null,
|
||||
|
||||
@@ -78,6 +78,7 @@ fun WireguardAutoTunnelTheme(theme: Theme = Theme.AUTOMATIC, content: @Composabl
|
||||
|
||||
val view = LocalView.current
|
||||
if (!view.isInEditMode) {
|
||||
@Suppress("DEPRECATION")
|
||||
SideEffect {
|
||||
val window = (view.context as Activity).window
|
||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
<string name="name">Name</string>
|
||||
<string name="always_on_vpn_support">Always-On VPN erlauben</string>
|
||||
<string name="location_services_not_detected">Standortdienste nicht erkannt</string>
|
||||
<string name="hint_search_packages">Pakete suchen</string>
|
||||
<string name="vpn_on">VPN an</string>
|
||||
<string name="vpn_off">VPN aus</string>
|
||||
<string name="create_import">Von Grund auf neu erstellen</string>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
object Constants {
|
||||
const val VERSION_NAME = "3.8.2"
|
||||
const val VERSION_NAME = "3.8.3"
|
||||
const val JVM_TARGET = "17"
|
||||
const val VERSION_CODE = 38200
|
||||
const val VERSION_CODE = 38300
|
||||
const val TARGET_SDK = 35
|
||||
const val MIN_SDK = 26
|
||||
const val APP_ID = "com.zaneschepke.wireguardautotunnel"
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
What's new:
|
||||
- Fix DNS resolution issues
|
||||
- Improve Android TV restore on sleep
|
||||
- Fix split tunnel search bug
|
||||
- Localization updates
|
||||
- Update docs links for new app website
|
||||
@@ -9,7 +9,7 @@ coreKtx = "1.16.0"
|
||||
datastorePreferences = "1.1.4"
|
||||
desugar_jdk_libs = "2.1.5"
|
||||
espressoCore = "3.6.1"
|
||||
hiltAndroid = "2.56.1"
|
||||
hiltAndroid = "2.56.2"
|
||||
hiltCompiler = "1.2.0"
|
||||
junit = "4.13.2"
|
||||
kotlinx-serialization-json = "1.8.1"
|
||||
|
||||
@@ -57,6 +57,7 @@ class LogcatManager(pid: Int, logDir: String, maxFileSize: Long, maxFolderSize:
|
||||
isStarted = true
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
override fun stop() {
|
||||
if (!isStarted) return
|
||||
logJob?.cancel()
|
||||
|
||||
Reference in New Issue
Block a user