From 4943c458082c5eaf364df599dbeb9ab3a0da52a6 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sun, 4 Dec 2022 12:04:04 -0500 Subject: [PATCH] Fix permission issues on Android 13 --- README.md | 2 +- .../src/main/java/be/mygod/vpnhotspot/net/monitor/IpMonitor.kt | 3 ++- .../be/mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index be18ef11..cc336eab 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Connecting things to your VPN made simple. Share your VPN connection over hotspo | Release channel | [GitHub (recommended)](https://github.com/Mygod/VPNHotspot/releases) | [Google Play](https://play.google.com/store/apps/details?id=be.mygod.vpnhotspot) ([beta](https://play.google.com/apps/testing/be.mygod.vpnhotspot)) | |---------------------------------------------------------|:--------------------------------------------------------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------:| -| Monitor connected clients without root | ✓ | Up to Android 10 | +| Monitor connected clients without root | Up to Android 12L | Up to Android 10 | | Use repeater/temporary hotspot without location enabled | Up to Android 10/9 | Up to Android 10/9 or Android 13+ | | Auto update | Email updates via watching releases | ✓ | | In-app update channel | GitHub | Google Play | diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/IpMonitor.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/IpMonitor.kt index 7deb0342..4c6e4bfd 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/IpMonitor.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/IpMonitor.kt @@ -29,7 +29,8 @@ abstract class IpMonitor { "Dump (was interrupted and may be inconsistent.|terminated)$)").toRegex() var currentMode: Mode get() { - val isLegacy = Build.VERSION.SDK_INT < 30 || BuildConfig.TARGET_SDK < 30 + // Completely restricted on Android 13: https://github.com/termux/termux-app/issues/2993#issuecomment-1250312777 + val isLegacy = Build.VERSION.SDK_INT < 33 && (Build.VERSION.SDK_INT < 30 || BuildConfig.TARGET_SDK < 30) val defaultMode = if (isLegacy) @Suppress("DEPRECATION") { Mode.Poll } else Mode.MonitorRoot diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt index 661144f6..be13dd4d 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt @@ -120,7 +120,6 @@ data class SoftApConfigurationCompat( "WPA3-OWE Transition", "WPA3-OWE", ) - val DEFAULT_TIMEOUT = if (BuildConfig.TARGET_SDK >= 33 && Build.VERSION.SDK_INT >= 33) -1L else 0L private val qrSanitizer = Regex("([\\\\\":;,])")