-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTweak.x
39 lines (34 loc) · 1.53 KB
/
Tweak.x
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
#import <UIKit/UIKit.h>
%group noKeyboard
%hook UIKeyboardPreferencesController
-(BOOL)isPasswordAutoFillAllowed {
return NO;
}
%end
%end
%ctor {
if (![NSProcessInfo processInfo]) return;
NSString* processName = [NSProcessInfo processInfo].processName;
BOOL isSpringboard = [@"SpringBoard" isEqualToString:processName];
BOOL shouldLoad = NO;
NSArray* args = [[NSClassFromString(@"NSProcessInfo") processInfo] arguments];
NSUInteger count = args.count;
if (count != 0) {
NSString* executablePath = args[0];
if (executablePath) {
NSString* processName = [executablePath lastPathComponent];
BOOL isApplication = [executablePath rangeOfString:@"/Application/"].location != NSNotFound || [executablePath rangeOfString:@"/Applications/"].location != NSNotFound;
BOOL isFileProvider = [[processName lowercaseString] rangeOfString:@"fileprovider"].location != NSNotFound;
BOOL skip = [processName isEqualToString:@"AdSheet"]
|| [processName isEqualToString:@"CoreAuthUI"]
|| [processName isEqualToString:@"InCallService"]
|| [processName isEqualToString:@"MessagesNotificationViewService"]
|| [executablePath rangeOfString:@".appex/"].location != NSNotFound;
if ((!isFileProvider && isApplication && !skip) || isSpringboard) {
shouldLoad = YES;
}
}
}
if (!shouldLoad) return;
%init(noKeyboard);
}