如果我收到来自特殊发件人的短信,我正在尝试启动应用程序。目前我的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这是makefile:
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中吗?我对越狱应用编程完全是个新手。
发布于 2014-01-04 02:34:16
这个answer展示了如何使用类转储来获取CoreTelephony的私有头。获得头文件后,将它们放入theos的include目录中。我认为/var/theos/include是默认的。我希望这能帮到你。
发布于 2014-03-30 18:30:59
对于您的调整,CoreTelephony.h y.h是不必要的
https://stackoverflow.com/questions/20909914
复制相似问题