-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathTweak.x
More file actions
57 lines (41 loc) · 1.31 KB
/
Tweak.x
File metadata and controls
57 lines (41 loc) · 1.31 KB
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
#import <SpringBoard/SBApplication.h>
#import <SpringBoard/SBApplicationInfo.h>
#import <theos/IOSMacros.h>
static BOOL shouldEnableForBundleIdentifier(NSString *bundleIdentifier) {
NSDictionary *prefs = [[NSUserDefaults standardUserDefaults] persistentDomainForName:@"com.ps.apppad"];
NSArray <NSString *> *value = [prefs objectForKey:@"AppPad"];
return ![value containsObject:bundleIdentifier];
}
%hook UIApplication
- (BOOL)_shouldBigify {
return shouldEnableForBundleIdentifier(NSBundle.mainBundle.bundleIdentifier);
}
%end
%group SB
%hook SBApplicationInfo
- (BOOL)disableClassicMode {
return shouldEnableForBundleIdentifier(self.bundleIdentifier) ? YES : %orig;
}
- (BOOL)wantsFullScreen {
return shouldEnableForBundleIdentifier(self.bundleIdentifier) ? NO : %orig;
}
- (BOOL)_supportsApplicationType:(int)type {
return %orig(type & 2 && shouldEnableForBundleIdentifier(self.bundleIdentifier) ? 1 : type);
}
%end
%hook SBApplication
- (BOOL)_supportsApplicationType:(int)type {
return %orig(type & 2 && shouldEnableForBundleIdentifier(self.bundleIdentifier) ? 1 : type);
}
- (NSInteger)_defaultClassicMode {
return shouldEnableForBundleIdentifier(self.bundleIdentifier) ? 0 : %orig;
}
%end
%end
%ctor {
if (IN_SPRINGBOARD) {
%init(SB);
} else {
%init;
}
}