use of org.csploit.android.wifi.Keygen in project android by cSploit.
the class WifiScannerFragment method onListItemClick.
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
final ScanResult result = mAdapter.getItem(position);
if (result != null) {
final Keygen keygen = mWifiMatcher.getKeygen(result);
mPreviousConfig = NetworkManager.getWifiConfiguration(mWifiManager, result);
if (mPreviousConfig != null) {
mWifiManager.removeNetwork(mPreviousConfig.networkId);
}
if (keygen != null && (result.capabilities.contains("WEP") || result.capabilities.contains("WPA"))) {
mKeyList.clear();
new WifiCrackDialog(result.SSID, getResources().getString(R.string.enter_key_or_crack), getActivity(), new WifiCrackDialogListener() {
@Override
public void onManualConnect(String key) {
mCurrentNetworkId = performConnection(result, key);
if (mCurrentNetworkId != -1)
mConnectionReceiver.register(getActivity());
else
mConnectionReceiver.unregister();
}
@Override
public void onCrack() {
performCracking(keygen, result);
}
}).show();
} else {
if (result.capabilities.contains("WEP") || result.capabilities.contains("WPA")) {
new InputDialog(result.SSID, getString(R.string.enter_wifi_key), null, true, true, getActivity(), new InputDialogListener() {
@Override
public void onInputEntered(String input) {
mCurrentNetworkId = performConnection(result, input);
if (mCurrentNetworkId != -1)
mConnectionReceiver.register(getActivity());
else
mConnectionReceiver.unregister();
}
}).show();
} else
performConnection(result, null);
}
}
}
Aggregations