hoerresb / WifiWizard

A Cordova plugin for managing Wifi networks
Apache License 2.0
205 stars 176 forks source link

Grab security protocol with .getScanResults #36

Closed derek1906 closed 9 years ago

derek1906 commented 9 years ago

Is it possible for .getScanResults to include the used security protocol in the returned object? It would be nice if it can achieve this. An example returned object would be something similar to this:

{
    BSSID: "...",
    SSID: "...",
    level: ...,
    algorithm: "WPA"
}
hoerresb commented 9 years ago

This is definitely possible yes. In the scan results we can check the wifi capabilities.

Referencing this post. http://stackoverflow.com/questions/28905604/android-detecting-if-wifi-is-wep-wpa-wpa2-etc-programmatically On Jul 14, 2015 12:15 AM, "Derek Leung" notifications@github.com wrote:

Is it possible for .getScanResults to include the used security protocol in the returned object? It would be nice if it can achieve this. An example returned object would be something similar to this:

{ BSSID: "...", SSID: "...", level: ..., algorithm: "WPA" }

— Reply to this email directly or view it on GitHub https://github.com/parsonsmatt/WifiWizard/issues/36.

hoerresb commented 9 years ago

I've added the wifi capabilities to getScanResults. The results will look similar to this now

{
     BSSID: "..."
     SSID: "..."
     capabilities: "[WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][ESS]"
     frequency: 2452
     level: 3
     timestamp: 21407208451
}

It will be very easy to parse out the results of the capabilities depending on the type you are looking for. Ex,

     if(results.capabilities.indexOf('WPA2') > -1){
         //WPA2
     }else if(results.capabilities.indexOf('WEP') > -1){
         //WEP
    } //etc.