diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt index 69fb257d..ec88da98 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt @@ -95,18 +95,6 @@ class RepeaterService : Service(), WifiP2pManager.ChannelListener, SharedPrefere fun shutdown() { if (active) removeGroup() } - - fun resetCredentials() { - val channel = channel - if (channel == null) SmartSnackbar.make(R.string.repeater_failure_disconnected).show() - else p2pManager.deletePersistentGroup(channel, (group ?: return).netId, - object : WifiP2pManager.ActionListener { - override fun onSuccess() = SmartSnackbar.make(R.string.repeater_reset_credentials_success) - .shortToast().show() - override fun onFailure(reason: Int) = SmartSnackbar.make( - formatReason(R.string.repeater_reset_credentials_failure, reason)).show() - }) - } } private val p2pManager get() = RepeaterService.p2pManager!! diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/manage/RepeaterManager.kt b/mobile/src/main/java/be/mygod/vpnhotspot/manage/RepeaterManager.kt index 00050db7..c6313cfb 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/manage/RepeaterManager.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/manage/RepeaterManager.kt @@ -168,18 +168,15 @@ class RepeaterManager(private val parent: TetheringFragment) : Manager(), Servic } } - fun onEditResult(which: Int, data: Intent?) { - when (which) { - DialogInterface.BUTTON_POSITIVE -> try { - val master = holder.config ?: return - val config = AlertDialogFragment.getRet(data!!).configuration - master.update(config.SSID, config.preSharedKey) - binder!!.group = null - } catch (e: Exception) { - Timber.w(e) - SmartSnackbar.make(e).show() - } - DialogInterface.BUTTON_NEUTRAL -> binder!!.resetCredentials() + fun onEditResult(data: Intent?) { + val master = holder.config ?: return + try { + val config = AlertDialogFragment.getRet(data!!).configuration + master.update(config.SSID, config.preSharedKey) + binder!!.group = null + } catch (e: Exception) { + Timber.w(e) + SmartSnackbar.make(e).show() } holder.config = null } diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetheringFragment.kt b/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetheringFragment.kt index a4911964..8fd43896 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetheringFragment.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetheringFragment.kt @@ -133,7 +133,7 @@ class TetheringFragment : Fragment(), ServiceConnection, MenuItem.OnMenuItemClic override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) = when (requestCode) { REPEATER_WPS -> adapter.repeaterManager.onWpsResult(resultCode, data) - REPEATER_EDIT_CONFIGURATION -> adapter.repeaterManager.onEditResult(resultCode, data) + REPEATER_EDIT_CONFIGURATION -> adapter.repeaterManager.onEditResult(data) else -> super.onActivityResult(requestCode, resultCode, data) } diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiP2pDialogFragment.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiP2pDialogFragment.kt index f430baf3..2c447ede 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiP2pDialogFragment.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiP2pDialogFragment.kt @@ -48,7 +48,6 @@ class WifiP2pDialogFragment : AlertDialogFragment打开 WPS 失败(原因:%s) 设置 WLAN 中继 未能找到有效的档案。请尝试先打开中继。 - 重置 - 凭据已重置。 - 重置凭据失败(原因:%s) 删除多余 P2P 群组失败(原因:%s) Wi\u2011Fi 直连不可用,请打开 Wi\u2011Fi diff --git a/mobile/src/main/res/values/strings.xml b/mobile/src/main/res/values/strings.xml index ee7c4a8a..213f4fe6 100644 --- a/mobile/src/main/res/values/strings.xml +++ b/mobile/src/main/res/values/strings.xml @@ -24,9 +24,6 @@ Failed to start WPS (reason: %s) Configure Wi\u2011Fi repeater Valid config not found. Please start repeater first. - Reset - Credentials reset. - Failed to reset credentials (reason: %s) Failed to remove redundant P2P group (reason: %s) Wi\u2011Fi direct unavailable, please enable Wi\u2011Fi