From 2b22bc0eeaa32e69a9ce00bbb2b8887eaaeedbea Mon Sep 17 00:00:00 2001 From: mac-user669 Date: Tue, 18 Feb 2020 14:57:42 -0500 Subject: [PATCH] 1.7 --- Tweak.xm | 34 +++++++++++++++++-- control | 6 ++-- zenithdarkprefs/Makefile | 2 +- zenithdarkprefs/Resources/Root.plist | 12 +++---- .../ZNDarkPrefsRootListController.m | 6 ++-- 5 files changed, 44 insertions(+), 16 deletions(-) diff --git a/Tweak.xm b/Tweak.xm index 43c43d0..847e747 100644 --- a/Tweak.xm +++ b/Tweak.xm @@ -17,7 +17,7 @@ inline NSString *StringForPreferenceKey(NSString *key) { return prefs[key]; } -%group TweakGroup +%group Tweak13 %hook ZNGrabberAccessoryView // this is called when iOS 13's dark mode is enabled! @@ -66,6 +66,29 @@ inline NSString *StringForPreferenceKey(NSString *key) { %end %end +static BOOL ios13; + +%group Tweak12 + +//We then hook the class in this case Zenith's grabber view is called “ZNGrabberAccessoryView” +%hook ZNGrabberAccessoryView +// The method we then modify is this method that is called from UIImageView to set the backgroundColor of the image view. +// Since the grabber view is of type UIImageView we can modify this method :) + +-(void)setBackgroundColor:(UIColor *)backgroundColor { + if (kCustomDarkColorEnabled) { + %orig([UIColor cscp_colorFromHexString:StringForPreferenceKey(@"kDarkCustomColor")]); + } + + else { + %orig(kDarkModeColor); + } +} + +// We need to make sure we tell theos that we are finished hooking this class not doing so with cause the end of the world :P +%end +%end + static void loadPrefs() { // Load preferences to make sure changes are written to the plist // Thanks to skittyblock! @@ -100,7 +123,14 @@ static void PreferencesChangedCallback(CFNotificationCenterRef center, void *obs loadPrefs(); // Load our prefs if (kEnabled) { // If enabled - %init(TweakGroup); // Enable the group "TweakGroup" + if (@available(iOS 13, *)) { // If the device is running iOS 13 + ios13 = YES; // Set "iOS13" to "YES" + %init(Tweak13); // Enable the group "Tweak13" + } else { + ios13 = NO; // Set "iOS13" to "NO" + %init(Tweak12); // Enable the group "Tweak12" + } + } CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback) PreferencesChangedCallback, CFSTR("com.mac-user669.zenithdark.prefschanged"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately); diff --git a/control b/control index b4f6687..bd3d8cd 100644 --- a/control +++ b/control @@ -1,10 +1,10 @@ Package: com.mac-user669.zenithdark -Version: 1.6 +Version: 1.7 Architecture: iphoneos-arm Maintainer: mac-user669 -Depends: mobilesubstrate, preferenceloader, com.muirey03.zenith, ws.hbang.common (>= 1.11), firmware (>=13.0), org.thebigboss.libcolorpicker +Depends: mobilesubstrate, preferenceloader, com.muirey03.zenith, ws.hbang.common (>= 1.14), com.creaturesurvive.libcscolorpicker Section: Tweaks -Description: Changes Zeniths tabs to a dark blur +Description: Changes Zenith's tab color! Author: mac-user669 Name: ZenithDark Sileodepiction: https://mac-user669.github.io/repo/sileodepictions/ZenithDark.json diff --git a/zenithdarkprefs/Makefile b/zenithdarkprefs/Makefile index 3204ba7..57f0ce6 100644 --- a/zenithdarkprefs/Makefile +++ b/zenithdarkprefs/Makefile @@ -1,7 +1,7 @@ ARCHS = arm64 arm64e SDK = iPhoneOS12.2 FINALPACKAGE = 1 -TARGET = iphone:12.2:13.0 +TARGET = iphone:12.2:12.0 include $(THEOS)/makefiles/common.mk diff --git a/zenithdarkprefs/Resources/Root.plist b/zenithdarkprefs/Resources/Root.plist index 7b497a7..1d92075 100644 --- a/zenithdarkprefs/Resources/Root.plist +++ b/zenithdarkprefs/Resources/Root.plist @@ -12,9 +12,9 @@ packageIdentifier com.mac-user669.zenithdark titleColor - #D0A400 + #f5bc00 subtitleColor - #D0A400 + #f5bc00 @@ -92,9 +92,8 @@ label footerText - + Note: This won't affect anything on iOS 12 - cell PSSwitchCell @@ -109,16 +108,15 @@ PostNotification com.mac-user669.zenithdark.prefschanged - PostNotification - com.mac-user669.zenithdark.prefschanged + com.mac-user669.zenithdark.prefschanged cell PSLinkCell cellClass CSColorDisplayCell defaults - com.mac-user669.zenithdark + com.mac-user669.zenithdark defaultsPath /Library/PreferenceBundles/ZenithDark.bundle key diff --git a/zenithdarkprefs/ZNDarkPrefsRootListController.m b/zenithdarkprefs/ZNDarkPrefsRootListController.m index aeef4c6..93d3a4a 100644 --- a/zenithdarkprefs/ZNDarkPrefsRootListController.m +++ b/zenithdarkprefs/ZNDarkPrefsRootListController.m @@ -2,10 +2,10 @@ #include #define THEME_COLOR \ - [UIColor colorWithRed:0.82 \ - green:0.64 \ + [UIColor colorWithRed:0.96 \ + green:0.74 \ blue:0.00 \ - alpha:1.0]; + alpha:1.00]; @implementation ZNDarkPrefsRootListController