-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathTweak.xm
52 lines (40 loc) · 1.16 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
#import "SwitcherLoader.h"
#import <SpringBoard5.0/SBAppSwitcherBarView.h>
#include <dlfcn.h>
SwitcherLoader *switcherLoader;
%hook SBAppSwitcherBarView
- (void)addAuxiliaryViews:(NSArray *)arg1 {
[switcherLoader loadItems];
if([[switcherLoader defaultViews]count] < 1)
[[switcherLoader defaultViews]addObjectsFromArray:arg1];
NSMutableArray *plugins = [NSMutableArray array];
NSMutableArray *indexed = [switcherLoader enabledPluginsIndexed];
for(unsigned int i =0; i <[indexed count]; i++) {
NSString *pid = [indexed objectAtIndex:i];
if([switcherLoader viewForId:pid])
[plugins addObject:[switcherLoader viewForId:pid]];
}
[switcherLoader setStatus:Normal];
%orig(plugins);
}
- (void)viewWillAppear {
if(switcherLoader.currentStatus == Update)
[self addAuxiliaryViews:nil];
%orig;
}
%end
%hook SBNowPlayingBarView
%new
-(NSString *)plugin_id {
return @"springboard.sbnowplayingbarview";
}
%end
%hook SBAirPlayBarView
%new
-(NSString *)plugin_id {
return @"springboard.sbairplaybarview";
}
%end
%ctor {
switcherLoader = [[SwitcherLoader alloc]init];
}