-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTweak.xm
54 lines (47 loc) · 1.31 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
%group iOS11 //iOS 11 code by AndyWiik
@interface LayoutContext : NSObject
- (id)layoutState;
@end
@interface SBFluidSwitcherViewController : UIViewController
- (BOOL)_isLayoutStateSwitcher:(id)arg1 allowTransitions:(BOOL)arg2;
- (LayoutContext *)layoutContext;
@end
@interface SBAppStatusBarSettingsAssertion : NSObject
- (void)invalidate;
- (void)acquire;
-(id)initWithStatusBarHidden:(BOOL)hidden atLevel:(NSUInteger)level reason:(NSString *)reason;
@property (nonatomic,readonly) NSUInteger level;
@property (nonatomic,copy,readonly) NSString * reason;
@end
SBAppStatusBarSettingsAssertion *assertion;
%hook SBFluidSwitcherViewController
- (void)_updateSpringBoardStatusBarAssertionAnimated:(BOOL)animated {
%orig;
if ([self _isLayoutStateSwitcher:[[self layoutContext] layoutState] allowTransitions:YES]) {
if (!assertion) {
assertion = [[NSClassFromString(@"SBAppStatusBarSettingsAssertion") alloc] initWithStatusBarHidden:NO atLevel:5 reason:@"Status Switcher"];
[assertion acquire];
}
} else {
if (assertion) {
[assertion invalidate];
assertion = nil;
}
}
return;
}
%end
%end
%group iOS10
%hook SBSwitcherMetahostingHomePageContentView
-(void)_createFakeStatusBar {
}
%end
%end
%ctor {
if (kCFCoreFoundationVersionNumber > 1400) {
%init(iOS11);
} else {
%init(iOS10);
}
}