From 8682c9dd4333c800808c8525a72ff2e0092ae7f5 Mon Sep 17 00:00:00 2001 From: Mygod Date: Fri, 1 Feb 2019 15:33:47 +0800 Subject: [PATCH] RIP WPS --- .../src/main/java/be/mygod/vpnhotspot/RepeaterService.kt | 8 ++++---- mobile/src/main/res/values-zh-rCN/strings.xml | 1 + mobile/src/main/res/values/strings.xml | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt index 9de5293f..39e3857e 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt @@ -5,7 +5,6 @@ import android.content.Intent import android.content.SharedPreferences import android.content.res.Configuration import android.net.NetworkInfo -import android.net.wifi.WpsInfo import android.net.wifi.p2p.WifiP2pDevice import android.net.wifi.p2p.WifiP2pGroup import android.net.wifi.p2p.WifiP2pInfo @@ -68,13 +67,14 @@ class RepeaterService : Service(), WifiP2pManager.ChannelListener, SharedPrefere val groupChanged = StickyEvent1 { group } var thisDevice: WifiP2pDevice? = null + @Deprecated("WPS was deprecated RIP") fun startWps(pin: String? = null) { val channel = channel if (channel == null) SmartSnackbar.make(R.string.repeater_failure_disconnected).show() - else if (active) p2pManager.startWps(channel, WpsInfo().apply { - setup = if (pin == null) WpsInfo.PBC else { + else @Suppress("DEPRECATION") if (active) p2pManager.startWps(channel, android.net.wifi.WpsInfo().apply { + setup = if (pin == null) android.net.wifi.WpsInfo.PBC else { this.pin = pin - WpsInfo.KEYPAD + android.net.wifi.WpsInfo.KEYPAD } }, object : WifiP2pManager.ActionListener { override fun onSuccess() = SmartSnackbar.make( diff --git a/mobile/src/main/res/values-zh-rCN/strings.xml b/mobile/src/main/res/values-zh-rCN/strings.xml index 2fc7fda3..62cc276f 100644 --- a/mobile/src/main/res/values-zh-rCN/strings.xml +++ b/mobile/src/main/res/values-zh-rCN/strings.xml @@ -6,6 +6,7 @@ 已连设备 设置选项 + WPS(不安全) 输入 PIN 一键加密 请在 2 分钟内在需要连接的设备上使用一键加密以连接到此中继。 diff --git a/mobile/src/main/res/values/strings.xml b/mobile/src/main/res/values/strings.xml index da14f9c1..513e0564 100644 --- a/mobile/src/main/res/values/strings.xml +++ b/mobile/src/main/res/values/strings.xml @@ -15,7 +15,7 @@ Clients Settings - WPS + WPS (insecure) Enter PIN Push Button Please use WPS push button within the next 2 minutes to connect your