From ed80bf391acb7e359101e51005cb6518b2883bb9 Mon Sep 17 00:00:00 2001 From: Mygod Date: Fri, 9 Oct 2020 02:59:45 +0800 Subject: [PATCH] Fix setting open type SoftApConfiguration --- .../be/mygod/vpnhotspot/net/wifi/SoftApConfigurationCompat.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ffbe2da8..5c4ff7d3 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 @@ -302,7 +302,8 @@ data class SoftApConfigurationCompat( val sac = underlying as? SoftApConfiguration val builder = if (sac == null) classBuilder.newInstance() else newBuilder.newInstance(sac) setSsid(builder, ssid) - setPassphrase(builder, passphrase, securityType) + setPassphrase(builder, if (securityType == SoftApConfiguration.SECURITY_TYPE_OPEN) null else passphrase, + securityType) if (channel == 0) setBand(builder, band) else setChannel(builder, channel, band) setBssid(builder, bssid?.toPlatform()) setMaxNumberOfClients(builder, maxNumberOfClients)