iOS 7(非越狱)Wi-Fi RSSI值

iOS 7(非越狱)Wi-Fi RSSI值,第1张

概述是否有可能在非越狱的iOS 7设备上获得Wi-Fi RSSI值?我阅读了有关MobileWiFi.framework和Apple80211功能的内容,如果我理解正确,他们在没有越狱的情况下无法工作. 我不想在AppStore上发布我的应用程序,因此允许使用PrivateAPI. 我无法找到原来的帖子,但它在运行iOS 7.1的监狱设备上适用于我(在iOS 8上不起作用): #include <dl 是否有可能在非越狱的iOS 7设备上获得Wi-Fi RSSI值?我阅读了有关MobileWiFi.framework和Apple80211功能的内容,如果我理解正确,他们在没有越狱的情况下无法工作.

我不想在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值所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1024425.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-23
下一篇2022-05-23

发表评论

登录后才能评论

评论列表(0条)

    保存