如果我收到来自特殊发件人的短信,我正在尝试启动应用程序。目前我的 Tweak.xm 看起来像这样:
#import <SpringBoard/SpringBoard.h>
#import <UIKit/UIKit.h>
#import <ChatKit/ChatKit.h>
#import <ChatKit/CKSMSMessage.h>
#import <ChatKit/CKSMSEntity.h>
#import <ChatKit/CKSMSService.h>
#import <ChatKit/CKConversation.h>
#import <CoreTelephony/CoreTelephony.h>
%hook SMSCTServer
- (void)_ingestIncomingCTMessage:(CTMessage *)arg1
{
%orig;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome"
message:@"Received :D!"
delegate:nil
cancelButtonTitle:@";)"
otherButtonTitles:nil];
[alert show];
[alert release];
}
%end
%hook SpringBoard
-(void)applicationDidFinishLaunching:(id)application {
%orig;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome"
message:@"Test!"
delegate:nil
cancelButtonTitle:@"Test"
otherButtonTitles:nil];
[alert show];
[alert release];
}
%end
%hook CKSMSService
-(void)_receivedMessage:(CKSMSRecordRef)message replace:(BOOL)replace{
NSLog(@"received message %@", message);
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome"
message:@"Welcome to your iPhone Brandon!"
delegate:nil
cancelButtonTitle:@"Thanks"
otherButtonTitles:nil];
[alert show];
[alert release];
%orig;
}
%end
这是生成文件:
include theos/makefiles/common.mk
TWEAK_NAME = Mytweak
Mytweak_FILES = Tweak.xm
Mytweak_FRAMEWORKS = ChatKit Foundation CoreGraphics UIKit AudioToolbox
Mytweak_PRIVATE_FRAMEWORKS = CoreTelephony
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
install.exec "killall -9 SpringBoard"
但我不知道如何安装 Coretelephonyframework,我总是得到错误:
Tweak.xm:8:9: fatal error: 'CoreTelephony/CoreTelephony.h' file not found
import <CoreTelephony/CoreTelephony.h>
有谁知道如何将框架安装到theos中?我对越狱应用程序编码完全陌生。