-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlibPass_compat.m
More file actions
66 lines (53 loc) · 1.3 KB
/
libPass_compat.m
File metadata and controls
66 lines (53 loc) · 1.3 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
58
59
60
61
62
63
64
65
66
#import "libPass.h"
#define _LIBPASS_INTERNAL
#import "libPass_compat.h"
#undef _LIBPASS_INTERNAL
@implementation libPass
@synthesize delegate;
+(void)passwordWasEnteredHandler:(NSString *)password
{
[[LibPass sharedInstance] passwordWasEnteredHandler:password];
}
+ (void)togglePasscode
{
[[LibPass sharedInstance] togglePasscode];
}
+ (BOOL)toggleValue
{
return ![LibPass sharedInstance].isPasscodeOn;
}
+ (void)setPasscodeToggle:(BOOL)enabled
{
[[LibPass sharedInstance] setPasscodeToggle:enabled];
}
+ (BOOL)isPasscodeEntered
{
return [LibPass sharedInstance].devicePasscode != nil;
}
+ (BOOL)isPasscodeForced
{
return ![LibPass sharedInstance].isPasscodeOn;
}
+ (void)setIsPasscodeForced:(BOOL)value
{
[[LibPass sharedInstance] setPasscodeToggle:value];
}
+ (void)registerForEvent:(NSString *)event fromSender:(NSString *)sender
{
// always has been just an empty stub...
}
+ (void)unlockWithCodeEnabled:(BOOL)enabled
{
[[LibPass sharedInstance] unlockWithCodeEnabled:enabled];
}
+ (void)lockWithCodeEnabled:(BOOL)enabled
{
[[LibPass sharedInstance] lockWithCodeEnabled:enabled];
}
+ (void)respringAfterDelay:(int)seconds
{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, seconds * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
system("killall -9 backboardd");
});
}
@end