I plan to make an app that checks if a certain wifi network uses common password. I have a list of most common passwords, but the following function:
public boolean connectTo(String psKey){
WifiConfiguration wc = new WifiConfiguration();
wc.SSID = "\"" + dbw.getSsid() + "\"";
wc.preSharedKey = "\"" + psKey + "\"";
wc.status = WifiConfiguration.Status.ENABLED;
wc = configureCapabs(wc, dbw.getCapability());
int res = wifi.addNetwork(wc);
Toast.makeText(this, "add Network returned " + res , Toast.LENGTH_SHORT).show();
boolean b = wifi.enableNetwork(res, true);
Toast.makeText(this, "enableNetwork returned " + b , Toast.LENGTH_SHORT).show();
if(!b) return false;
boolean fin = /*b ? wifi.reassociate() : */wifi.reconnect();
return fin;
}
it returns true, even if the password was incorrect. Is there a way of checking if the password that I tried to log in with was accepted or rejected?