-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.m
executable file
·49 lines (38 loc) · 942 Bytes
/
main.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#import <UIKit/UIKit.h>
UIWindow* getAppWindow() {
UIWindow* TheWindow = nil;
UIApplication* App = [UIApplication sharedApplication];
NSArray* windows = [App windows];
int i;
for(i = 0; i < [windows count]; i++) {
TheWindow = [windows objectAtIndex:i];
if([TheWindow respondsToSelector:@selector(getCurrentTheme)])
{
break;
}
}
if(i == [windows count]) {
TheWindow = [App keyWindow];
}
return TheWindow;
}
BOOL isCapable() {
if(![[NSFileManager defaultManager] fileExistsAtPath:@"/openiboot"]) { //Check if OpeniBoot is installed
return NO;
}
return YES;
}
BOOL isEnabled() {
return NO;
}
void setState(BOOL Enable) {
if(Enable) {
notify_post("be.dawson.quickboot"); //Call the actual function as we need to be root to modify IOReg
sleep(3);
UIWindow* Window = getAppWindow();
[Window closeButtonPressed];
}
}
float getDelayTime() {
return 3.0f; //10 seconds until reboot kicks in
}