-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTweak.xm
61 lines (39 loc) · 1.11 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#import <UIKit/UIKit.h>
@interface SBIconController : NSObject { }
+(SBIconController*)sharedInstance;
-(void)setIsEditing:(BOOL)editing;
-(BOOL)isEditing;
@end
@interface SBIcon { }
-(id)applicationBundleID;
@end
@interface UIApplication (MessageTo)
-(void)applicationOpenURL:(id)url;
@end
%hook SBIcon
-(void)touchesEnded:(id)ended withEvent:(id)event {
%orig;
if ([[objc_getClass("SBIconController") sharedInstance] isEditing]) {
NSSet *touchSet = [event allTouches];
switch ([touchSet count]){
case 1: {
UITouch *touchAmount = [[touchSet allObjects] objectAtIndex:0];
switch ([touchAmount tapCount]) {
case 1: {
}
break;
case 2: {
if([[self applicationBundleID] isEqualToString:@"com.apple.mobilemail"]) {
[[UIApplication sharedApplication] applicationOpenURL:[NSURL URLWithString:[NSString stringWithFormat:@"mailto:"]]];
}
if([[self applicationBundleID] isEqualToString:@"com.apple.MobileSMS"]) {
[[UIApplication sharedApplication] applicationOpenURL:[NSURL URLWithString:[NSString stringWithFormat:@"sms:+"]]];
}
break;
}
}
}
}
}
}
%end