3

我如何找出 iOS8 中的 Wifi 信号强度(RSSI)?

我知道 Apple 限制应用程序直接访问 Wi-Fi 数据/API,并且不会在 AppStore 中被接受。我发现了一个名为 Stumbler 的私有 API,它应该做同样的事情。这是它的链接。访问和使用 MobileWiFi.framework

网络 = [[NSMutableDictionary alloc] init];

void* library = dlopen("/System/Library/SystemConfiguration/IPConfiguration.bundle/IPConfiguration", RTLD_LAZY);

int (*apple80211Open)(void*) = (int(*)(void*))dlsym(library, "Apple80211Open");

int (*apple80211Bind)(void*, NSString*) = (int(*)(void*, NSString*))dlsym(library, "Apple80211BindToInterface");
apple80211Close = (int(*)(void*))dlsym(library, "Apple80211Close");
apple80211Scan= (int(*)(void*, NSArray**, void*))dlsym(library, "Apple80211Scan");

void *airport = NULL;
apple80211Open(&airport);

apple80211Bind(airport, @"en0");

NSArray* arrNetworks = nil;
apple80211Scan(airport, &arrNetworks, (__bridge void *)(networks));

//"networks" is an array of NSDictionary objects for all the visible Wi-Fi networks

apple80211Close(airport);
dlclose(library);

不知何故,这在 iOS8 中不起作用。任何人都知道如何让这个工作?谢谢您的帮助 !!

4

0 回答 0