
我不想在AppStore上发布我的应用程序,因此允许使用PrivateAPI.
解决方法 我无法找到原来的帖子,但它在运行iOS 7.1的监狱设备上适用于我(在iOS 8上不起作用):#include <dlfcn.h>-(NSDictionary *)currentWiFiInfo{ voID *libHandle; voID *airportHandle; int (*apple80211Open)(voID *); int (*apple80211Bind)(voID *,Nsstring *); int (*apple80211Close)(voID *); int (*apple80211GetInfocopy)(voID *,CFDictionaryRef *); NSMutableDictionary *infoDict = [NSMutableDictionary new]; NSDictionary * tempDictionary; libHandle = dlopen("/System/library/SystemConfiguration/IPConfiguration.bundle/IPConfiguration",RTLD_LAZY); char *error; if (libHandle == NulL && (error = dlerror()) != NulL) { NSLog(@"%s",error); } apple80211Open = dlsym(libHandle,"Apple80211Open"); apple80211Bind = dlsym(libHandle,"Apple80211BindToInterface"); apple80211Close = dlsym(libHandle,"Apple80211Close"); apple80211GetInfocopy = dlsym(libHandle,"Apple80211GetInfocopy"); apple80211Open(&airportHandle); apple80211Bind(airportHandle,@"en0"); CFDictionaryRef info = NulL; apple80211GetInfocopy(airportHandle,&info); tempDictionary = (__brIDge NSDictionary *)info; apple80211Close(airportHandle); [infoDict setobject:(tempDictionary[@"RSSI"])[@"RSSI_CTL_AGR"] ? (tempDictionary[@"RSSI"])[@"RSSI_CTL_AGR"] : @"0" forKey:@"RSSI"]; [infoDict setobject:tempDictionary[@"BSSID"] ? tempDictionary[@"BSSID"] : @"null" forKey:@"BSSID"]; [infoDict setobject:tempDictionary[@"SSID_STR"] ? tempDictionary[@"SSID_STR"] : @"null" forKey:@"SSID"]; [infoDict setobject:tempDictionary[@"RATE"] ? tempDictionary[@"RATE"] : @"0" forKey:@"SPEED"]; return infoDict;} 总结 以上是内存溢出为你收集整理的iOS 7(非越狱)Wi-Fi RSSI值全部内容,希望文章能够帮你解决iOS 7(非越狱)Wi-Fi RSSI值所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)