/
Tweak.xm
46 lines (30 loc) · 1.1 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
#import <UIKit/UIKit.h>
#import <SpringBoard/SpringBoard.h>
static BOOL checkForcedApp(NSString* currentBundleId)
{
BOOL found = NO;
NSDictionary *appDict = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.decaro.forcestatusbar_apps.plist"];
for(NSString* key in appDict) {
BOOL value = [[appDict objectForKey:key] boolValue];
if(value) {
NSString *search = @"FSB-";
NSString *forcedBundleId = [key substringFromIndex:NSMaxRange([key rangeOfString:search])];
if ([forcedBundleId isEqualToString:currentBundleId]) {
found = YES;
break;
}
}
}
return found;
}
%hook UIApplication
-(void)_reportAppLaunchFinished {
%orig;
NSString *ident = [[NSBundle mainBundle] bundleIdentifier];
if (checkForcedApp(ident)) {
[self setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
UIWindow *win = [self.windows objectAtIndex:0];
[win.rootViewController.view setFrame:[win.screen applicationFrame]];
}
}
%end