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 ab1fb8e8..ae370769 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 @@ -353,6 +353,8 @@ data class SoftApConfigurationCompat( private val staticBuilder by lazy { classBuilder.newInstance() } @RequiresApi(30) fun testPlatformValidity(channels: SparseIntArray) = setChannelsCompat(staticBuilder, channels) + @RequiresApi(30) + fun testPlatformValidity(bssid: MacAddress) = setBssid(staticBuilder, bssid) } @Suppress("DEPRECATION") diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApDialogFragment.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApDialogFragment.kt index 92660c4c..ec709aeb 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApDialogFragment.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApDialogFragment.kt @@ -306,9 +306,12 @@ class WifiApDialogFragment : AlertDialogFragment= 30 && !arg.p2pMode) { + SoftApConfigurationCompat.testPlatformValidity(mac.toPlatform()) + } true - } catch (e: IllegalArgumentException) { + } catch (e: Exception) { dialogView.bssidWrapper.error = e.readableMessage false }