ios - 使用 theos tweak 在收到的短信上启动应用程序

标签 ios iphone jailbreak cydia theos

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

最佳答案

answer展示了如何使用类转储获取 CoreTelephony 的私有(private) header 。一旦你有了头文件,就把它们放在 theos 的 include 目录中。我认为 /var/theos/include 是默认的。我希望这会有所帮助。

关于ios - 使用 theos tweak 在收到的短信上启动应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20909914/

相关文章:

ios - 表格 View 未快速加载

iphone - 一个强大的、功能齐全的 UIWebView Controller 实现?

iphone - 我可以在给定时间仅播放任何缓冲区一次吗?

ios - 无法检测到内存泄漏Xcode

iphone - 如何从 Mac 上的终端检查 iPhone 是否越狱?

ios - 如何在越狱的 iOS 5 中启用 ChatKit CKMadridService?

ios - iphone 越狱开发与公共(public) API

ios - AFNetworking - 下载文件,意外消息格式 'Raw'

ios - 平台 "android"似乎不是有效的 cordova 平台。它缺少 API.js。安卓不支持

android - 跟踪移动本地数据库和可选云数据库之间的已删除条目