diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt index a97d844b..64723eac 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt @@ -11,7 +11,6 @@ import android.net.wifi.p2p.* import android.os.Build import android.os.Looper import android.provider.Settings -import androidx.annotation.RequiresApi import androidx.annotation.StringRes import androidx.core.content.edit import be.mygod.librootkotlinx.useParcel @@ -162,7 +161,8 @@ class RepeaterService : Service(), CoroutineScope, WifiP2pManager.ChannelListene RootManager.use { server -> if (deinitPending.getAndSet(false)) server.execute(RepeaterCommands.Deinit()) @Suppress("UNCHECKED_CAST") - val groups = server.execute(RepeaterCommands.RequestPersistentGroupInfo()).value as List + val groups = server.execute(RepeaterCommands.RequestPersistentGroupInfo()) + .value as List for (group in groups.filterUselessGroups()) { server.execute(RepeaterCommands.DeletePersistentGroup(group.networkId))?.value.print(group) } diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/RoutingManager.kt b/mobile/src/main/java/be/mygod/vpnhotspot/RoutingManager.kt index 768a7bd2..eb61949a 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/RoutingManager.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/RoutingManager.kt @@ -9,7 +9,6 @@ import be.mygod.vpnhotspot.net.wifi.WifiDoubleLock import be.mygod.vpnhotspot.widget.SmartSnackbar import kotlinx.coroutines.runBlocking import timber.log.Timber -import java.net.NetworkInterface abstract class RoutingManager(private val caller: Any, val downstream: String, private val forceWifi: Boolean = false) { companion object { @@ -17,8 +16,9 @@ abstract class RoutingManager(private val caller: Any, val downstream: String, p var masqueradeMode: Routing.MasqueradeMode @TargetApi(28) get() = app.pref.run { getString(KEY_MASQUERADE_MODE, null)?.let { return@run Routing.MasqueradeMode.valueOf(it) } - if (getBoolean("service.masquerade", true)) // legacy settings - Routing.MasqueradeMode.Simple else Routing.MasqueradeMode.None + if (getBoolean("service.masquerade", true)) { // legacy settings + Routing.MasqueradeMode.Simple + } else Routing.MasqueradeMode.None }.let { // older app version enabled netd for everyone. should check again here if (Build.VERSION.SDK_INT >= 28 || it != Routing.MasqueradeMode.Netd) it diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApManager.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApManager.kt index 18f717ef..931bee4f 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApManager.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApManager.kt @@ -7,9 +7,7 @@ import android.net.wifi.SoftApConfiguration import android.net.wifi.WifiManager import android.os.Build import androidx.annotation.RequiresApi -import be.mygod.vpnhotspot.App import be.mygod.vpnhotspot.App.Companion.app -import be.mygod.vpnhotspot.net.TetheringManager import be.mygod.vpnhotspot.net.wifi.SoftApConfigurationCompat.Companion.toCompat import be.mygod.vpnhotspot.util.Services