iDeviceを再起動して再起動するアプリを作成しようとしています。私のコードは iOS シミュレーターでは正常に動作しますが、私の iDevice では何も起こりません (はい、ジェイルブレイクされています)。
呼吸するための私のコードは次のとおりです。
if(system("killall SpringBoard"));
if(system("killall -9 SpringBoard"));
if (system([@ "reboot" UTF8String]));
if ([[[UIDevice currentDevice] systemVersion] hasPrefix:@"2."])
notify_post("com.apple.language.changed");
if (system([@ "killall SpringBoard" UTF8String]));
再起動するための私のコードは次のとおりです。
if (system([@ "reboot" UTF8String]));
respring は 1 回しか機能せず、機能しなくなります:(
私のスクリプト:
#!/bin/sh
# Script.sh
# Respring
#
# Created by David on 08.11.12.
# Copyright (c) 2012 David. All rights reserved.
app binary - root:wheel 4755
script - root:wheel 0755
C=/${0}
C=${C%/*}
declare -a flags
[[ :${DYLD_INSERT_LIBRARIES}: == */MobileSubstrate.dylib: ]] && flags[${flags[@]}]=--substrate
exec "${C:-.}"/Respring "${flags[@]}" -- "$@" 2>>/tmp/Respring.log
これは、呼吸が機能しない場合にバグレポートで再起動および再起動するための私の alertView です。
//Respring
-(IBAction)respring {
UIAlertView *respring=[[UIAlertView alloc]initWithTitle:@"Respring"
message:@"Do you want to respring your iDevice?"
delegate:self
cancelButtonTitle:@"No"
otherButtonTitles:@"Yes", nil];
respring.tag = 1;
[respring show];
}
//AlertView
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1){
if (alertView.tag ==1) {
setuid(0); system("killall i5MMS_");
UIAlertView *respringerror=[[UIAlertView alloc]initWithTitle:@"Error"
message:@"Respring is not possible, please send me an Bug Report."
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:@"Send Bug Report",nil];
respringerror.tag = 3;
[respringerror show];
}
if (alertView.tag ==2) {
if (system([@ "reboot" UTF8String]));
UIAlertView *respringerror=[[UIAlertView alloc]initWithTitle:@"Error"
message:@"Rebooting is not possible, please send me an Bug Report."
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:@"Send Bug Report", nil];
respringerror.tag = 4;
[respringerror show];
}
if (alertView.tag ==3) {
iDevice.text = [UIDevice currentDevice]. model;
ios.text = [UIDevice currentDevice]. systemVersion;
MFMailComposeViewController *composer = [[MFMailComposeViewController alloc] init];
[composer setMailComposeDelegate:self];
if ([MFMailComposeViewController canSendMail]) {
[composer setToRecipients:[NSArray arrayWithObjects:@"david.goelzhaeuser@me.com", nil]];
[composer setSubject:@"Bug Report"];
[composer setMessageBody: [NSString stringWithFormat: @"%@ \n%@ \n%@", ios.text,iDevice.text, jailbreakstatus.text]isHTML:NO];
[composer setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[composer setModalPresentationStyle:UIModalPresentationFormSheet];
[self presentModalViewController:composer animated:YES];
}
}
if (alertView.tag ==4) {
iDevice.text = [UIDevice currentDevice]. model;
ios.text = [UIDevice currentDevice]. systemVersion;
MFMailComposeViewController *composer = [[MFMailComposeViewController alloc] init];
[composer setMailComposeDelegate:self];
if ([MFMailComposeViewController canSendMail]) {
[composer setToRecipients:[NSArray arrayWithObjects:@"david.goelzhaeuser@me.com", nil]];
[composer setSubject:@"Bug Report"];
[composer setMessageBody: [NSString stringWithFormat: @"%@ \n%@ \n%@", ios.text,iDevice.text, jailbreakstatus.text]isHTML:NO];
[composer setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[composer setModalPresentationStyle:UIModalPresentationFormSheet];
[self presentModalViewController:composer animated:YES];
}
}
}
}
//Reboot
-(IBAction)reboot;{
UIAlertView *reboot=[[UIAlertView alloc]initWithTitle:@"Reboot"
message:@"Do you want to reboot your iDevice? If you have a tethered jailbreak you have to make a tethered boot after rebooting!"
delegate:self
cancelButtonTitle:@"No"
otherButtonTitles:@"Yes", nil];
reboot.tag = 2;
[reboot show];
}