-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTweak.m
More file actions
32 lines (26 loc) · 996 Bytes
/
Tweak.m
File metadata and controls
32 lines (26 loc) · 996 Bytes
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
#import <Foundation/Foundation.h>
#import "SKNotificationKeys.h"
@interface FBSystemService : NSObject
+ (instancetype)sharedInstance;
- (void)exitAndRelaunch:(BOOL)shouldRelaunch;
@end
@interface FBSSystemService : NSObject
+ (instancetype)sharedService;
- (void)reboot;
- (void)shutdown;
@end
static __attribute__((constructor)) void safeKillSpringBoardServer() {
dispatch_queue_t main_queue = dispatch_get_main_queue();
int respringRegToken;
notify_register_dispatch(kRespringNotifyKey, &respringRegToken, main_queue, ^(int token) {
[[FBSystemService sharedInstance] exitAndRelaunch:YES];
});
int rebootRegToken;
notify_register_dispatch(kRebootNotifyKey, &rebootRegToken, main_queue, ^(int token) {
[[FBSSystemService sharedService] reboot];
});
int shutdownRegToken;
notify_register_dispatch(kShutdownNotifyKey, &shutdownRegToken, main_queue, ^(int token) {
[[FBSSystemService sharedService] shutdown];
});
}