【问题标题】:How to add reboot button to Jailbreak Application in Theos如何在 Theos 中将重启按钮添加到越狱应用程序
【发布时间】:2015-07-14 12:25:33
【问题描述】:

要制作respring按钮,我可以编写如下代码:

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [btn setTitle:@"Respring" forState:UIControlStateNormal];
    btn.frame = CGRectMake(100,50,120,100);

    [btn addTarget:self action:@selector(buttonPushed:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
}

- (void)buttonPushed:(id)sender

{
    system("killall -9 SpringBoard");
    return;

}

但是要制作重启按钮,它似乎无法做到这一点。
我应该写什么代码?

【问题讨论】:

    标签: ios button jailbreak reboot theos


    【解决方案1】:

    尝试做这样的事情:

    - (void)buttonPushed:(id)sender
    
    {
        [[UIApplication sharedApplication] reboot];
        return;
    
    }
    

    我在找到here 的示例项目中进行了尝试,并且成功了。我将模板的调用替换为

    [[UIApplication sharedApplication] relaunchSpringBoard];
    

    [[UIApplication sharedApplication] reboot];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-19
      • 2013-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多