diff --git a/.theos/_/DEBIAN/control b/.theos/_/DEBIAN/control index b78a4d3..2ebd7d4 100644 --- a/.theos/_/DEBIAN/control +++ b/.theos/_/DEBIAN/control @@ -8,5 +8,5 @@ Author: mac-user669 Name: ZenithDark Sileodepiction: https://raw.githubusercontent.com/mac-user669/repo/master/sileodepictions/ZenithDark.json Depiction: https://mac-user669.github.io/repo/depictions/?p=com.mac-user669.zenithdark/ -Version: 1.0 +Version: 1.0-1+debug Installed-Size: 344 diff --git a/.theos/_/Library/MobileSubstrate/DynamicLibraries/ZenithDark.dylib b/.theos/_/Library/MobileSubstrate/DynamicLibraries/ZenithDark.dylib index 2495a2b..62dbcf0 100755 Binary files a/.theos/_/Library/MobileSubstrate/DynamicLibraries/ZenithDark.dylib and b/.theos/_/Library/MobileSubstrate/DynamicLibraries/ZenithDark.dylib differ diff --git a/.theos/_/Library/MobileSubstrate/DynamicLibraries/ZenithDark.plist b/.theos/_/Library/MobileSubstrate/DynamicLibraries/ZenithDark.plist index 4aadfb4..10dc654 100644 Binary files a/.theos/_/Library/MobileSubstrate/DynamicLibraries/ZenithDark.plist and b/.theos/_/Library/MobileSubstrate/DynamicLibraries/ZenithDark.plist differ diff --git a/.theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/Info.plist b/.theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/Info.plist index 7408492..86d931a 100644 Binary files a/.theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/Info.plist and b/.theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/Info.plist differ diff --git a/.theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/Root.plist b/.theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/Root.plist index 7eafae2..727bd0f 100644 Binary files a/.theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/Root.plist and b/.theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/Root.plist differ diff --git a/.theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/ZenithDarkPrefs b/.theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/ZenithDarkPrefs index 3bf235f..56212ea 100755 Binary files a/.theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/ZenithDarkPrefs and b/.theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/ZenithDarkPrefs differ diff --git a/.theos/_/Library/PreferenceLoader/Preferences/ZenithDarkPrefs.plist b/.theos/_/Library/PreferenceLoader/Preferences/ZenithDarkPrefs.plist index 8e5955f..9b0cc13 100644 Binary files a/.theos/_/Library/PreferenceLoader/Preferences/ZenithDarkPrefs.plist and b/.theos/_/Library/PreferenceLoader/Preferences/ZenithDarkPrefs.plist differ diff --git a/.theos/last_package b/.theos/last_package index 41b9a78..eae5d33 100644 --- a/.theos/last_package +++ b/.theos/last_package @@ -1 +1 @@ -./packages/com.mac-user669.zenithdark_1.0_iphoneos-arm.deb +./packages/com.mac-user669.zenithdark_1.0-1+debug_iphoneos-arm.deb diff --git a/.theos/obj/ZenithDark.dylib b/.theos/obj/ZenithDark.dylib index 2495a2b..afe045a 100755 Binary files a/.theos/obj/ZenithDark.dylib and b/.theos/obj/ZenithDark.dylib differ diff --git a/.theos/obj/arm64/Tweak.xm.c4e2add9.o b/.theos/obj/arm64/Tweak.xm.c4e2add9.o index d80c567..2b07b87 100644 Binary files a/.theos/obj/arm64/Tweak.xm.c4e2add9.o and b/.theos/obj/arm64/Tweak.xm.c4e2add9.o differ diff --git a/.theos/obj/arm64/Tweak.xm.mm b/.theos/obj/arm64/Tweak.xm.mm index 2562b5f..4478f39 100644 --- a/.theos/obj/arm64/Tweak.xm.mm +++ b/.theos/obj/arm64/Tweak.xm.mm @@ -12,20 +12,6 @@ #import "ZenithDark.h" -static BOOL enabled; -static void loadPrefs() { - static NSMutableDictionary *settings; - - CFArrayRef keyList = CFPreferencesCopyKeyList(CFSTR("com.mac-user669.zenithdarkprefs"), kCFPreferencesCurrentUser, kCFPreferencesAnyHost); - if (keyList) { - settings = (NSMutableDictionary *)CFBridgingRelease(CFPreferencesCopyMultiple(keyList, CFSTR("com.mac-user669.zenithdarkprefs"), kCFPreferencesCurrentUser, kCFPreferencesAnyHost)); - CFRelease(keyList); - } else { - settings = [NSMutableDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.mac-user669.zenithdarkprefs.plist"]; - } - - enabled = [([settings objectForKey:@"enabled"] ? [settings objectForKey:@"enabled"] : @(YES)) boolValue]; -} @@ -52,11 +38,10 @@ static void loadPrefs() { @class ZNGrabberAccessoryView; static void (*_logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$)(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UITraitCollection *); static void _logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UITraitCollection *); static void (*_logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$)(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UIColor *); static void _logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UIColor *); -#line 30 "Tweak.xm" +#line 16 "Tweak.xm" static void _logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd, UITraitCollection * previousTraitCollection) { - if (enabled) { _logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(self, _cmd, previousTraitCollection); if (@available(iOS 13, *)) { if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) { @@ -67,14 +52,11 @@ static void _logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidCh [self setBackgroundColor:kLightModeColor]; } } - } - _logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(self, _cmd, previousTraitCollection); } static void _logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd, UIColor * backgroundColor) { - if (enabled) { if (@available(iOS 13, *)) { if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) { @@ -85,8 +67,6 @@ static void _logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$( _logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(self, _cmd, backgroundColor); } } - } - _logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(self, _cmd, backgroundColor); } @@ -95,9 +75,8 @@ static void _logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$( -static __attribute__((constructor)) void _logosLocalCtor_7f270ec4(int __unused argc, char __unused **argv, char __unused **envp) { +static __attribute__((constructor)) void _logosLocalCtor_da6b7450(int __unused argc, char __unused **argv, char __unused **envp) { -loadPrefs(); dlopen ("/Library/MobileSubstrate/DynamicLibraries/Zenith.dylib", RTLD_NOW); @@ -105,4 +84,4 @@ dlopen ("/Library/MobileSubstrate/DynamicLibraries/Zenith.dylib", RTLD_NOW); } static __attribute__((constructor)) void _logosLocalInit() { {Class _logos_class$_ungrouped$ZNGrabberAccessoryView = objc_getClass("ZNGrabberAccessoryView"); MSHookMessageEx(_logos_class$_ungrouped$ZNGrabberAccessoryView, @selector(traitCollectionDidChange:), (IMP)&_logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$, (IMP*)&_logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$);MSHookMessageEx(_logos_class$_ungrouped$ZNGrabberAccessoryView, @selector(setBackgroundColor:), (IMP)&_logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$, (IMP*)&_logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$);} } -#line 80 "Tweak.xm" +#line 59 "Tweak.xm" diff --git a/.theos/obj/arm64/ZenithDark.dylib b/.theos/obj/arm64/ZenithDark.dylib index be03d3c..14121c0 100755 Binary files a/.theos/obj/arm64/ZenithDark.dylib and b/.theos/obj/arm64/ZenithDark.dylib differ diff --git a/.theos/obj/arm64/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib b/.theos/obj/arm64/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib index b227cd9..de04d57 100644 Binary files a/.theos/obj/arm64/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib and b/.theos/obj/arm64/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib differ diff --git a/.theos/obj/arm64e/Tweak.xm.6fecb14d.o b/.theos/obj/arm64e/Tweak.xm.6fecb14d.o index 520acd2..f5a6d69 100644 Binary files a/.theos/obj/arm64e/Tweak.xm.6fecb14d.o and b/.theos/obj/arm64e/Tweak.xm.6fecb14d.o differ diff --git a/.theos/obj/arm64e/Tweak.xm.mm b/.theos/obj/arm64e/Tweak.xm.mm index 2562b5f..4478f39 100644 --- a/.theos/obj/arm64e/Tweak.xm.mm +++ b/.theos/obj/arm64e/Tweak.xm.mm @@ -12,20 +12,6 @@ #import "ZenithDark.h" -static BOOL enabled; -static void loadPrefs() { - static NSMutableDictionary *settings; - - CFArrayRef keyList = CFPreferencesCopyKeyList(CFSTR("com.mac-user669.zenithdarkprefs"), kCFPreferencesCurrentUser, kCFPreferencesAnyHost); - if (keyList) { - settings = (NSMutableDictionary *)CFBridgingRelease(CFPreferencesCopyMultiple(keyList, CFSTR("com.mac-user669.zenithdarkprefs"), kCFPreferencesCurrentUser, kCFPreferencesAnyHost)); - CFRelease(keyList); - } else { - settings = [NSMutableDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.mac-user669.zenithdarkprefs.plist"]; - } - - enabled = [([settings objectForKey:@"enabled"] ? [settings objectForKey:@"enabled"] : @(YES)) boolValue]; -} @@ -52,11 +38,10 @@ static void loadPrefs() { @class ZNGrabberAccessoryView; static void (*_logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$)(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UITraitCollection *); static void _logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UITraitCollection *); static void (*_logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$)(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UIColor *); static void _logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UIColor *); -#line 30 "Tweak.xm" +#line 16 "Tweak.xm" static void _logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd, UITraitCollection * previousTraitCollection) { - if (enabled) { _logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(self, _cmd, previousTraitCollection); if (@available(iOS 13, *)) { if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) { @@ -67,14 +52,11 @@ static void _logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidCh [self setBackgroundColor:kLightModeColor]; } } - } - _logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(self, _cmd, previousTraitCollection); } static void _logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd, UIColor * backgroundColor) { - if (enabled) { if (@available(iOS 13, *)) { if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) { @@ -85,8 +67,6 @@ static void _logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$( _logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(self, _cmd, backgroundColor); } } - } - _logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(self, _cmd, backgroundColor); } @@ -95,9 +75,8 @@ static void _logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$( -static __attribute__((constructor)) void _logosLocalCtor_7f270ec4(int __unused argc, char __unused **argv, char __unused **envp) { +static __attribute__((constructor)) void _logosLocalCtor_da6b7450(int __unused argc, char __unused **argv, char __unused **envp) { -loadPrefs(); dlopen ("/Library/MobileSubstrate/DynamicLibraries/Zenith.dylib", RTLD_NOW); @@ -105,4 +84,4 @@ dlopen ("/Library/MobileSubstrate/DynamicLibraries/Zenith.dylib", RTLD_NOW); } static __attribute__((constructor)) void _logosLocalInit() { {Class _logos_class$_ungrouped$ZNGrabberAccessoryView = objc_getClass("ZNGrabberAccessoryView"); MSHookMessageEx(_logos_class$_ungrouped$ZNGrabberAccessoryView, @selector(traitCollectionDidChange:), (IMP)&_logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$, (IMP*)&_logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$);MSHookMessageEx(_logos_class$_ungrouped$ZNGrabberAccessoryView, @selector(setBackgroundColor:), (IMP)&_logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$, (IMP*)&_logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$);} } -#line 80 "Tweak.xm" +#line 59 "Tweak.xm" diff --git a/.theos/obj/arm64e/ZenithDark.dylib b/.theos/obj/arm64e/ZenithDark.dylib index a494c2b..f7f24a5 100755 Binary files a/.theos/obj/arm64e/ZenithDark.dylib and b/.theos/obj/arm64e/ZenithDark.dylib differ diff --git a/.theos/obj/arm64e/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib b/.theos/obj/arm64e/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib index d6093f7..f77a598 100644 Binary files a/.theos/obj/arm64e/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib and b/.theos/obj/arm64e/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib differ diff --git a/.theos/obj/debug/.stamp b/.theos/obj/debug/.stamp new file mode 100644 index 0000000..e69de29 diff --git a/.theos/obj/debug/ZenithDark.dylib b/.theos/obj/debug/ZenithDark.dylib new file mode 100755 index 0000000..62dbcf0 Binary files /dev/null and b/.theos/obj/debug/ZenithDark.dylib differ diff --git a/zenithdarkprefs/Resources/Info.plist b/.theos/obj/debug/ZenithDarkPrefs.bundle/Info.plist similarity index 100% rename from zenithdarkprefs/Resources/Info.plist rename to .theos/obj/debug/ZenithDarkPrefs.bundle/Info.plist diff --git a/zenithdarkprefs/Resources/Root.plist b/.theos/obj/debug/ZenithDarkPrefs.bundle/Root.plist similarity index 100% rename from zenithdarkprefs/Resources/Root.plist rename to .theos/obj/debug/ZenithDarkPrefs.bundle/Root.plist diff --git a/.theos/obj/debug/ZenithDarkPrefs.bundle/ZenithDarkPrefs b/.theos/obj/debug/ZenithDarkPrefs.bundle/ZenithDarkPrefs new file mode 100755 index 0000000..56212ea Binary files /dev/null and b/.theos/obj/debug/ZenithDarkPrefs.bundle/ZenithDarkPrefs differ diff --git a/.theos/obj/debug/arm64/Tweak.xm.30dd847b.Td b/.theos/obj/debug/arm64/Tweak.xm.30dd847b.Td new file mode 100644 index 0000000..7f3caac --- /dev/null +++ b/.theos/obj/debug/arm64/Tweak.xm.30dd847b.Td @@ -0,0 +1,20 @@ +/Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/debug/arm64/Tweak.xm.30dd847b.o: \ + /Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/debug/arm64/Tweak.xm.mm \ + /Users/cooperhull/theos/Prefix.pch \ + /Users/cooperhull/theos/include/_Prefix/BackwardsCompat.h \ + /Users/cooperhull/theos/include/_Prefix/IOSMacros.h \ + /Users/cooperhull/theos/include/HBLog.h \ + /Users/cooperhull/Desktop/Tweaks/ZenithDark/ZenithDark.h \ + /Users/cooperhull/theos/include/substrate.h + +/Users/cooperhull/theos/Prefix.pch: + +/Users/cooperhull/theos/include/_Prefix/BackwardsCompat.h: + +/Users/cooperhull/theos/include/_Prefix/IOSMacros.h: + +/Users/cooperhull/theos/include/HBLog.h: + +/Users/cooperhull/Desktop/Tweaks/ZenithDark/ZenithDark.h: + +/Users/cooperhull/theos/include/substrate.h: diff --git a/.theos/obj/debug/arm64/Tweak.xm.mm b/.theos/obj/debug/arm64/Tweak.xm.mm new file mode 100644 index 0000000..07b65ab --- /dev/null +++ b/.theos/obj/debug/arm64/Tweak.xm.mm @@ -0,0 +1,116 @@ +#line 1 "Tweak.xm" + + + + + + + + + + + +#import "ZenithDark.h" + +static BOOL enabled; + + +static void refreshPrefs() { + CFArrayRef keyList = CFPreferencesCopyKeyList(CFSTR("com.mac-user669.zenithdarkprefs"), kCFPreferencesCurrentUser, kCFPreferencesAnyHost); + if (keyList) { + settings = (NSMutableDictionary *)CFBridgingRelease(CFPreferencesCopyMultiple(keyList, CFSTR("com.mac-user669.zenithdarkprefs"), kCFPreferencesCurrentUser, kCFPreferencesAnyHost)); + CFRelease(keyList); + } else { + settings = nil; + } + if (!settings) { + settings = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.mac-user669.zenithdarkprefs.plist"]; + } + + enabled = [([settings objectForKey:@"enabled"] ?: @(YES)) boolValue]; +} + + + + +#include +#if defined(__clang__) +#if __has_feature(objc_arc) +#define _LOGOS_SELF_TYPE_NORMAL __unsafe_unretained +#define _LOGOS_SELF_TYPE_INIT __attribute__((ns_consumed)) +#define _LOGOS_SELF_CONST const +#define _LOGOS_RETURN_RETAINED __attribute__((ns_returns_retained)) +#else +#define _LOGOS_SELF_TYPE_NORMAL +#define _LOGOS_SELF_TYPE_INIT +#define _LOGOS_SELF_CONST +#define _LOGOS_RETURN_RETAINED +#endif +#else +#define _LOGOS_SELF_TYPE_NORMAL +#define _LOGOS_SELF_TYPE_INIT +#define _LOGOS_SELF_CONST +#define _LOGOS_RETURN_RETAINED +#endif + +@class ZNGrabberAccessoryView; +static void (*_logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$)(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UITraitCollection *); static void _logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UITraitCollection *); static void (*_logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$)(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UIColor *); static void _logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UIColor *); + +#line 34 "Tweak.xm" + + +static void _logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd, UITraitCollection * previousTraitCollection) { + if(enabled){ + _logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(self, _cmd, previousTraitCollection); + if (@available(iOS 13, *)) { + if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) { + [self setBackgroundColor:kDarkModeColor]; + } + + else { + [self setBackgroundColor:kLightModeColor]; + } + } + } + else { + _logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(self, _cmd, previousTraitCollection); + } + +} + + + +static void _logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd, UIColor * backgroundColor) { + if(enabled){ + + + if (@available(iOS 13, *)) { + if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) { + _logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(self, _cmd, kDarkModeColor); + } + + else { + _logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(self, _cmd, backgroundColor); + } + } + } + else { + _logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(self, _cmd, backgroundColor); +} +} + + + + + + +static __attribute__((constructor)) void _logosLocalCtor_16c0be02(int __unused argc, char __unused **argv, char __unused **envp) { + + + +dlopen ("/Library/MobileSubstrate/DynamicLibraries/Zenith.dylib", RTLD_NOW); + +} +static __attribute__((constructor)) void _logosLocalInit() { +{Class _logos_class$_ungrouped$ZNGrabberAccessoryView = objc_getClass("ZNGrabberAccessoryView"); MSHookMessageEx(_logos_class$_ungrouped$ZNGrabberAccessoryView, @selector(traitCollectionDidChange:), (IMP)&_logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$, (IMP*)&_logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$);MSHookMessageEx(_logos_class$_ungrouped$ZNGrabberAccessoryView, @selector(setBackgroundColor:), (IMP)&_logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$, (IMP*)&_logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$);} } +#line 88 "Tweak.xm" diff --git a/.theos/obj/debug/arm64/ZenithDark.dylib b/.theos/obj/debug/arm64/ZenithDark.dylib new file mode 100755 index 0000000..8b94681 Binary files /dev/null and b/.theos/obj/debug/arm64/ZenithDark.dylib differ diff --git a/.theos/obj/debug/arm64/ZenithDark.dylib.dSYM/Contents/Info.plist b/.theos/obj/debug/arm64/ZenithDark.dylib.dSYM/Contents/Info.plist new file mode 100644 index 0000000..1670f3b --- /dev/null +++ b/.theos/obj/debug/arm64/ZenithDark.dylib.dSYM/Contents/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleIdentifier + com.apple.xcode.dsym.ZenithDark.dylib + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + dSYM + CFBundleSignature + ???? + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/.theos/obj/debug/arm64/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib b/.theos/obj/debug/arm64/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib new file mode 100644 index 0000000..03ba301 Binary files /dev/null and b/.theos/obj/debug/arm64/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib differ diff --git a/.theos/obj/debug/arm64/ZenithDarkPrefs.bundle/ZenithDarkPrefs b/.theos/obj/debug/arm64/ZenithDarkPrefs.bundle/ZenithDarkPrefs new file mode 100755 index 0000000..34c858c Binary files /dev/null and b/.theos/obj/debug/arm64/ZenithDarkPrefs.bundle/ZenithDarkPrefs differ diff --git a/.theos/obj/debug/arm64/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Info.plist b/.theos/obj/debug/arm64/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Info.plist new file mode 100644 index 0000000..8249226 --- /dev/null +++ b/.theos/obj/debug/arm64/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleIdentifier + com.apple.xcode.dsym.ZenithDarkPrefs + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + dSYM + CFBundleSignature + ???? + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/.theos/obj/debug/arm64/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Resources/DWARF/ZenithDarkPrefs b/.theos/obj/debug/arm64/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Resources/DWARF/ZenithDarkPrefs new file mode 100644 index 0000000..9249ce9 Binary files /dev/null and b/.theos/obj/debug/arm64/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Resources/DWARF/ZenithDarkPrefs differ diff --git a/.theos/obj/debug/arm64/ZnthDrkRootListController.m.0490b1f0.Td b/.theos/obj/debug/arm64/ZnthDrkRootListController.m.0490b1f0.Td new file mode 100644 index 0000000..1356f93 --- /dev/null +++ b/.theos/obj/debug/arm64/ZnthDrkRootListController.m.0490b1f0.Td @@ -0,0 +1,21 @@ +/Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/debug/arm64/ZnthDrkRootListController.m.0490b1f0.o: \ + ZnthDrkRootListController.m /Users/cooperhull/theos/Prefix.pch \ + /Users/cooperhull/theos/include/_Prefix/BackwardsCompat.h \ + /Users/cooperhull/theos/include/_Prefix/IOSMacros.h \ + /Users/cooperhull/theos/include/HBLog.h ZnthDrkRootListController.h \ + /Users/cooperhull/theos/include/Preferences/PSListController.h \ + /Users/cooperhull/theos/include/Preferences/PSViewController.h + +/Users/cooperhull/theos/Prefix.pch: + +/Users/cooperhull/theos/include/_Prefix/BackwardsCompat.h: + +/Users/cooperhull/theos/include/_Prefix/IOSMacros.h: + +/Users/cooperhull/theos/include/HBLog.h: + +ZnthDrkRootListController.h: + +/Users/cooperhull/theos/include/Preferences/PSListController.h: + +/Users/cooperhull/theos/include/Preferences/PSViewController.h: diff --git a/.theos/obj/debug/arm64/ZnthDrkRootListController.m.0490b1f0.o b/.theos/obj/debug/arm64/ZnthDrkRootListController.m.0490b1f0.o new file mode 100644 index 0000000..ed71586 Binary files /dev/null and b/.theos/obj/debug/arm64/ZnthDrkRootListController.m.0490b1f0.o differ diff --git a/.theos/obj/debug/arm64e/Tweak.xm.9a3df4bf.Td b/.theos/obj/debug/arm64e/Tweak.xm.9a3df4bf.Td new file mode 100644 index 0000000..695ee51 --- /dev/null +++ b/.theos/obj/debug/arm64e/Tweak.xm.9a3df4bf.Td @@ -0,0 +1,20 @@ +/Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/debug/arm64e/Tweak.xm.9a3df4bf.o: \ + /Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/debug/arm64e/Tweak.xm.mm \ + /Users/cooperhull/theos/Prefix.pch \ + /Users/cooperhull/theos/include/_Prefix/BackwardsCompat.h \ + /Users/cooperhull/theos/include/_Prefix/IOSMacros.h \ + /Users/cooperhull/theos/include/HBLog.h \ + /Users/cooperhull/Desktop/Tweaks/ZenithDark/ZenithDark.h \ + /Users/cooperhull/theos/include/substrate.h + +/Users/cooperhull/theos/Prefix.pch: + +/Users/cooperhull/theos/include/_Prefix/BackwardsCompat.h: + +/Users/cooperhull/theos/include/_Prefix/IOSMacros.h: + +/Users/cooperhull/theos/include/HBLog.h: + +/Users/cooperhull/Desktop/Tweaks/ZenithDark/ZenithDark.h: + +/Users/cooperhull/theos/include/substrate.h: diff --git a/.theos/obj/debug/arm64e/Tweak.xm.9a3df4bf.o b/.theos/obj/debug/arm64e/Tweak.xm.9a3df4bf.o new file mode 100644 index 0000000..04c7bee Binary files /dev/null and b/.theos/obj/debug/arm64e/Tweak.xm.9a3df4bf.o differ diff --git a/.theos/obj/debug/arm64e/ZenithDark.dylib b/.theos/obj/debug/arm64e/ZenithDark.dylib new file mode 100755 index 0000000..7892541 Binary files /dev/null and b/.theos/obj/debug/arm64e/ZenithDark.dylib differ diff --git a/.theos/obj/debug/arm64e/ZenithDark.dylib.dSYM/Contents/Info.plist b/.theos/obj/debug/arm64e/ZenithDark.dylib.dSYM/Contents/Info.plist new file mode 100644 index 0000000..1670f3b --- /dev/null +++ b/.theos/obj/debug/arm64e/ZenithDark.dylib.dSYM/Contents/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleIdentifier + com.apple.xcode.dsym.ZenithDark.dylib + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + dSYM + CFBundleSignature + ???? + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/.theos/obj/debug/arm64e/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib b/.theos/obj/debug/arm64e/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib new file mode 100644 index 0000000..1c3296c Binary files /dev/null and b/.theos/obj/debug/arm64e/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib differ diff --git a/.theos/obj/debug/arm64e/ZenithDarkPrefs.bundle/ZenithDarkPrefs b/.theos/obj/debug/arm64e/ZenithDarkPrefs.bundle/ZenithDarkPrefs new file mode 100755 index 0000000..d0a46aa Binary files /dev/null and b/.theos/obj/debug/arm64e/ZenithDarkPrefs.bundle/ZenithDarkPrefs differ diff --git a/.theos/obj/debug/arm64e/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Info.plist b/.theos/obj/debug/arm64e/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Info.plist new file mode 100644 index 0000000..8249226 --- /dev/null +++ b/.theos/obj/debug/arm64e/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleIdentifier + com.apple.xcode.dsym.ZenithDarkPrefs + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + dSYM + CFBundleSignature + ???? + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/.theos/obj/debug/arm64e/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Resources/DWARF/ZenithDarkPrefs b/.theos/obj/debug/arm64e/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Resources/DWARF/ZenithDarkPrefs new file mode 100644 index 0000000..32538d9 Binary files /dev/null and b/.theos/obj/debug/arm64e/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Resources/DWARF/ZenithDarkPrefs differ diff --git a/.theos/obj/debug/arm64e/ZnthDrkRootListController.m.55b1348e.Td b/.theos/obj/debug/arm64e/ZnthDrkRootListController.m.55b1348e.Td new file mode 100644 index 0000000..fae8b05 --- /dev/null +++ b/.theos/obj/debug/arm64e/ZnthDrkRootListController.m.55b1348e.Td @@ -0,0 +1,21 @@ +/Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/debug/arm64e/ZnthDrkRootListController.m.55b1348e.o: \ + ZnthDrkRootListController.m /Users/cooperhull/theos/Prefix.pch \ + /Users/cooperhull/theos/include/_Prefix/BackwardsCompat.h \ + /Users/cooperhull/theos/include/_Prefix/IOSMacros.h \ + /Users/cooperhull/theos/include/HBLog.h ZnthDrkRootListController.h \ + /Users/cooperhull/theos/include/Preferences/PSListController.h \ + /Users/cooperhull/theos/include/Preferences/PSViewController.h + +/Users/cooperhull/theos/Prefix.pch: + +/Users/cooperhull/theos/include/_Prefix/BackwardsCompat.h: + +/Users/cooperhull/theos/include/_Prefix/IOSMacros.h: + +/Users/cooperhull/theos/include/HBLog.h: + +ZnthDrkRootListController.h: + +/Users/cooperhull/theos/include/Preferences/PSListController.h: + +/Users/cooperhull/theos/include/Preferences/PSViewController.h: diff --git a/.theos/obj/debug/arm64e/ZnthDrkRootListController.m.55b1348e.o b/.theos/obj/debug/arm64e/ZnthDrkRootListController.m.55b1348e.o new file mode 100644 index 0000000..a4c4e86 Binary files /dev/null and b/.theos/obj/debug/arm64e/ZnthDrkRootListController.m.55b1348e.o differ diff --git a/.theos/packages/com.mac-user669.zenithdark-1.0 b/.theos/packages/com.mac-user669.zenithdark-1.0 new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/.theos/packages/com.mac-user669.zenithdark-1.0 @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/Makefile b/Makefile index 6387a69..70bebbb 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ ARCHS = arm64 arm64e SDK = iPhoneOS13.0 FINALPACKAGE = 1 -export TARGET = iphone:clang:13.0:latest include $(THEOS)/makefiles/common.mk @@ -14,6 +13,4 @@ ZenithDark_FRAMEWORKS = UIKit CoreGraphics include $(THEOS_MAKE_PATH)/tweak.mk after-install:: - install.exec "sbreload" -SUBPROJECTS += zenithdarkprefs -include $(THEOS_MAKE_PATH)/aggregate.mk + install.exec "sbreload" \ No newline at end of file diff --git a/Tweak.xm b/Tweak.xm index fbd9fd6..7e6b86a 100644 --- a/Tweak.xm +++ b/Tweak.xm @@ -1,36 +1,17 @@ /* - Dark Mode for Zenith's Grabber view! Copyright 2020 J.K. Hayslip (@iKilledAppl3) & ToxicAppl3 INSDC/iKilledAppl3 LLC. All code was written for learning purposes and credit must be given to the original author. - Written for Cooper Hull, @(mac-user669). - - */ #import "ZenithDark.h" -static BOOL enabled; -static void loadPrefs() { - static NSMutableDictionary *settings; - - CFArrayRef keyList = CFPreferencesCopyKeyList(CFSTR("com.mac-user669.zenithdarkprefs"), kCFPreferencesCurrentUser, kCFPreferencesAnyHost); - if (keyList) { - settings = (NSMutableDictionary *)CFBridgingRelease(CFPreferencesCopyMultiple(keyList, CFSTR("com.mac-user669.zenithdarkprefs"), kCFPreferencesCurrentUser, kCFPreferencesAnyHost)); - CFRelease(keyList); - } else { - settings = [NSMutableDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.mac-user669.zenithdarkprefs.plist"]; - } - - enabled = [([settings objectForKey:@"enabled"] ? [settings objectForKey:@"enabled"] : @(YES)) boolValue]; -} - // We then hook the class in this case Zenith's grabber view is called “ZNGrabberAccessoryView” %hook ZNGrabberAccessoryView - // this is called when iOS 13's dark mode is enabled! + +// this is called when iOS 13's dark mode is enabled! -(void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { - if (enabled) { %orig(previousTraitCollection); if (@available(iOS 13, *)) { if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) { @@ -39,16 +20,13 @@ static void loadPrefs() { else { [self setBackgroundColor:kLightModeColor]; - } } } - %orig; } // the method we 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 (enabled) { // by default have our tweak overide this. if (@available(iOS 13, *)) { if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) { @@ -57,22 +35,16 @@ static void loadPrefs() { else { %orig; - } } } - %orig; } - // 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 - // our constructor %ctor { -loadPrefs(); - // We use this to make sure we load Zenith's dynamic library at runtime so we can modify it with our tweak. dlopen ("/Library/MobileSubstrate/DynamicLibraries/Zenith.dylib", RTLD_NOW); diff --git a/packages/com.mac-user669.zenithdark_1.0-1+debug_iphoneos-arm.deb b/packages/com.mac-user669.zenithdark_1.0-1+debug_iphoneos-arm.deb new file mode 100644 index 0000000..cb28e63 Binary files /dev/null and b/packages/com.mac-user669.zenithdark_1.0-1+debug_iphoneos-arm.deb differ diff --git a/packages/com.mac-user669.zenithdark_1.0_iphoneos-arm.deb b/packages/com.mac-user669.zenithdark_1.0_iphoneos-arm.deb index 6ac9a87..dfab55a 100644 Binary files a/packages/com.mac-user669.zenithdark_1.0_iphoneos-arm.deb and b/packages/com.mac-user669.zenithdark_1.0_iphoneos-arm.deb differ diff --git a/zenithdarkprefs/Makefile b/zenithdarkprefs/Makefile deleted file mode 100644 index aab3c31..0000000 --- a/zenithdarkprefs/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -include $(THEOS)/makefiles/common.mk - -ARCHS = arm64 arm64e -export TARGET = iphone:clang:13.0:latest -BUNDLE_NAME = ZenithDarkPrefs - -ZenithDarkPrefs_FILES = ZnthDrkRootListController.m -ZenithDarkPrefs_INSTALL_PATH = /Library/PreferenceBundles -ZenithDarkPrefs_FRAMEWORKS = UIKit -ZenithDarkPrefs_PRIVATE_FRAMEWORKS = Preferences -ZenithDarkPrefs_CFLAGS = -fobjc-arc - -include $(THEOS_MAKE_PATH)/bundle.mk - -internal-stage:: - $(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END) - $(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/ZenithDarkPrefs.plist$(ECHO_END) diff --git a/zenithdarkprefs/ZnthDrkRootListController.h b/zenithdarkprefs/ZnthDrkRootListController.h deleted file mode 100644 index 07cc78a..0000000 --- a/zenithdarkprefs/ZnthDrkRootListController.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface ZnthDrkRootListController : PSListController - -@end diff --git a/zenithdarkprefs/ZnthDrkRootListController.m b/zenithdarkprefs/ZnthDrkRootListController.m deleted file mode 100644 index 4c559f8..0000000 --- a/zenithdarkprefs/ZnthDrkRootListController.m +++ /dev/null @@ -1,40 +0,0 @@ -#import "ZnthDrkRootListController.h" -#import -@implementation ZnthDrkRootListController - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - UIBarButtonItem *applyButton = [[UIBarButtonItem alloc] initWithTitle:@"Apply" style:UIBarButtonItemStylePlain target:self action:@selector(respringDevice)]; - self.navigationItem.rightBarButtonItem = applyButton; -} - -- (NSArray *)specifiers { - if (!_specifiers) { - _specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self]; - } - - return _specifiers; -} - -- (void) respringDevice { - UIAlertController *confirmRespringAlert = [UIAlertController alertControllerWithTitle:@"Apply settings?" message:@"This will respring your device" preferredStyle:UIAlertControllerStyleAlert]; - UIAlertAction *confirm = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { - pid_t pid; - const char *argv[] = {"sbreload", NULL}; - posix_spawn(&pid, "/usr/bin/sbreload", NULL, NULL, (char* const*)argv, NULL); - }]; - - UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]; - - [confirmRespringAlert addAction:cancel]; - [confirmRespringAlert addAction:confirm]; - - [self presentViewController:confirmRespringAlert animated:YES completion:nil]; -} - --(void)openTwitter { - NSURL *twitter = [NSURL URLWithString:@"https://twitter.com/mac_user669"]; - [[UIApplication sharedApplication] openURL:twitter options:@{} completionHandler:nil]; -} - -@end diff --git a/zenithdarkprefs/entry.plist b/zenithdarkprefs/entry.plist deleted file mode 100644 index 9b0cc13..0000000 --- a/zenithdarkprefs/entry.plist +++ /dev/null @@ -1,21 +0,0 @@ - - - - - entry - - bundle - ZenithDarkPrefs - cell - PSLinkCell - detail - ZnthDrkRootListController - icon - icon.png - isController - - label - ZenithDarkPrefs - - -