我想实现的功能是这样,hook住springboard,在applicationDidFinishLaunching中启动自己想要启动的应用(如QQ),其中代码实现如下:
//#import <SpringBoard/SpringBoard.h>
//#import <SpringBoardServices/SpringBoardServices.h>
#import <SpringBoard/SBApplication.h>
%hook SpringBoard
-(void)applicationDidFinishLaunching:(id)application {
%orig;
SBApplication* app = [SBApplicationController sharedInstance] applicationWithDisplayIdentifier:@“com.tencent.mqq”];
[SBUIController sharedInstance] activateApplicationAnimated:app];
}
%end
此处我用uialertview测试了是正常执行的,但是引入头文件,加入了启动APP的代码以后就报找不到头文件的错误,错误如下:
我在makefile中的内容如下所示:
export THEOS_DEVICE_IP = 192.168.1.13
export ARCHS = armv7 armv7s arm64
export TARGET = iphone:7.1:6.0
include theos/makefiles/common.mk
TWEAK_NAME = FirstTweakTest
FirstTweakTest_FILES = Tweak.xm
FirstTweakTest_PRIVATE_FRAMEWORKS = SpringBoardFoundation SpringBoardServices SpringBoardUI SpringBoardUIServices
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
install.exec “killall -9 com.zaidengdai.firsttweaktest”
在theos/include文件里面包含了github中iOS7的springboard头文件,结构如下所示:
我感觉是私有库使用不正确,实在不知道该怎么搞了,有知道的还望赐教啊,谢谢大家帮忙。谢谢。