求证:信号强度(wifi和非wifi) imei号等在ios7.1.2怎么获取

在ios7.1.2下
尝试使用CoreTelephony.framework的 CTIndicator来获取蜂窝网信号的强度数值

long int raw = 0;
long int graded = 0;
long int bars = 0;
CTIndicatorsGetSignalStrength(&raw, &graded, &bars);

获取到的是4294967192,明显不对。。。。。
尝试使用MobileWiFi.framewor来获取wifi信号的强度数值(http://iphonedevwiki.net/index.php/MobileWiFi.framework)

WiFiManagerRef manager = WiFiManagerClientCreate(kCFAllocatorDefault, 0);
CFArrayRef devices = WiFiManagerClientCopyDevices(manager);
WiFiDeviceClientRef client = (WiFiDeviceClientRef)CFArrayGetValueAtIndex(devices, 0);
CFDictionaryRef data = (CFDictionaryRef)WiFiDeviceClientCopyProperty(client, CFSTR("RSSI"));
CFNumberRef scaled = (CFNumberRef)WiFiDeviceClientCopyProperty(client, kWiFiScaledRSSIKey);
CFNumberRef RSSI = (CFNumberRef)CFDictionaryGetValue(data, CFSTR("RSSI_CTL_AGR"));
int raw;
CFNumberGetValue(RSSI, kCFNumberIntType, &raw);
float strength;CFNumberGetValue(scaled, kCFNumberFloatType, &strength);
CFRelease(scaled);
strength *= -1; // Apple uses -3.0.
int bars = (int)ceilf(strength * -3.0f);
bars = MAX(1, MIN(bars, 3));
printf("WiFi signal strength: %d dBm\n\t Bars: %d\n", raw,  bars);
CFRelease(data);
CFRelease(scaled);
CFRelease(devices);
CFRelease(manager);

通过打印发现执行到

WiFiDeviceClientRef client = (WiFiDeviceClientRef)CFArrayGetValueAtIndex(devices, 0);

这里就没往下执行了
尝试使用liblockdown.dylib来获取imei号(http://iphonedevwiki.net/index.php/Liblockdown.dylib

LockdownConnectionRef connection = lockdown_connect();
NSString *imei = (NSString *)lockdown_copy_value(connection, NULL, kLockdownIMEIKey);
lockdown_disconnect(connection);

返回的是null
使用ikoit的category获取imei

NSArray *results = getValue(@"device-imei");

返回仍然是空的。。。。。。
我就想请教各位大神,到底是我写的问题还是在7.1.2下,这些都不能用了,如果是我的问题可否帮忙指点下,如果是不能用了,能否指一条明路该从哪里下手。。。。。:cry:

是未越狱iOS上测试的吗?

已经越过的

还有我现在是用在自己的daemon里面 用iosopendev开发的 因为又有wifi又有imei 所以两个要签名为true我写在一个xml里面

<?xml version="1.0" encoding="UTF-8"?> com.apple.wifi.manager-access com.apple.coretelephony.Identity.get 然后安装后把daemon的binary拷贝回到osx上 用ldid签 再把binary拷贝到ios上 我不知道怎么集成这个entitlement.xml签名到iosopendev里去。。。。。我这样做有影响吗?

你试试这几种方法在SpringBoard内部调用能否获取到真实的值,如果能的话,说明这几种方法还有效,daemon应该是缺了一些entitlements;如果不能,说明方法本身已失效了