Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import <UIKit/UIKit.h>
- #import "libcolorpicker.h"
- #define PLIST_PATH @"/var/mobile/Library/Preferences/com.rustybalboa.colormycc.plist"
- #define PLIST_PATH_COLORS @"/var/mobile/Library/Preferences/com.rustybalboa.colormycccolors.plist"
- #define prefsDict [NSDictionary dictionaryWithContentsOfFile:PLIST_PATH]
- #define prefsColorsDict [NSDictionary dictionaryWithContentsOfFile:PLIST_PATH_COLORS]
- static NSString *ModuleColor = @"ModuleColor";
- static NSString *BluetoothColor = @"BluetoothColor";
- static NSString *AirplaneColor = @"AirplaneColor";
- static NSString *CellularColor = @"CellularColor";
- static NSString *WifiColor = @"WifiColor";
- static NSString *AirdropColor = @"AirdropColor";
- static NSString *HotspotColor = @"HotspotColor";
- @interface CCUIRoundButton : UIView
- -(id)_viewControllerForAncestor;
- @end
- @interface CCUIScrollView : UIView
- @end
- @interface MTSystemModuleMaterialSettings : NSObject {
- }
- -(UIColor *)baseOverlayColor;
- @end
- %hook CCUIScrollView
- -(void)didMoveToWindow
- {
- if ([[prefsDict valueForKey:@"bIsEnabled"] boolValue])
- {
- %orig;
- UIColor *color = LCPParseColorString([prefsColorsDict objectForKey:@"backgroundColor"], @"#FF0000");
- self.backgroundColor = color;
- }
- }
- %end
- %hook MTSystemModuleMaterialSettings
- -(UIColor *)baseOverlayColor
- {
- if ([[prefsDict valueForKey:@"mIsEnabled"] boolValue])
- {
- return LCPParseColorString([prefsColorsDict objectForKey:ModuleColor], @"#FF00FF");
- }
- return %orig;
- }
- %end
- %hook CCUIRoundButton
- -(void)layoutSubviews
- {
- %orig;
- for (UIView* subview in self.subviews)
- {
- if (![subview isMemberOfClass:[UIImageView class]] && ![subview isMemberOfClass:[objc_getClass("MTMaterialView") class]] && ![subview isMemberOfClass:[objc_getClass("CCUICAPackageView") class]])
- {
- if ([[prefsDict valueForKey:@"rIsEnabled"] boolValue])
- {
- //this is the code for the bluetooth button (replace CCUIConnectivityBluetoothViewController with CCUIConnectivityAirplaneViewController for airplane mode etc.)
- if ([[self _viewControllerForAncestor] isMemberOfClass:[objc_getClass("CCUIConnectivityBluetoothViewController") class]])
- {
- [subview setBackgroundColor:LCPParseColorString([prefsColorsDict objectForKey:BluetoothColor], @"#FF0000")];
- }
- else if ([[self _viewControllerForAncestor] isMemberOfClass:[objc_getClass("CCUIConnectivityAirplaneViewController") class]])
- {
- [subview setBackgroundColor:LCPParseColorString([prefsColorsDict objectForKey:AirplaneColor], @"#FF0000")];
- }
- else if ([[self _viewControllerForAncestor] isMemberOfClass:[objc_getClass("CCUIConnectivityCellularDataViewController") class]])
- {
- [subview setBackgroundColor:LCPParseColorString([prefsColorsDict objectForKey:CellularColor], @"#FF0000")];
- }
- else if ([[self _viewControllerForAncestor] isMemberOfClass:[objc_getClass("CCUIConnectivityWifiViewController") class]])
- {
- [subview setBackgroundColor:LCPParseColorString([prefsColorsDict objectForKey:WifiColor], @"#FF0000")];
- }
- else if ([[self _viewControllerForAncestor] isMemberOfClass:[objc_getClass("CCUIConnectivityAirDropViewController") class]])
- {
- [subview setBackgroundColor:LCPParseColorString([prefsColorsDict objectForKey:AirdropColor], @"#FF0000")];
- }
- else if ([[self _viewControllerForAncestor] isMemberOfClass: [objc_getClass("CCUIConnectivityHotspotViewController") class]])
- {
- [subview setBackgroundColor:LCPParseColorString([prefsColorsDict objectForKey:HotspotColor], @"#FF0000")];
- }
- break;
- }
- }
- }
- for (UIImageView* subview in self.subviews)
- {
- if ([[prefsDict valueForKey:@"gIsEnabled"] boolValue])
- {
- //this is the code for the bluetooth button (replace CCUIConnectivityBluetoothViewController with CCUIConnectivityAirplaneViewController for airplane mode etc.)
- if ([[self _viewControllerForAncestor] isMemberOfClass:[objc_getClass("CCUIConnectivityBluetoothViewController") class]])
- {
- [subview setTintColor:LCPParseColorString([prefsColorsDict objectForKey:@"BluetoothGlyphColor"], @"#FF0000")];
- }
- else if ([[self _viewControllerForAncestor] isMemberOfClass:[objc_getClass("CCUIConnectivityAirplaneViewController") class]])
- {
- [subview setTintColor:LCPParseColorString([prefsColorsDict objectForKey:@"AirplaneGlyphColor"], @"#FF0000")];
- }
- else if ([[self _viewControllerForAncestor] isMemberOfClass:[objc_getClass("CCUIConnectivityCellularDataViewController") class]])
- {
- [subview setTintColor:LCPParseColorString([prefsColorsDict objectForKey:@"CellularGlyphColor"], @"#FF0000")];
- }
- else if ([[self _viewControllerForAncestor] isMemberOfClass:[objc_getClass("CCUIConnectivityWifiViewController") class]])
- {
- [subview setTintColor:LCPParseColorString([prefsColorsDict objectForKey:@"WifiGlyphColor"], @"#FF0000")];
- }
- else if ([[self _viewControllerForAncestor] isMemberOfClass:[objc_getClass("CCUIConnectivityAirDropViewController") class]])
- {
- [subview setTintColor:LCPParseColorString([prefsColorsDict objectForKey:@"AirdropGlyphColor"], @"#FF0000")];
- }
- else if ([[self _viewControllerForAncestor] isMemberOfClass: [objc_getClass("CCUIConnectivityHotspotViewController") class]])
- {
- [subview setTintColor:LCPParseColorString([prefsColorsDict objectForKey:@"HotspotGlyphColor"], @"#FF0000")];
- }
- }
- }
- }
- %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement