diff --git a/detekt.yml b/detekt.yml index c637798a..da4088d1 100644 --- a/detekt.yml +++ b/detekt.yml @@ -95,13 +95,13 @@ exceptions: PrintStackTrace: active: false RethrowCaughtException: - active: true + active: false ReturnFromFinally: active: true SwallowedException: active: true ThrowingExceptionFromFinally: - active: true + active: false ThrowingExceptionInMain: active: true ThrowingExceptionsWithoutMessageOrCause: @@ -317,8 +317,7 @@ style: CollapsibleIfStatements: active: true DataClassContainsFunctions: - active: true - conversionFunctionPrefix: 'to' + active: false EqualsNullCall: active: true ExpressionBodySyntax: diff --git a/mobile/build.gradle b/mobile/build.gradle index 416b0499..efbcdc5d 100644 --- a/mobile/build.gradle +++ b/mobile/build.gradle @@ -17,7 +17,7 @@ android { minSdkVersion 21 targetSdkVersion 28 resConfigs "zh-rCN" - versionCode 109 + versionCode 110 versionName "2.1.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" javaCompileOptions { diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/LocalOnlyHotspotService.kt b/mobile/src/main/java/be/mygod/vpnhotspot/LocalOnlyHotspotService.kt index 36ed6fd5..a69df609 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/LocalOnlyHotspotService.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/LocalOnlyHotspotService.kt @@ -4,7 +4,6 @@ import android.content.Intent import android.content.IntentFilter import android.content.res.Configuration import android.net.wifi.WifiManager -import android.os.Build import androidx.annotation.RequiresApi import be.mygod.vpnhotspot.App.Companion.app import be.mygod.vpnhotspot.net.TetheringManager diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt index 88bbd05d..5e950e34 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt @@ -118,9 +118,8 @@ class RepeaterService : Service(), WifiP2pManager.ChannelListener, SharedPrefere } private val deviceListener = broadcastReceiver { _, intent -> when (intent.action) { - WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION -> { - binder.thisDevice = intent.getParcelableExtra(WifiP2pManager.EXTRA_WIFI_P2P_DEVICE) - } + WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION -> binder.thisDevice = + intent.getParcelableExtra(WifiP2pManager.EXTRA_WIFI_P2P_DEVICE) WifiP2pManagerHelper.WIFI_P2P_PERSISTENT_GROUPS_CHANGED_ACTION -> onPersistentGroupsChanged() } } diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/manage/ManageBar.kt b/mobile/src/main/java/be/mygod/vpnhotspot/manage/ManageBar.kt index 3179ae3e..97a3ba5c 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/manage/ManageBar.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/manage/ManageBar.kt @@ -10,7 +10,6 @@ import androidx.databinding.BaseObservable import androidx.recyclerview.widget.RecyclerView import be.mygod.vpnhotspot.App.Companion.app import be.mygod.vpnhotspot.databinding.ListitemManageBinding -import be.mygod.vpnhotspot.widget.SmartSnackbar import timber.log.Timber object ManageBar : Manager() { diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/DefaultNetworkMonitor.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/DefaultNetworkMonitor.kt index 0cbbd28f..37b86ade 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/DefaultNetworkMonitor.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/DefaultNetworkMonitor.kt @@ -58,8 +58,8 @@ object DefaultNetworkMonitor : UpstreamMonitor() { it.onAvailable(ifname, properties.dnsServers) } } - properties.dnsServers != oldProperties.dnsServers -> { - callbacks.forEach { it.onAvailable(ifname, properties.dnsServers) } + properties.dnsServers != oldProperties.dnsServers -> callbacks.forEach { + it.onAvailable(ifname, properties.dnsServers) } } } diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/UpstreamMonitor.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/UpstreamMonitor.kt index d716e247..8235b610 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/UpstreamMonitor.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/UpstreamMonitor.kt @@ -3,6 +3,7 @@ package be.mygod.vpnhotspot.net.monitor import android.content.SharedPreferences import android.net.LinkProperties import be.mygod.vpnhotspot.App.Companion.app +import java.lang.UnsupportedOperationException import java.net.InetAddress import java.util.* import java.util.concurrent.ConcurrentHashMap @@ -61,7 +62,7 @@ abstract class UpstreamMonitor { * commit: https://android.googlesource.com/platform/system/netd/+/758627c4d93392190b08e9aaea3bbbfb92a5f364 */ fun onFallback() { - throw NotImplementedError() + throw UnsupportedOperationException() } } diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/VpnMonitor.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/VpnMonitor.kt index 22c223af..ebd9f24c 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/VpnMonitor.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/VpnMonitor.kt @@ -62,8 +62,8 @@ object VpnMonitor : UpstreamMonitor() { it.onAvailable(ifname, properties.dnsServers) } } - properties.dnsServers != oldProperties.dnsServers -> { - callbacks.forEach { it.onAvailable(ifname, properties.dnsServers) } + properties.dnsServers != oldProperties.dnsServers -> callbacks.forEach { + it.onAvailable(ifname, properties.dnsServers) } } } diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/widget/SmartSnackbar.kt b/mobile/src/main/java/be/mygod/vpnhotspot/widget/SmartSnackbar.kt index bd4aa51e..b163a03a 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/widget/SmartSnackbar.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/widget/SmartSnackbar.kt @@ -7,7 +7,6 @@ import android.widget.Toast import androidx.annotation.StringRes import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleObserver -import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.OnLifecycleEvent import be.mygod.vpnhotspot.App.Companion.app import be.mygod.vpnhotspot.R