2015-04-23 69 views
0

我最近一直在尝试使用Theos和Obj-C进入iOS开发。我目前正在尝试为运行8.1.1的iPhone 5s进行微调,这个版本已经越狱了。我目前正在通过SSH编译设备上的所有内容。我一直在试图编写一个调整,只要在加载Springboard的时候显示一个警报(就在设备第一次重新启动后)。尽管四处搜寻,我还没有找到解决办法。当我安装.deb并respring时,我看不到任何警报。我很困惑,为什么它没有显示,这里是我的tweak.xm文件中的代码。加载Springboard时发出警报显示iOS

%hook SpringBoard // Hook SpringBoard, because that is the class that has the method you want to hook 
-(void)applicationDidFinishLaunching // When this method is called, you want to execute your code 
{ 
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"AlertView in iOS 8" message:nil preferredStyle:UIAlertControllerStyleAlert]; 
[alertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { 
[self dismissViewControllerAnimated:YES completion:nil]; 
}]]; 
[self presentViewController:alertController animated:YES completion:nil]; 
%orig; // call normal function so SpringBoard loads. 
} 
%end 

我有一个非常困难的时候得到这些代码有那么这里有一个模式可读版本https://ghostbin.com/paste/fmv6m

我可以张贴我的控制,并在需要的Makefile为好。

总结: 包是用该代码创建的,但它什么都不做。我想知道为什么以及如何修复它,以便在加载Springboard时显示警报。

感谢您的阅读

回答

1

使用锁定屏幕的视图控制器。钩SBLockScreenViewControllerviewDidAppear