-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3DAppLock.h
209 lines (164 loc) · 6.77 KB
/
3DAppLock.h
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
#import "substrate.h"
#import "PAPasscodeViewController/PAPasscodeViewController.h"
#import "UAObfuscatedString/UAObfuscatedString.h"
@interface SBSApplicationShortcutIcon : NSObject
@end
@interface SBSApplicationShortcutItem : NSObject
+ (instancetype)staticShortcutItemWithDictionary:(NSDictionary *)arg1 localizationHandler:(id)arg2;
- (void)setIcon:(SBSApplicationShortcutIcon *)arg1;
- (NSString *)type;
- (NSString *)bundleIdentifierToLaunch;
- (void)setBundleIdentifierToLaunch:(NSString *)arg1;
@end
@interface SBApplication : NSObject
- (NSArray *)staticApplicationShortcutItems;
- (NSArray *)dynamicApplicationShortcutItems;
- (NSString *)bundleIdentifier;
- (NSString *)displayName;
- (void)didExitWithContext:(id)arg1;
- (SBSApplicationShortcutItem *)createCustomShortcutItemForApplication:(SBApplication *)application;
@end
@interface UIStatusBar : UIView
- (UIColor *)foregroundColor;
- (void)setForegroundColor:(UIColor *)arg1;
@end
@interface UIApplication (ThreeDAppLock)
- (SBApplication *)_accessibilityFrontMostApplication;
- (void)_simulateHomeButtonPress;
@end
@interface SBStateSettings : NSObject
@end
@interface SBActivationSettings : NSObject
@end
@interface BSMutableSettings : NSObject
- (NSMutableIndexSet *)allSettings;
- (BOOL)boolForSetting:(unsigned int)arg1;
@end
@interface SBAppSwitcherModel : NSObject
- (void)_applicationActivationStateDidChange:(id)arg1 withLockScreenViewController:(id)arg2 andLayoutElement:(id)arg3;
- (void)lockFrontMostApplication:(SBApplication *)application;
@end
@interface UIApplicationShortcutIcon (ThreeDAppLock)
+ (id)iconWithCustomImage:(UIImage *)arg1 ;
- (SBSApplicationShortcutIcon *)sbsShortcutIcon;
@end
@interface SBUIAppIconForceTouchController : NSObject
+ (NSArray *)filteredApplicationShortcutItemsWithStaticApplicationShortcutItems:(NSArray *)arg1 dynamicApplicationShortcutItems:(NSArray *)arg2;
@end
@interface SBUIAppIconForceTouchControllerDataProvider
- (NSString *)applicationBundleIdentifier;
- (NSString *)applicationShortcutWidgetBundleIdentifier;
- (NSArray *)applicationShortcutItems;
@end
@interface SBIcon : NSObject
- (SBApplication *)application;
@end
@interface SBIconView : UIView
- (id)initWithContentType:(unsigned long long)arg1;
- (void)_updateJitter;
@end
@interface SBHomeScreenViewController : UIViewController
@end
@interface SBIconController : NSObject
+ (id)sharedInstance;
- (void)_dismissAppIconForceTouchControllerIfNecessaryAnimated:(BOOL)arg1 withCompletionHandler:(id)arg2;
- (BOOL)appIconForceTouchController:(SBUIAppIconForceTouchController *)arg1 shouldActivateApplicationShortcutItem:(SBSApplicationShortcutItem *)arg2 atIndex:(unsigned long long)arg3 forGestureRecognizer:(id)arg4;
- (void)clearHighlightedIcon;
- (void)_launchIcon:(SBIcon *)arg1;
- (void)verifyUnlockApplication:(SBApplication *)application;
- (void)lockFrontMostApplication:(SBApplication *)application;
@end
@interface SBApplicationController : NSObject
+ (id)sharedInstance;
- (NSArray *)allBundleIdentifiers;
- (SBApplication *)applicationWithBundleIdentifier:(NSString *)bundleIdentifier;
@end
@interface SBUIController : NSObject
+ (id)sharedInstance;
- (void)activateApplication:(SBApplication *)arg1;
@end
@interface SBDisplayItem : NSObject
- (NSString *)displayIdentifier;
@end
@interface SBAppSwitcherSnapshotView
+ (UIImageView *)appSwitcherSnapshotViewForDisplayItem:(SBDisplayItem *)arg1 orientation:(long long)arg2 preferringDownscaledSnapshot:(BOOL)arg3 loadAsync:(BOOL)arg4 withQueue:(id)arg5;
@end
@interface SBLockScreenManager : NSObject
-(void)_setUILocked:(BOOL)arg1;
@end
@interface LAContext : NSObject
- (void)setCancelButtonVisible:(BOOL)arg1;
- (void)setLocalizedFallbackTitle:(NSString *)arg1;
- (BOOL)canEvaluatePolicy:(int)arg1 error:(id *)arg2;
- (void)evaluatePolicy:(int)arg1 localizedReason:(id)arg2 reply:(void (^)(BOOL success, NSError *error))arg3;
@end
@interface CAFilter : NSObject
+ (id)filterWithName:(NSString *)arg1;
@end
@interface FBSystemService : NSObject
+ (id)sharedInstance;
- (void)exitAndRelaunch:(BOOL)arg1;
@end
@interface SBSRelaunchAction : NSObject
+ (id)actionWithReason:(id)arg1 options:(unsigned int)arg2 targetURL:(id)arg3;
@end
@interface FBSSystemService : NSObject
+ (id)sharedService;
- (void)sendActions:(NSSet *)arg1 withResult:(id)arg2;
@end
@interface ThreeDApplockPasscodeDelegate : NSObject <PAPasscodeViewControllerDelegate>
@end
typedef NS_ENUM (NSInteger, LAPolicy) {
LAPolicyDeviceOwnerAuthenticationWithBiometrics = 1
};
typedef NS_ENUM (NSInteger, LAError) {
LAErrorUserFallback = -3
};
static NSMutableDictionary *lockedApps = [NSMutableDictionary dictionary];
static SBHomeScreenViewController *homeScreenVC;
static UIStatusBar *statusBar;
static UIColor *originalColor;
static BOOL isAppExiting = NO;
static BOOL isAppLaunchingFromIcon = NO;
static NSUserDefaults *defaults;
static BOOL enabled;
static BOOL showSubtitle;
static BOOL alwaysPasscodeButton;
static void showAlertWithTitleAndMessage(NSString *title, NSString *message) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
#pragma clang diagnostic pop
}
static void lockAppWithIdentifier(NSString *identifier, BOOL lock) {
[lockedApps setObject:[NSNumber numberWithBool:lock] forKey:identifier];
[defaults setObject:lockedApps forKey:@"lockedApps"];
[defaults synchronize];
}
static void presentPasscodeScreenWithTag(int tag) {
PAPasscodeViewController *passcodeViewController;
if (![defaults objectForKey:@"passcode"]) {
passcodeViewController = [[PAPasscodeViewController alloc] initForAction:PasscodeActionSet];
}
else {
passcodeViewController = [[PAPasscodeViewController alloc] initForAction:PasscodeActionEnter];
passcodeViewController.passcode = [defaults objectForKey:@"passcode"];
}
passcodeViewController.delegate = [[ThreeDApplockPasscodeDelegate alloc] init];
passcodeViewController.view.tag = tag;
[homeScreenVC presentViewController:[[UINavigationController alloc] initWithRootViewController:passcodeViewController] animated:YES completion:^{
statusBar = MSHookIvar<UIStatusBar *>([UIApplication sharedApplication], "_statusBar");
[statusBar performSelector:@selector(setForegroundColor:) withObject:[UIColor blackColor] afterDelay:0.1];
}];
}
static void dismissPasscodeScreenAndResetStatusBar() {
[homeScreenVC dismissViewControllerAnimated:YES completion:nil];
statusBar = MSHookIvar<UIStatusBar *>([UIApplication sharedApplication], "_statusBar");
[statusBar setForegroundColor:originalColor];
}
static void homeButtonPress() {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[[UIApplication sharedApplication] _simulateHomeButtonPress];
});
}