转:iPhone开发技巧之私有API(1) — 设备相关信息
来源:互联网 发布:java购物网站源码 编辑:程序博客网 时间:2024/06/04 16:01
原文地址:http://www.yifeiyang.net/iphone-development-skills-of-the-private-api-1-equipment-information/
IMEI
可以在这里下载NetworkController.h, 或者使用你自己dump的版本。使用如下:
12345678
#import "NetworkController.h"// 获得IMEI// 需要 Message.framework+ (NSString*) getDeviceIMEI { NetworkController *ntc = [NetworkController sharedInstance]; return [ntc IMEI];}
IMSI
1234567
// 需要 CoreTelephony framework// 在文件开头加入extern NSString* CTSIMSupportCopyMobileSubscriberIdentity();+ (NSString*) getDeviceIMSI { return CTSIMSupportCopyMobileSubscriberIdentity();}
本机电话号码
1234567
// 需要 CoreTelephony framework// 在文件开头加入extern NSString* CTSettingCopyMyPhoneNumber();+ (NSString*) getPhoneCodeByCT { return CTSettingCopyMyPhoneNumber();}
动态加载Framework
除了使用Xcode将Framework加入工程,你也可以使用下面的方法,在程序中动态加载,比如取得IMEI的例子:
NSString* sdk_path = @"/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/"
"iPhoneSimulator${IPHONE_SDK}.sdk/System/Library/PrivateFrameworks";
NSBundle *b = [NSBundle bundleWithPath:[NSString stringWithFormat:@"%@/Message.framework", sdk_path]];
if ([b load]) { Class NetworkController = NSClassFromString(@"NetworkController"); id nc = [NetworkController sharedInstance]; NSLog(@"-- IMEI: %@", [nc IMEI]);}
- 转:iPhone开发技巧之私有API(1) — 设备相关信息
- iPhone开发技巧之私有API — 设备相关信息
- iPhone开发技巧之私有API — 设备相关信息
- iPhone开发技巧之私有API --- 设备相关信息
- iPhone开发技巧之私有API(1) --- 设备相关信息
- iPhone开发技巧之私有API(2)— UITableView
- iPhone开发技巧之私有API--- UIBarButtonItem
- iPhone开发技巧之私有API--- UISegmentedControl
- iPhone开发技巧之私有API--- UITableView
- iPhone开发技巧之私有API--- UIApplication
- iPhone开发技巧之私有API--- UIBarButtonItem
- iPhone开发技巧之私有API--- UIBarButtonItem
- iPhone开发技巧之私有API
- iPhone开发技巧之私有API--- UIBarButtonItem
- iPhone开发技巧之私有API(2)--- UITableView
- iPhone开发技巧之私有API(3)--- UIButton
- iPhone开发技巧之私有API(4)--- UIBarButtonItem
- iPhone开发技巧之私有API(5)--- UISegmentedControl
- uc/os中OSStart()函数分析
- ASICC码 utf-8
- 【转】Android WIFI 移植
- slickedit-猪哥的blog地址-猪哥的盒子地址
- PHP实现手机号码归属地查询
- 转:iPhone开发技巧之私有API(1) — 设备相关信息
- Wireshark使用说明
- WinCE系统音量的设置
- 读懂百句话,胜过十年窗(转贴)
- linux ulimit调优
- IIS可以访问HTML但访问不了ASP(终极解决之道)!
- 子网掩码
- PopMenu实现
- extjs 树总结(数据库层)