refactor: убрать мёртвый легаси-код и appcompat-зависимость
minSdk 24 делает мёртвыми deprecated-оверлоад WebViewClient и RequiresApi(N); нормализация WG-транспорта и lint-подавление остались от старых альф. Темы переведены на платформенный Material — appcompat больше не нужен.
This commit is contained in:
1 parent
53d624f614
commit
4f6691fddf
8 files changed
+9
-35
No files matched your search
@@ -44,10 +44,6 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
lint {
|
||||
disable += "ExpiredTargetSdkVersion"
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
@@ -70,7 +66,6 @@ dependencies {
|
||||
implementation(libs.wireguard.tunnel)
|
||||
|
||||
implementation(libs.androidx.core.ktx)
|
||||
implementation(libs.androidx.appcompat)
|
||||
implementation(libs.androidx.activity.compose)
|
||||
implementation(libs.androidx.datastore.preferences)
|
||||
implementation(libs.androidx.navigation.compose)
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
android:label="FreeTurn"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:extractNativeLibs="true"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:theme="@style/Theme.FreeTurn"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
|
||||
@@ -9,10 +9,7 @@ import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import android.os.Build
|
||||
import androidx.annotation.RequiresApi
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.N)
|
||||
class ProxyTileService : TileService() {
|
||||
|
||||
private var scope: CoroutineScope? = null
|
||||
|
||||
@@ -146,10 +146,7 @@ internal object ServerJson {
|
||||
magicSwitch = cliO.optBoolean("magicSwitch", false),
|
||||
magicTurn = cliO.optString("magicTurn"),
|
||||
tunnelTransport = cliO.optString("tunnelTransport", TunnelTransport.NONE).let {
|
||||
val t = if (it in TunnelTransport.PERSISTED) it else TunnelTransport.NONE
|
||||
// Legacy: WIREGUARD c пустым конфигом = туннель не выбран → NONE (proxy).
|
||||
if (t == TunnelTransport.WIREGUARD && cliO.optString("wireGuardConfig").isBlank())
|
||||
TunnelTransport.NONE else t
|
||||
if (it in TunnelTransport.PERSISTED) it else TunnelTransport.NONE
|
||||
},
|
||||
wireGuardConfig = cliO.optString("wireGuardConfig"),
|
||||
wireGuardTunnelName = cliO.optString("wireGuardTunnelName").ifBlank { TunnelTransport.DEFAULT_TUNNEL_NAME },
|
||||
|
||||
@@ -34,7 +34,6 @@ import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import androidx.core.net.toUri
|
||||
import com.freeturn.app.R
|
||||
|
||||
/** Разрешённые схемы для топ-навигации внутри капча-WebView. */
|
||||
@@ -134,13 +133,6 @@ fun CaptchaWebViewDialog(
|
||||
return scheme !in ALLOWED_SCHEMES
|
||||
}
|
||||
|
||||
@Deprecated("API < 24")
|
||||
@Suppress("DEPRECATION", "OVERRIDE_DEPRECATION")
|
||||
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
|
||||
val scheme = url?.toUri()?.scheme?.lowercase()
|
||||
return scheme !in ALLOWED_SCHEMES
|
||||
}
|
||||
|
||||
override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
|
||||
super.onPageStarted(view, url, favicon)
|
||||
isLoading = true
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.FreeTurn" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||
<!-- Customize your dark theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
|
||||
</style>
|
||||
<resources>
|
||||
<!-- Тёмная половина ручного DayNight (см. values/themes.xml). -->
|
||||
<style name="Base.Theme.FreeTurn" parent="android:Theme.Material.NoActionBar" />
|
||||
|
||||
<!-- Splash screen theme (Core Splash Screen API) — dark variant -->
|
||||
<style name="Theme.FreeTurn.Splash" parent="Theme.SplashScreen">
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.FreeTurn" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||
<!-- Customize your light theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
||||
</style>
|
||||
<resources>
|
||||
<!-- Окно видно миллисекунды до setContent — Compose рисует поверх.
|
||||
Платформенная тема вместо AppCompat: DayNight собран вручную
|
||||
через values-night, appcompat-зависимость не нужна. -->
|
||||
<style name="Base.Theme.FreeTurn" parent="android:Theme.Material.Light.NoActionBar" />
|
||||
|
||||
<style name="Theme.FreeTurn" parent="Base.Theme.FreeTurn" />
|
||||
|
||||
|
||||
Reference in new issue
Block a user