-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tweak.xm
43 lines (34 loc) · 970 Bytes
/
Tweak.xm
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
#import<SpringBoard/SBApplicationController.h>
#import<SpringBoard/SpringBoard.h>
#import<SpringBoard/VolumeControl.h>
#import<SpringBoard/SBAlert.h>
%hook SpringBoard
-(void)applicationDidFinishLaunching:(id)application {
%orig;
// Checking if headphones are present or not
BOOL isPresent = YES;
if(isPresent){
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hi Akash"
message:@"Headphone present"
delegate:nil
cancelButtonTitle:@"I Know"
otherButtonTitles:nil];
[alert show];
[alert release];
}
else{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hi Akash"
message:@"Headphone is not present"
delegate:nil
cancelButtonTitle:@"I Know"
otherButtonTitles:nil];
[alert show];
[alert release];
}
}
-(void)powerDownRequested:(id)requested{
NSLog(@"Power down is requested ------------ from the tweaks by akkyyaa");
NSLog(@"And Class is %@",NSStringFromClass([requested class]));
%orig;
}
%end