Fix unsafe repeater mode for Android 11

This commit is contained in:
Mygod
2020-06-14 06:15:06 +08:00
parent 348af9e6ce
commit 33d7105acf
2 changed files with 30 additions and 11 deletions

View File

@@ -209,7 +209,7 @@ class RepeaterManager(private val parent: TetheringFragment) : Manager(), Servic
passphrase = config.psk
band = SoftApConfigurationCompat.BAND_ANY
channel = RepeaterService.operatingChannel
bssid = RepeaterService.deviceAddress
bssid = config.bssid
}
} catch (e: RuntimeException) {
Timber.w(e)
@@ -230,8 +230,8 @@ class RepeaterManager(private val parent: TetheringFragment) : Manager(), Servic
}
} else holder.config?.let { master ->
val binder = binder
if (binder?.group?.networkName != config.ssid || master.psk != config.passphrase) try {
withContext(Dispatchers.Default) { master.update(config.ssid!!, config.passphrase!!) }
if (binder?.group?.networkName != config.ssid || master.psk != config.passphrase || master.bssid != config.bssid) try {
withContext(Dispatchers.Default) { master.update(config.ssid!!, config.passphrase!!, config.bssid!!) }
(this.binder ?: binder)?.group = null
} catch (e: Exception) {
Timber.w(e)