3

如果我收到来自特殊发件人的短信,我正在尝试启动应用程序。目前我的 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中?我对越狱应用程序编码完全陌生。

4

2 回答 2

0

您的调整不需要 CoreTelephony.h

于 2014-03-30T10:30:58.730 回答
0

这个答案显示了如何使用类转储来获取 CoreTelephony 的私有标头。一旦你有了标题,就把它们放在 theos 的包含目录中。我认为/var/theos/include是默认值。我希望这有帮助。

于 2014-01-03T18:34:16.237 回答