This repository has been archived by the owner on May 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTweak.xm
87 lines (61 loc) · 1.63 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//Created by iKilledAppl3
//Colorize your Control Center modules with ease!
//Created on Thursday, March 28, 2018
#import "ColorMyCCModules_header.h"
//iOS 10
%hook NCMaterialView
-(void)_configureWhiteOverlayViewIfNecessary {
if (kIsEnabled && [self.class isKindOfClass:[%c(CCUIControlCenterPagePlatterView) class]]) {
UIView *_whiteOverlayView = [self valueForKey:@"_whiteOverlayView"];
_whiteOverlayView.hidden = YES;
_whiteOverlayView.backgroundColor = nil;
[_whiteOverlayView removeFromSuperview];
}
else {
%orig;
}
}
%end
%hook CCUIControlCenterPagePlatterView
-(void)layoutSubviews {
if (kIsEnabled) {
%orig;
UIImageView *imgView = [self valueForKey:@"_whiteLayerView"];
imgView.alpha = 0.5;
imgView.backgroundColor = LCPParseColorString(kChosenColor, @"000000");
}
else {
%orig;
}
}
%end
//Haystack
%hook HSKCardBackdropView
-(void)setBackdropView:(id)arg1 {
if (kIsEnabled) {
%orig(arg1);
self.backgroundColor = LCPParseColorString(kChosenColor, @"000000");
}
else {
%orig;
}
}
%end
%hook MTSystemModuleMaterialSettings
-(UIColor *)baseOverlayColor {
if (kIsEnabled ) {
return LCPParseColorString(kChosenColor, @"000000");
}
else {
return %orig;
}
}
%end
extern NSString *const HBPreferencesDidChangeNotification;
//Prefs new
%ctor {
dlopen ("/usr/lib/TweakInject/Haystack.dylib", RTLD_NOW);
preferences = [[HBPreferences alloc] initWithIdentifier:@"com.ikilledappl3.colormyccmodules"];
[preferences registerBool:&kIsEnabled default:NO forKey:@"kIsEnabled"];
[preferences registerObject:&kChosenColor default:nil forKey:@"kChosenColor"];
}