-
Notifications
You must be signed in to change notification settings - Fork 8
/
Customizations.xm
104 lines (91 loc) · 3.05 KB
/
Customizations.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#include "Neon.h"
// Disable dark overlay
%group NoOverlay
%hook SBIconView
- (void)setHighlighted:(BOOL)isHighlighted { %orig(NO); }
%end
%end
// Hide icon labels
@interface SBIconView
@property (nonatomic, assign, getter = isLabelHidden) BOOL labelHidden;
@property (nonatomic, copy) NSString *location;
- (BOOL)shouldHideLabel;
@end
%group HideLabels
%hook SBIconView
- (void)setLabelHidden:(BOOL)labelHidden { %orig(YES); }
- (BOOL)isLabelHidden { return YES; }
- (instancetype)initWithContentType:(unsigned long long)type {
self = %orig;
self.labelHidden = YES;
return self;
}
%end
%end
// Hide dock background
%group NoDockBg
%hook SBDockView
- (instancetype)initWithDockListView:(id)dockListView forSnapshot:(BOOL)forSnapshot {
self = %orig;
MSHookIvar<UIView *>(self, "_backgroundView").hidden = YES;
return self;
}
- (void)setBackgroundView:(UIView *)backgroundView {}
- (void)setBackgroundAlpha:(double)setBackgroundAlpha { %orig(0); }
%end
%hook SBFloatingDockPlatterView
- (UIView *)backgroundView { return nil; }
%end
%end
// Hide page dots
%group NoPageDots
%hook SBIconListPageControl
- (void)setHidden:(BOOL)isHidden { %orig(YES); }
%end
%end
// Hide folder icon background
@interface SBFolderIconBackgroundView : UIView
@end
%group NoFolderIconBg
%hook SBFolderIconBackgroundView
- (instancetype)initWithDefaultSize {
self = %orig;
self.hidden = YES;
return self;
}
%end
%end
%group NoFolderIconBgiOS13
%hook SBFolderIconImageView
- (void)setBackgroundView:(UIView *)backgroundView {}
%end
%end
%group MaskWidgets
%hook WGWidgetInfo
- (UIImage *)_queue_iconWithFormat:(int)format forWidgetWithIdentifier:(NSString *)widgetIdentifier extension:(id)extension { return [%orig maskedImageWithBlackBackground:NO homescreenIcon:NO]; }
- (UIImage *)_queue_iconWithSize:(CGSize)size scale:(CGFloat)scale forWidgetWithIdentifier:(NSString *)widgetIdentifier extension:(id)extension { return [%orig maskedImageWithBlackBackground:NO homescreenIcon:NO]; }
- (UIImage *)_iconWithFormat:(int)format { return [%orig maskedImageWithBlackBackground:NO homescreenIcon:NO]; }
%end
%end
%group ActivatorNoBlur
%hook SBActivatorIconImageView
- (void)setBackgroundView:(UIView *)view {}
%end
%end
%ctor {
if (![[NSProcessInfo processInfo].processName isEqualToString:@"SpringBoard"]) return;
if (!%c(Neon)) dlopen("/Library/MobileSubstrate/DynamicLibraries/NeonEngine.dylib", RTLD_LAZY);
if (!%c(Neon)) return;
NSDictionary *prefs = [%c(Neon) prefs];
if (!prefs) return;
if ([[prefs valueForKey:@"kNoOverlay"] boolValue]) %init(NoOverlay);
if ([[prefs valueForKey:@"kHideLabels"] boolValue]) %init(HideLabels);
if ([[prefs valueForKey:@"kNoDockBg"] boolValue]) %init(NoDockBg);
if ([[prefs valueForKey:@"kNoPageDots"] boolValue]) %init(NoPageDots);
if ([[prefs valueForKey:@"kNoFolderIconBg"] boolValue]) {
if (kCFCoreFoundationVersionNumber < 1665.15) %init(NoFolderIconBg);
else %init(NoFolderIconBgiOS13);
}
if ([[prefs valueForKey:@"kMaskWidgets"] boolValue]) %init(MaskWidgets);
if ([[prefs valueForKey:@"kActivatorFix"] boolValue]) %init(ActivatorNoBlur);
}