나는이 질문을하기 전에 이렇게 검색했다. 내 요구를 만족시킬만한 대답이 없다.아이폰 탈옥 + 코드에서 들어오는 SMS를 차단하는 방법
그래서 이것은 내가 들어오는 SMS를 검출 코드의이 작품이 내 요구 사항,
이지만, 이러한 메시지를 덤프하는 방법을 말하지 않는다. 들어오는 호출을 성공적으로 차단했지만 메시지는이 작업을 수행하는 방법을 잘 모르겠습니다. 여기의 도움은 매우 감사 할 것입니다.
개인 API를 사용해도 괜찮습니다.
if ([notifyname isEqualToString:@"kCTSMSMessageReceivedNotification"])
{
if ([[(NSDictionary *)userInfo allKeys]
containsObject:@"kCTSMSMessage"]) // SMS Message
{
CTSMSMessage *message = (CTSMSMessage *)
[(NSDictionary *)userInfo objectForKey:@"kCTSMSMessage"];
NSString *address = CTSMSMessageCopyAddress(NULL, message);
NSString *text = CTSMSMessageCopyText(NULL, message);
//NSArray *lines = [text componentsSeparatedByString:@"\n"];
printf(" %s %s\n", [address UTF8String],[text UTF8String]);
//printf(" %s\n", [text cString]);
fflush(stdout);
}
}
else if ([notifyname isEqualToString:@"kCTMessageReceivedNotification"])//received SMS
{
/*
kCTMessageIdKey = "-2147483636″;
kCTMessageTypeKey = 1;
*/
NSDictionary *info = (NSDictionary *)userInfo;
CFNumberRef msgID = (CFNumberRef)[info objectForKey:@"kCTMessageIdKey"];
int result;
CFNumberGetValue((CFNumberRef)msgID, kCFNumberSInt32Type, &result);
/*
Class CTMessageCenter = NSClassFromString(@"CTMessageCenter");
id mc = [CTMessageCenter sharedMessageCenter];
id incMsg = [mc incomingMessageWithId: result];
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];
NSData *smsData = [incMsgPart data];
NSString *smsText = [[NSString alloc] initWithData:smsData encoding:NSUTF8StringEncoding];
}
*/
}
감사 나빈
안녕하세요 @YllierDev, 내가 선택한 SMS 번호를 완전히 거부하려면 첫 번째 번호를 찾고 있습니다. 프로세스 나 다른 링크를 설명하는 링크에 대한 자세한 정보를 제공해 주시겠습니까? 그리고 당신은 맞습니다. 그들 중 대부분은 결과를 공개하지 않습니다 :) – RVN
나는 상상력에 대한 경험이 없습니다. 메서드 또는 함수를 재정의하려면 MobileSubstrate를 사용해야합니다. http://iphonedevwiki.net/index.php/MobileSubstrate MobileSubstrate의 조정 방법을 모르는 경우 google을 사용해보세요. 거기에 작은 튜토리얼의 톤이 있습니다. 헤더를 처음으로 처리하는 것이 가장 좋습니다. 상상의 헤더와 관련된 개인 프레임 워크를 덤프하십시오. 또한, 당신은 아마 반전에 대한 지식이 필요합니다. – YllierDev
감사합니다. – RVN