Ios拦截手机短信程序
- //extern id allIncomingMessages;
- //extern int incomingMessageCount;
- extern NSString* const kCTSMSMessageReceivedNotification;
- extern NSString* const kCTSMSMessageReplaceReceivedNotification;
- extern NSString* const kCTSIMSupportSIMStatusNotInserted;
- extern NSString* const kCTSIMSupportSIMStatusReady;
- //typedef struct _CTCall CTCall;
- extern NSString *CTCallCopyAddress(void*, CTCall *);
- void* CTSMSMessageSend(id server,id msg);
- typedef struct __CTSMSMessage CTSMSMessage;
- NSString *CTSMSMessageCopyAddress(void *, CTSMSMessage *);
- NSString *CTSMSMessageCopyText(void *, CTSMSMessage *);
- int CTSMSMessageGetRecordIdentifier(void * msg);
- NSString * CTSIMSupportGetSIMStatus();
- NSString * CTSIMSupportCopyMobileSubscriberIdentity();
- id CTSMSMessageCreate(void* unknow/*always 0*/,NSString* number,NSString* text);
- void * CTSMSMessageCreateReply(void* unknow/*always 0*/,void * forwardTo,NSString* text);
- id CTTelephonyCenterGetDefault(void);
- void CTTelephonyCenterAddObserver(id,id,CFNotificationCallback,NSString*,void*,int);
- void CTTelephonyCenterRemoveObserver(id,id,NSString*,void*);
- int CTSMSMessageGetUnreadCount(void);
- static void callback(CFNotificationCenterRef center,void *observer,CFStringRef name,const void *object, CFDictionaryRef userInfo){
- // NSLog(@"%@",name);
- NSString *strNotficationName=(NSString*)name;
- if ([strNotficationName isEqualToString:@"kCTMessageReceivedNotification"]) {
- int a=0;
- }
- // NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- @synchronized(nil) {
- if (!userInfo) return;
- if ([[(NSDictionary *)userInfo allKeys]
- containsObject:@"kCTMessageIdKey"]) // SMS Message
- {
- NSDictionary *info = (NSDictionary *)userInfo;
- CFNumberRef msgID = (CFNumberRef)[info objectForKey:@"kCTMessageTypeKey"];
- int result;
- CFNumberGetValue((CFNumberRef)msgID, kCFNumberSInt32Type, &result);
- Class CTTelephonyCenter=NSClassFromString(@"CTTelephonyCenter");
- Class CTMessageCenter = NSClassFromString(@"CTMessageCenter");
- id mc = [CTMessageCenter sharedMessageCenter];
- int count=[mc incomingMessageCount];
- id mcarr=[mc allIncomingMessages];
- // id incMsg =[mc incomingMessageWithId:result];
- // if (count==0) {
- // return;
- // }
- id incMsg = [[mc allIncomingMessages] objectAtIndex:0];
- int msgType = (int)[incMsg messageType];
- if (msgType == 1) //experimentally detected number
- {
- id phonenumber = [incMsg sender];
- NSString *senderNumber = (NSString *)[phonenumber canonicalFormat];
- id incMsgPart = [[[[incMsg items] objectAtIndex:0] retain] retain];
- NSData *smsData = [[[incMsgPart data] retain] retain];
- // NSString *smsText = (NSString*)[[NSString alloc] initWithData:smsData encoding:NSASCIIStringEncoding] ;
- NSString *smsText = [NSString stringWithUTF8String:[smsData bytes]];
- NSLog(@"senderNumber = %@,text =%@",senderNumber,smsText);
- }
- }
- }
- // [pool release];
- }
- - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
- {
- self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- // Override point for customization after application launch.
- self.window.backgroundColor = [UIColor whiteColor];
- [self.window makeKeyAndVisible];
- id ct = CTTelephonyCenterGetDefault();
- CTTelephonyCenterAddObserver(ct, NULL, callback, NULL, NULL, CFNotificationSuspensionBehaviorDrop);
- }
- CallTest.zip (94.6 KB)
Ios拦截手机短信程序的更多相关文章
- Atitit. 破解 拦截 绕过 网站 手机 短信 验证码 方式 v2 attilax 总结
Atitit. 破解 拦截 绕过 网站 手机 短信 验证码 方式 v2 attilax 总结 1. 验证码的前世今生11.1. 第一代验证码 图片验证码11.2. 第二代验证码 用户操作 ,比如 ...
- server宕机监控、检測、报警程序(139绑定手机短信报警)monitor_down.sh
宕机监控报警程序 一. 需求来源 宕机对运维人员来说,最痛苦了.怎样检測一台server是否还在正常执行,假设该server宕机,怎样在第一时间监測到并通知一线运维人员进行维护,最大化降低损失. ...
- atitit.破解 拦截 绕过 网站 手机 短信 验证码 之自动获取手机短信方式 attilax 总结
atitit.破解 拦截 绕过 网站 手机 短信 验证码 之自动获取手机短信方式 attilax 总结 1. 自动获取手机短信方式的原理 1 2. 调用api 1 3. ----核心代码 2 4. ...
- SNF开发平台WinForm之十二-发送手机短信功能调用-金笛-SNF快速开发平台3.3-Spring.Net.Framework
1.调用前组装参数 2.调用发送信息服务脚本 .调用前组装参数: BaseSendTaskEntity entity = new BaseSendTaskEntity(); entity.Mess ...
- 利用java实现的一个发送手机短信的小例子
今天闲来无事,在微博上看到一个关于用java实现的一个发送手机短信的程序,看了看,写的不太相信,闲的没事,把他整理下来,以后可能用得着 JAVA发送手机短信,流传有几种方法:(1)使用webservi ...
- C#简单实现发送手机短信
偶然想起,像编写一个从电脑向手机发送短信的程序,从网上查找到有三种方式:(1)使用webservice接口发送手机短信,这个可以使用sina提供的webservice进行发送,但是需要进行注册;(2) ...
- Android(java)学习笔记247:ContentProvider使用之利用ContentProvider备份和还原手机短信(掌握)
1.通过阅读系统源码我们知道: 短信的内容提供者: content://sms/ 系统短信的内容提供者的路径 2. 利用ContentProvider备份和还原手机短信: (1) ...
- JAVA发送手机短信
<p><span>JAVA发送手机短信,流传有几种方法:(1)使用webservice接口发送手机短信,这个可以使用sina提供的webservice进行发送,但是需要进行注册 ...
- Android(java)学习笔记191:ContentProvider使用之利用ContentProvider备份和还原手机短信(掌握)
1. 通过阅读系统源码我们知道: 短信的内容提供者: content://sms/ 系统短信的内容提供者的路径 2. 利用ContentProvider备份和还原手机短信: (1 ...
随机推荐
- codeforces 676C C. Vasya and String(二分)
题目链接: C. Vasya and String time limit per test 1 second memory limit per test 256 megabytes input sta ...
- Meta也很强
<!--http-equiv 必要属性--> <meta http-equiv="Content-Type" content="text/html; c ...
- php中一串数子的转化
echo "<meta charset=utf-8>"; echo "笔试题测试"; $str = "123456780"; $ ...
- 网络安全-PGP实现电子邮件加密
PGP机制
- Windows Kernel Way 1:Windows内核调试技术
掌握Windows内核调试技术是学习与研究Windows内核的基础,调试Windows内核的方式大致分为两种: (1)通过Windbg工具在Windows系统运行之初连接到Windows内核,连接成功 ...
- cocos2d-x一些核心概念截杀
Cocos2d-x中有很多概念,这些概念很多来源于动画.动漫和电影等行业,例如:导演.场景和层等概念,当然也有些有传统的游戏的概念.Cocos2d-x中核心概念:导演, 场景,层,节点,精灵,菜单动作 ...
- dateset是不是在缓存中
C#开发erp系统的时候有一个多表数据的查询展示到页面,采用了存储过程的方式,但是存储过程中没有加入分页(菜比).刚开始测试数据几百条没有问题,当数据量提升至十万级后页面加载速度就很卡了,一般是使用分 ...
- in C#,编译型常量(const)和运行时常量(readonly)
readonly 关键字与 const 关键字不同. const 字段只能在该字段的声明中初始化. readonly 字段可以在声明或构造函数中初始化. 因此,根据所使用的构造函数, readonly ...
- spring注解中使用properties文件
一.只读取单个 properties 文件 1.在 spring 的配置文件中,加入 引入命名空间: xmlns:util="http://www.springframework.org/s ...
- Ajax 技术二
一.Ajax与XML案例 例:使用Ajax+XML读取数据表中的分类信息并放入下拉选框中 demo01.php 运行结果: 二.Ajax中的JSON 在Javascript中,可以通过两种方式(XML ...