From 28d67c60aa515bb21f1dcd41c1d5042e8b9215f1 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sun, 28 Apr 2024 12:10:40 -0400 Subject: [PATCH] v2.17.8 --- build.gradle.kts | 6 +++--- mobile/build.gradle.kts | 18 +++++++++--------- .../be/mygod/vpnhotspot/RepeaterService.kt | 2 +- .../net/dns/VpnProtectedSelectorManager.kt | 7 ++++++- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e495920c..a1610cd7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,8 +1,8 @@ plugins { - id("com.android.application") version "8.3.1" apply false + id("com.android.application") version "8.3.2" apply false id("com.github.ben-manes.versions") version "0.51.0" - id("com.google.devtools.ksp") version "1.9.23-1.0.19" apply false - id("org.jetbrains.kotlin.android") version "1.9.23" apply false + id("com.google.devtools.ksp") version "2.0.0-RC1-1.0.20" apply false + id("org.jetbrains.kotlin.android") version "2.0.0-RC1" apply false } buildscript { diff --git a/mobile/build.gradle.kts b/mobile/build.gradle.kts index fa84e8eb..cc873c6b 100644 --- a/mobile/build.gradle.kts +++ b/mobile/build.gradle.kts @@ -30,8 +30,8 @@ android { applicationId = "be.mygod.vpnhotspot" minSdk = 28 targetSdk = 34 - versionCode = 1022 - versionName = "2.17.7" + versionCode = 1023 + versionName = "2.17.8" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" ksp { arg("room.expandProjection", "true") @@ -95,20 +95,20 @@ dependencies { ksp("androidx.room:room-compiler:$roomVersion") implementation(kotlin("stdlib-jdk8")) implementation("androidx.browser:browser:1.8.0") - implementation("androidx.core:core-ktx:1.12.0") - implementation("androidx.fragment:fragment-ktx:1.6.2") + implementation("androidx.core:core-ktx:1.13.0") + implementation("androidx.fragment:fragment-ktx:1.7.0-rc02") implementation("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion") implementation("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion") implementation("androidx.preference:preference:1.2.1") implementation("androidx.room:room-ktx:$roomVersion") implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") implementation("be.mygod.librootkotlinx:librootkotlinx:1.1.1") - implementation("com.android.billingclient:billing-ktx:6.2.0") - implementation("com.google.android.gms:play-services-base:18.3.0") // fix for GoogleApiActivity crash @ 18.1.0+ + implementation("com.android.billingclient:billing-ktx:6.2.1") + implementation("com.google.android.gms:play-services-base:18.4.0") // fix for GoogleApiActivity crash @ 18.1.0+ implementation("com.google.android.gms:play-services-oss-licenses:17.0.1") - implementation("com.google.android.material:material:1.12.0-beta01") - implementation("com.google.firebase:firebase-analytics:21.6.1") - implementation("com.google.firebase:firebase-crashlytics:18.6.3") + implementation("com.google.android.material:material:1.12.0-rc01") + implementation("com.google.firebase:firebase-analytics:21.6.2") + implementation("com.google.firebase:firebase-crashlytics:18.6.4") implementation("com.google.zxing:core:3.5.3") implementation("com.jakewharton.timber:timber:5.0.1") implementation("com.linkedin.dexmaker:dexmaker:2.28.3") diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt index 2fae71af..d179c08b 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt @@ -444,6 +444,7 @@ class RepeaterService : Service(), CoroutineScope, WifiP2pManager.ChannelListene /** * startService Step 2 (if a group isn't already available) */ + @SuppressLint("MissingPermission") // missing permission will simply leading to returning ERROR private suspend fun doStart() { val listener = object : WifiP2pManager.ActionListener { override fun onFailure(reason: Int) { @@ -464,7 +465,6 @@ class RepeaterService : Service(), CoroutineScope, WifiP2pManager.ChannelListene if (Build.VERSION.SDK_INT >= 33) setVendorElements() val networkName = networkName?.toString() val passphrase = passphrase - @SuppressLint("MissingPermission") // missing permission will simply leading to returning ERROR if (!safeMode || networkName == null || passphrase.isNullOrEmpty()) { persistNextGroup = true p2pManager.createGroup(channel, listener) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/dns/VpnProtectedSelectorManager.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/dns/VpnProtectedSelectorManager.kt index d71355f2..813c7960 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/dns/VpnProtectedSelectorManager.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/dns/VpnProtectedSelectorManager.kt @@ -1,5 +1,6 @@ package be.mygod.vpnhotspot.net.dns +import android.annotation.SuppressLint import android.net.VpnService import io.ktor.network.selector.SelectInterest import io.ktor.network.selector.Selectable @@ -9,7 +10,11 @@ import java.net.ProtocolFamily import java.nio.channels.spi.SelectorProvider class VpnProtectedSelectorManager(private val manager: SelectorManager) : SelectorProvider(), SelectorManager { - private val protector = VpnService() + companion object { + @SuppressLint("StaticFieldLeak") + private val protector = VpnService() + } + private fun checkProtect(success: Boolean) { if (!success) Timber.w(Exception("protect failed")) }