-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tweak.xm
49 lines (31 loc) · 916 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
#import <UIKit/UIKit.h>
%hook SBAwayLockBar
-(void)_setLabel:(id)label {
NSMutableDictionary *plist = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.abart997.labelslide.plist"];
NSString *text = (id)[plist objectForKey:@"label"];
static BOOL value = NO;
static BOOL values = NO;
static BOOL valuet = NO;
value = [[plist objectForKey:@"enabled"]boolValue];
values = [[plist objectForKey:@"customText"]boolValue];
valuet = [[plist objectForKey:@"thetime"]boolValue];
if(!value){
return %orig;
} else if(values){
label = text;
}
%orig;
if(!value){
return %orig;
} else if(valuet){
NSDateFormatter *dt = [[NSDateFormatter alloc] init];
[dt setDateStyle:NSDateFormatterNoStyle];
[dt setTimeStyle:NSDateFormatterShortStyle];
[dt setDateFormat:@"dd-MM-YYYY"];
NSString *time = [dt stringFromDate:[NSDate date]];
[dt release];
label = time;
}
%orig;
}
%end