From 6305989cf7515e9c4065479e68da316b9dbd701e Mon Sep 17 00:00:00 2001 From: Mygod Date: Fri, 7 Aug 2020 07:48:47 +0800 Subject: [PATCH] Deprecate unused WiMAX tethering --- README.md | 1 - .../main/java/be/mygod/librootkotlinx/RootSession.kt | 2 +- .../main/java/be/mygod/vpnhotspot/net/TetherType.kt | 6 +----- mobile/src/main/res/drawable/ic_action_contactless.xml | 10 ---------- 4 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 mobile/src/main/res/drawable/ic_action_contactless.xml diff --git a/README.md b/README.md index a4504ccb..f46d65f0 100644 --- a/README.md +++ b/README.md @@ -281,7 +281,6 @@ Greylisted/blacklisted APIs or internal constants: (some constants are hardcoded Nonexported system resources: -* `@android:array/config_tether_wimax_regexs` * (since API 30) `@com.android.networkstack.tethering:array/config_tether_bluetooth_regexs` * (since API 30) `@com.android.networkstack.tethering:array/config_tether_ncm_regexs` * (since API 30) `@com.android.networkstack.tethering:array/config_tether_usb_regexs` diff --git a/mobile/src/main/java/be/mygod/librootkotlinx/RootSession.kt b/mobile/src/main/java/be/mygod/librootkotlinx/RootSession.kt index 728de2a1..88727a68 100644 --- a/mobile/src/main/java/be/mygod/librootkotlinx/RootSession.kt +++ b/mobile/src/main/java/be/mygod/librootkotlinx/RootSession.kt @@ -29,7 +29,7 @@ abstract class RootSession { closeLocked() usersCount = 0 } - check(usersCount == 0L) + check(usersCount == 0L) { "Unexpected $server, $usersCount" } val server = createServer() try { initServer(server) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt index 1397bcb8..1b5365ff 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt @@ -15,7 +15,6 @@ enum class TetherType(@DrawableRes val icon: Int) { WIFI_P2P(R.drawable.ic_action_settings_input_antenna), USB(R.drawable.ic_device_usb), WIFI(R.drawable.ic_device_network_wifi), - WIMAX(R.drawable.ic_action_contactless), BLUETOOTH(R.drawable.ic_device_bluetooth), // if you have an issue with these Ethernet icon namings, blame Google NCM(R.drawable.ic_action_settings_ethernet), @@ -24,7 +23,7 @@ enum class TetherType(@DrawableRes val icon: Int) { ; val isWifi get() = when (this) { - WIFI_P2P, WIFI, WIMAX, WIGIG -> true + WIFI_P2P, WIFI, WIGIG -> true else -> false } @@ -33,7 +32,6 @@ enum class TetherType(@DrawableRes val icon: Int) { private lateinit var wifiRegexs: List private var wigigRegexs = emptyList() private var wifiP2pRegexs = emptyList() - private val wimaxRegexs: List private lateinit var bluetoothRegexs: List private var ncmRegexs = emptyList() private val ethernetRegex: Pattern? @@ -88,7 +86,6 @@ enum class TetherType(@DrawableRes val icon: Int) { wifiRegexs = system.getRegexs("config_tether_wifi_regexs") bluetoothRegexs = system.getRegexs("config_tether_bluetooth_regexs") } - wimaxRegexs = system.getRegexs("config_tether_wimax_regexs") // available since Android 4.0: https://android.googlesource.com/platform/frameworks/base/+/c96a667162fab44a250503caccb770109a9cb69a ethernetRegex = system.second.getString(system.second.getIdentifier( "config_ethernet_iface_regex", "string", system.first)).run { if (isEmpty()) null else toPattern() } @@ -115,7 +112,6 @@ enum class TetherType(@DrawableRes val icon: Int) { usbRegexs.any { it.matcher(iface).matches() } -> USB bluetoothRegexs.any { it.matcher(iface).matches() } -> BLUETOOTH ncmRegexs.any { it.matcher(iface).matches() } -> NCM - wimaxRegexs.any { it.matcher(iface).matches() } -> WIMAX ethernetRegex?.matcher(iface)?.matches() == true -> ETHERNET else -> NONE } diff --git a/mobile/src/main/res/drawable/ic_action_contactless.xml b/mobile/src/main/res/drawable/ic_action_contactless.xml deleted file mode 100644 index 00a0d8a1..00000000 --- a/mobile/src/main/res/drawable/ic_action_contactless.xml +++ /dev/null @@ -1,10 +0,0 @@ - - -