Early Pref support, still a little wonky
This commit is contained in:
20
.theos/obj/arm64/Tweak.xm.27a6b95b.Td
Normal file
20
.theos/obj/arm64/Tweak.xm.27a6b95b.Td
Normal file
@ -0,0 +1,20 @@
|
||||
/Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/arm64/Tweak.xm.27a6b95b.o: \
|
||||
/Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/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:
|
20
.theos/obj/arm64/Tweak.xm.c4e2add9.Td
Normal file
20
.theos/obj/arm64/Tweak.xm.c4e2add9.Td
Normal file
@ -0,0 +1,20 @@
|
||||
/Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/arm64/Tweak.xm.c4e2add9.o: \
|
||||
/Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/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:
|
BIN
.theos/obj/arm64/Tweak.xm.c4e2add9.o
Normal file
BIN
.theos/obj/arm64/Tweak.xm.c4e2add9.o
Normal file
Binary file not shown.
@ -13,8 +13,6 @@
|
||||
#import "ZenithDark.h"
|
||||
|
||||
static BOOL enabled;
|
||||
static BOOL replaceOriginalView;
|
||||
static BOOL notificationBadgesEnabled;
|
||||
static void loadPrefs() {
|
||||
static NSMutableDictionary *settings;
|
||||
|
||||
@ -27,13 +25,10 @@ static void loadPrefs() {
|
||||
}
|
||||
|
||||
enabled = [([settings objectForKey:@"enabled"] ? [settings objectForKey:@"enabled"] : @(YES)) boolValue];
|
||||
replaceOriginalView = [([settings objectForKey:@"replaceoriginalview"] ? [settings objectForKey:@"replaceoriginalview"] : @(YES)) boolValue];
|
||||
notificationBadgesEnabled = [([settings objectForKey:@"notificationBadgesEnabled"] ? [settings objectForKey:@"notificationBadgesEnabled"] : NO) boolValue];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#include <substrate.h>
|
||||
#if defined(__clang__)
|
||||
#if __has_feature(objc_arc)
|
||||
@ -57,10 +52,11 @@ 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 35 "Tweak.xm"
|
||||
|
||||
#line 30 "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) {
|
||||
@ -69,13 +65,16 @@ static void _logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidCh
|
||||
|
||||
else {
|
||||
[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) {
|
||||
@ -84,15 +83,19 @@ static void _logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(
|
||||
|
||||
else {
|
||||
_logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(self, _cmd, backgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
_logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(self, _cmd, backgroundColor);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static __attribute__((constructor)) void _logosLocalCtor_bbe4a825(int __unused argc, char __unused **argv, char __unused **envp) {
|
||||
|
||||
|
||||
static __attribute__((constructor)) void _logosLocalCtor_7f270ec4(int __unused argc, char __unused **argv, char __unused **envp) {
|
||||
|
||||
loadPrefs();
|
||||
|
||||
@ -102,4 +105,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 77 "Tweak.xm"
|
||||
#line 80 "Tweak.xm"
|
||||
|
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user