Handle multiple groups and other formats of psk

This should address #17.
This commit is contained in:
Mygod
2018-05-02 01:30:29 -07:00
parent 989408accc
commit a9c40c8ff7
3 changed files with 28 additions and 20 deletions

View File

@@ -245,8 +245,8 @@ class RepeaterFragment : Fragment(), ServiceConnection, Toolbar.OnMenuItemClickL
val conf = P2pSupplicantConfiguration()
wifi.SSID = ssid
wifi.preSharedKey = binder.password
if (wifi.preSharedKey == null || wifi.preSharedKey.length < 8) wifi.preSharedKey = conf.readPsk()
if (wifi.preSharedKey != null && wifi.preSharedKey.length >= 8) {
if (wifi.preSharedKey == null) wifi.preSharedKey = conf.readPsk()
if (wifi.preSharedKey != null) {
var dialog: WifiP2pDialog? = null
dialog = WifiP2pDialog(context, DialogInterface.OnClickListener { _, which ->
when (which) {