How to know the security type like OPEN, WPA, WPA2, WEP, when using Apple80211 api?

不羁岁月 提交于 2019-12-24 00:44:19

问题


The wifi scanning apps like eWifi, WiFiFoFum and so on in Cydia can know the security type. How the apps know the security type like OPEN, WPA, WPA2, WEP, when using Apple80211 api?

The value of CAPABILITIES is 1057, 1025,34,33,2,1073,1041 and 3121, etc... It is too various. I don't know what it represents. I am using "WEP" and "WPA_IE" key to obtain Boolean for NSDictionary, but It is not enough. Some access points is OPEN, but it is definally WPA2.

Anyone have an ideas? Please.


回答1:


I have found out the solution. Have a look the below. You can do more details using the wep, wpa, rsn. Thanks.

int adhoc = [network objectForKey:@"AP_MODE"];

if (adhoc == 1)
{
    ret =@"AdHoc network";
} 
else
{
    id wep = [network objectForKey:@"WEP"];
    id wpa = [network objectForKey:@"WPA_IE"];
    id rsn = [network objectForKey:@"RSN_IE"];

    if(wep) {
        ret =@"Secured network (WEP)";
    } else if (wpa && rsn) {
        ret =@"Secured network (WPA, WPA2)";
    } else if (wpa) {
        ret =@"Secured network (WPA)";
    } else if (rsn) {
        ret =@"Secured network (WPA2)";
    } else {
        ret =@"Open Network";
    }
}


来源:https://stackoverflow.com/questions/3666696/how-to-know-the-security-type-like-open-wpa-wpa2-wep-when-using-apple80211-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!