-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTweak.xm
50 lines (45 loc) · 1001 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
44
45
46
47
48
49
50
#import <UIKit/UIKit.h>
#import <SpringBoard/SpringBoard.h>
//#import "UIApplication.h"
BOOL optionsPresented = NO;
%hook SBScreenShotter
-(void)saveScreenshot:(BOOL)arg1
{
if(optionsPresented == NO)
{
UIAlertView *options = [[UIAlertView alloc] init];
[options setTitle:@"Screenshot Options"];
[options setMessage:@"What do you want to do?"];
[options setDelegate:self];
[options addButtonWithTitle:@"Save Screenshot"];
[options addButtonWithTitle:@"Open Screenshot"];
[options addButtonWithTitle:@"Discard Screenshot"];
[options show];
[options release];
}
else
{
%orig;
optionsPresented = NO;
}
}
%new
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 0)
{
optionsPresented = YES;
[self saveScreenshot:YES];
}
else if (buttonIndex == 1)
{
//optionsPresented = YES;
//[self saveScreenshot:YES];
//OPEN PHOTO APP AND OPEN MOST RECENT FILE
}
else if (buttonIndex == 2)
{
return;
}
}
%end