Skip to content

Instantly share code, notes, and snippets.

@wada811
Created September 3, 2014 05:12
Show Gist options
  • Save wada811/401a0488cb46854163b4 to your computer and use it in GitHub Desktop.
Save wada811/401a0488cb46854163b4 to your computer and use it in GitHub Desktop.
WifiManager wifiManager = (WifiManager)getSystemService(Context.WIFI_SERVICE);
List<WifiConfiguration> configuredNetworks = wifiManager.getConfiguredNetworks();
for(WifiConfiguration wifiConfiguration : configuredNetworks){
LogUtils.d("SSID: " + wifiConfiguration.SSID);
for(int i = 0; i < WifiConfiguration.AuthAlgorithm.strings.length; i++){
if(wifiConfiguration.allowedAuthAlgorithms.get(i)){
LogUtils.d(" allowedAuthAlgorithms: " + WifiConfiguration.AuthAlgorithm.strings[i]);
}
}
for(int i = 0; i < WifiConfiguration.GroupCipher.strings.length; i++){
if(wifiConfiguration.allowedGroupCiphers.get(i)){
LogUtils.d(" allowedGroupCiphers: " + WifiConfiguration.GroupCipher.strings[i]);
}
}
for(int i = 0; i < WifiConfiguration.KeyMgmt.strings.length; i++){
if(wifiConfiguration.allowedKeyManagement.get(i)){
LogUtils.d(" allowedKeyManagement: " + WifiConfiguration.KeyMgmt.strings[i]);
}
}
for(int i = 0; i < WifiConfiguration.PairwiseCipher.strings.length; i++){
if(wifiConfiguration.allowedPairwiseCiphers.get(i)){
LogUtils.d(" allowedPairwiseCiphers: " + WifiConfiguration.PairwiseCipher.strings[i]);
}
}
for(int i = 0; i < WifiConfiguration.Protocol.strings.length; i++){
if(wifiConfiguration.allowedProtocols.get(i)){
LogUtils.d(" allowedProtocols: " + WifiConfiguration.Protocol.strings[i]);
}
}
}
List<ScanResult> scanResults = wifiManager.getScanResults();
for(ScanResult scanResult : scanResults){
LogUtils.d("SSID: " + scanResult.SSID);
LogUtils.d(" capabilities:" + scanResult.capabilities);
}
SSID: "001D7382AF38O_G"
allowedGroupCiphers: WEP40
allowedGroupCiphers: WEP104
allowedGroupCiphers: TKIP
allowedGroupCiphers: CCMP
allowedKeyManagement: WPA_PSK
allowedPairwiseCiphers: TKIP
allowedPairwiseCiphers: CCMP
allowedProtocols: WPA
allowedProtocols: RSN
SSID: "001D7382AF38_G"
allowedGroupCiphers: WEP40
allowedGroupCiphers: WEP104
allowedGroupCiphers: TKIP
allowedGroupCiphers: CCMP
allowedKeyManagement: WPA_PSK
allowedPairwiseCiphers: TKIP
allowedPairwiseCiphers: CCMP
allowedProtocols: WPA
allowedProtocols: RSN
SSID: "(mobilecube)045028"
allowedGroupCiphers: WEP40
allowedGroupCiphers: WEP104
allowedGroupCiphers: TKIP
allowedGroupCiphers: CCMP
allowedKeyManagement: WPA_PSK
allowedPairwiseCiphers: TKIP
allowedPairwiseCiphers: CCMP
allowedProtocols: WPA
allowedProtocols: RSN
SSID: "Xperia A_24ff"
allowedGroupCiphers: WEP40
allowedGroupCiphers: WEP104
allowedGroupCiphers: TKIP
allowedGroupCiphers: CCMP
allowedKeyManagement: WPA_PSK
allowedPairwiseCiphers: TKIP
allowedPairwiseCiphers: CCMP
allowedProtocols: WPA
allowedProtocols: RSN
SSID: "TelepathyJapan"
allowedGroupCiphers: WEP40
allowedGroupCiphers: WEP104
allowedGroupCiphers: TKIP
allowedGroupCiphers: CCMP
allowedKeyManagement: WPA_PSK
allowedPairwiseCiphers: TKIP
allowedPairwiseCiphers: CCMP
allowedProtocols: WPA
allowedProtocols: RSN
SSID: "aterm-191395-a"
allowedGroupCiphers: WEP40
allowedGroupCiphers: WEP104
allowedGroupCiphers: TKIP
allowedGroupCiphers: CCMP
allowedKeyManagement: WPA_PSK
allowedPairwiseCiphers: TKIP
allowedPairwiseCiphers: CCMP
allowedProtocols: WPA
allowedProtocols: RSN
SSID: aterm-191395-a
capabilities:[WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS]
SSID: 001D7382AF38O_A
capabilities:[WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][WPS][ESS]
SSID: 001D7382AF38O_G
capabilities:[WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][WPS][ESS]
SSID: aterm-191395-g
capabilities:[WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS]
SSID: Frezzo network
capabilities:[WPA-PSK-TKIP][WPA2-PSK-CCMP+TKIP][ESS]
SSID: 001D7382AF38_G
capabilities:[WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][WPS][ESS]
SSID: (mobilecube)045028
capabilities:[WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][ESS]
SSID: au_Wi-Fi
capabilities:[WPA2-PSK-CCMP][ESS]
SSID: 4CE676F9CB4E_A-1
capabilities:[WPA-PSK-CCMP][WPS][ESS]
SSID: 4CE676F9CB4E_A
capabilities:[WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][ESS]
SSID:
capabilities:[WEP][ESS]
SSID:
capabilities:[WEP][ESS]
SSID: Wi2premium
capabilities:[ESS]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment