Revert "iOS 12 support! Also tweaked the colors a little bit"
This reverts commit 4cce378f9e
.
This commit is contained in:
57
Tweak.xm
57
Tweak.xm
@ -1,5 +1,3 @@
|
|||||||
#import "ZenithDark.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
Dark Mode for Zenith's Grabber view!
|
Dark Mode for Zenith's Grabber view!
|
||||||
@ -11,7 +9,8 @@ Written for Cooper Hull, @(mac-user669).
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
%group Tweak13
|
#import "ZenithDark.h"
|
||||||
|
|
||||||
// We then hook the class in this case Zenith's grabber view is called “ZNGrabberAccessoryView”
|
// We then hook the class in this case Zenith's grabber view is called “ZNGrabberAccessoryView”
|
||||||
%hook ZNGrabberAccessoryView
|
%hook ZNGrabberAccessoryView
|
||||||
|
|
||||||
@ -57,30 +56,13 @@ else {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%end // 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
|
// 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
|
|
||||||
|
|
||||||
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 {
|
|
||||||
//call the original function then pass our custom argument to the backgroundColor argument as shown below.
|
|
||||||
%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
|
%end
|
||||||
|
|
||||||
|
|
||||||
static void loadPrefs() { // Load preferences to make sure changes are written to the plist
|
|
||||||
|
// Load preferences to make sure changes are written to the plist
|
||||||
|
static void loadPrefs() {
|
||||||
|
|
||||||
// Thanks to skittyblock!
|
// Thanks to skittyblock!
|
||||||
CFArrayRef keyList = CFPreferencesCopyKeyList(CFSTR("com.mac-user669.zenithdark"), kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
CFArrayRef keyList = CFPreferencesCopyKeyList(CFSTR("com.mac-user669.zenithdark"), kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||||
@ -95,31 +77,22 @@ static void loadPrefs() { // Load preferences to make sure changes are written
|
|||||||
prefs = [NSMutableDictionary dictionaryWithContentsOfFile:PLIST_PATH];
|
prefs = [NSMutableDictionary dictionaryWithContentsOfFile:PLIST_PATH];
|
||||||
|
|
||||||
}
|
}
|
||||||
kEnabled = [([prefs objectForKey:@"kEnabled"] ?: @(YES)) boolValue]; //our preference values that write to a plist file when a user selects somethings
|
//our preference values that write to a plist file when a user selects somethings
|
||||||
|
kEnabled = [([prefs objectForKey:@"kEnabled"] ?: @(YES)) boolValue];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Thanks to skittyblock!
|
// thanks to skittyblock!
|
||||||
static void PreferencesChangedCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
|
static void PreferencesChangedCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
|
||||||
loadPrefs();
|
loadPrefs();
|
||||||
}
|
}
|
||||||
|
|
||||||
%ctor { // Our constructor
|
// our constructor
|
||||||
|
%ctor {
|
||||||
loadPrefs(); // Load our prefs
|
// load our prefs
|
||||||
|
loadPrefs();
|
||||||
if (kEnabled) { // If enabled
|
|
||||||
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);
|
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback) PreferencesChangedCallback, CFSTR("com.mac-user669.zenithdark.prefschanged"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
||||||
|
// 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); // 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);
|
||||||
|
|
||||||
}
|
}
|
@ -26,10 +26,10 @@ BOOL kEnabled;
|
|||||||
NSMutableDictionary *prefs;
|
NSMutableDictionary *prefs;
|
||||||
|
|
||||||
// Dark Zenith color we are using macros so we can call it later if need be.
|
// Dark Zenith color we are using macros so we can call it later if need be.
|
||||||
#define kDarkModeColor [UIColor colorWithRed:0.11 green:0.11 blue:0.11 alpha:0.73];
|
#define kDarkModeColor [UIColor colorWithWhite:0.0 alpha:0.44]
|
||||||
|
|
||||||
// Stock Zenith color we are using macros so we can call it later if need be.
|
// Stock Zenith color we are using macros so we can call it later if need be.
|
||||||
#define kLightModeColor [UIColor colorWithWhite:1.0 alpha:0.8]
|
#define kLightModeColor [UIColor colorWithWhite:1.0 alpha:0.7]
|
||||||
|
|
||||||
// the PLIST path where all user settings are stored.
|
// the PLIST path where all user settings are stored.
|
||||||
#define PLIST_PATH @"/var/mobile/Library/Preferences/com.mac-user669.zenithdark.plist"
|
#define PLIST_PATH @"/var/mobile/Library/Preferences/com.mac-user669.zenithdark.plist"
|
||||||
|
4
control
4
control
@ -1,8 +1,8 @@
|
|||||||
Package: com.mac-user669.zenithdark
|
Package: com.mac-user669.zenithdark
|
||||||
Version: 1.2
|
Version: 1.1
|
||||||
Architecture: iphoneos-arm
|
Architecture: iphoneos-arm
|
||||||
Maintainer: mac-user669
|
Maintainer: mac-user669
|
||||||
Depends: mobilesubstrate, preferenceloader, com.muirey03.zenith
|
Depends: mobilesubstrate, preferenceloader, com.muirey03.zenith, firmware (>=13.0)
|
||||||
Section: Tweaks
|
Section: Tweaks
|
||||||
Description: Changes Zeniths tabs to a dark blur
|
Description: Changes Zeniths tabs to a dark blur
|
||||||
Author: mac-user669
|
Author: mac-user669
|
||||||
|
Reference in New Issue
Block a user