【问题标题】:Make alert display when Springboard is loaded iOS加载 Springboard iOS 时显示警报
【发布时间】:2015-07-01 17:23:54
【问题描述】:

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

%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

如果需要,我也可以发布我的控件和生成文件。

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

感谢您的阅读

【问题讨论】:

    标签: objective-c jailbreak theos uialertcontroller springboard


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-20
      • 1970-01-01
      • 2018-12-19
      • 1970-01-01
      • 2021-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多