Browse Source

Got Prefs to show and Tweak still works! Prefs don't change antything tho

master
Cooper Hull 4 years ago
parent
commit
7303f06a6c
40 changed files with 557 additions and 2 deletions
  1. +1
    -1
      .theos/_/DEBIAN/control
  2. BIN
      .theos/_/Library/MobileSubstrate/DynamicLibraries/ZenithDark.dylib
  3. BIN
      .theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/Info.plist
  4. BIN
      .theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/Root.plist
  5. BIN
      .theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/ZenithDarkPrefs
  6. BIN
      .theos/_/Library/PreferenceLoader/Preferences/ZenithDarkPrefs.plist
  7. BIN
      .theos/obj/ZenithDark.dylib
  8. +24
    -0
      .theos/obj/ZenithDarkPrefs.bundle/Info.plist
  9. +71
    -0
      .theos/obj/ZenithDarkPrefs.bundle/Root.plist
  10. BIN
      .theos/obj/ZenithDarkPrefs.bundle/ZenithDarkPrefs
  11. +23
    -0
      .theos/obj/arm64/Tweak.xm.458c23e8.Td
  12. BIN
      .theos/obj/arm64/Tweak.xm.458c23e8.o
  13. +105
    -0
      .theos/obj/arm64/Tweak.xm.mm
  14. BIN
      .theos/obj/arm64/ZenithDark.dylib
  15. BIN
      .theos/obj/arm64/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib
  16. BIN
      .theos/obj/arm64/ZenithDarkPrefs.bundle/ZenithDarkPrefs
  17. +20
    -0
      .theos/obj/arm64/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Info.plist
  18. BIN
      .theos/obj/arm64/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Resources/DWARF/ZenithDarkPrefs
  19. +25
    -0
      .theos/obj/arm64/ZnthDrkRootListController.m.6bc7b8e1.Td
  20. BIN
      .theos/obj/arm64/ZnthDrkRootListController.m.6bc7b8e1.o
  21. +21
    -0
      .theos/obj/arm64/ZnthDrkRootListController.m.a07a2f8d.Td
  22. BIN
      .theos/obj/arm64/ZnthDrkRootListController.m.a07a2f8d.o
  23. +23
    -0
      .theos/obj/arm64e/Tweak.xm.09225f44.Td
  24. BIN
      .theos/obj/arm64e/Tweak.xm.09225f44.o
  25. BIN
      .theos/obj/arm64e/ZenithDark.dylib
  26. BIN
      .theos/obj/arm64e/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib
  27. BIN
      .theos/obj/arm64e/ZenithDarkPrefs.bundle/ZenithDarkPrefs
  28. +20
    -0
      .theos/obj/arm64e/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Info.plist
  29. BIN
      .theos/obj/arm64e/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Resources/DWARF/ZenithDarkPrefs
  30. +21
    -0
      .theos/obj/arm64e/ZnthDrkRootListController.m.8d8dbbf4.Td
  31. BIN
      .theos/obj/arm64e/ZnthDrkRootListController.m.8d8dbbf4.o
  32. +3
    -0
      Makefile
  33. +22
    -1
      Tweak.xm
  34. BIN
      packages/com.mac-user669.zenithdark_1.0_iphoneos-arm.deb
  35. +17
    -0
      zenithdarkprefs/Makefile
  36. +24
    -0
      zenithdarkprefs/Resources/Info.plist
  37. +71
    -0
      zenithdarkprefs/Resources/Root.plist
  38. +5
    -0
      zenithdarkprefs/ZnthDrkRootListController.h
  39. +40
    -0
      zenithdarkprefs/ZnthDrkRootListController.m
  40. +21
    -0
      zenithdarkprefs/entry.plist

+ 1
- 1
.theos/_/DEBIAN/control View File

@@ -9,4 +9,4 @@ 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
Installed-Size: 104
Installed-Size: 312

BIN
.theos/_/Library/MobileSubstrate/DynamicLibraries/ZenithDark.dylib View File


BIN
.theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/Info.plist View File


BIN
.theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/Root.plist View File


BIN
.theos/_/Library/PreferenceBundles/ZenithDarkPrefs.bundle/ZenithDarkPrefs View File


BIN
.theos/_/Library/PreferenceLoader/Preferences/ZenithDarkPrefs.plist View File


BIN
.theos/obj/ZenithDark.dylib View File


+ 24
- 0
.theos/obj/ZenithDarkPrefs.bundle/Info.plist View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>ZenithDarkPrefs</string>
<key>CFBundleIdentifier</key>
<string>com.mac-user669.zenithdarkprefs</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>ZnthDrkRootListController</string>
</dict>
</plist>

+ 71
- 0
.theos/obj/ZenithDarkPrefs.bundle/Root.plist View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>Enable</string>
</dict>
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<true/>
<key>defaults</key>
<string>com.mac-user669.zenithdarkprefs</string>
<key>key</key>
<string>enabled</string>
<key>label</key>
<string>Enable</string>
</dict>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>Customization</string>
</dict>
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<true/>
<key>defaults</key>
<string>com.mac-user669.zenithdarkprefs</string>
<key>key</key>
<string>replaceoriginalview</string>
<key>label</key>
<string>Replace Original View</string>
</dict>
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<false/>
<key>defaults</key>
<string>com.mac-user669.zenithdarkprefs</string>
<key>key</key>
<string>notificationBadgesEnabled</string>
<key>label</key>
<string>Enable Notification Badges</string>
</dict>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
</dict>
<dict>
<key>cell</key>
<string>PSButtonCell</string>
<key>label</key>
<string>@mac_user669</string>
<key>action</key>
<string>openTwitter</string>
</dict>
</array>
<key>title</key>
<string>ZenithDark</string>
</dict>
</plist>

BIN
.theos/obj/ZenithDarkPrefs.bundle/ZenithDarkPrefs View File


+ 23
- 0
.theos/obj/arm64/Tweak.xm.458c23e8.Td View File

@@ -0,0 +1,23 @@
/Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/arm64/Tweak.xm.458c23e8.o: \
/Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/arm64/Tweak.xm.mm \
/Users/cooperhull/theos/Prefix.pch \
/Users/cooperhull/theos/vendor/include/_Prefix/BackwardsCompat.h \
/Users/cooperhull/theos/vendor/include/_Prefix/IOSMacros.h \
/Users/cooperhull/theos/vendor/include/HBLog.h \
/Users/cooperhull/theos/vendor/include/CoreFoundation/CFLogUtilities.h \
/Users/cooperhull/Desktop/Tweaks/ZenithDark/ZenithDark.h \
/Users/cooperhull/theos/vendor/include/substrate.h

/Users/cooperhull/theos/Prefix.pch:

/Users/cooperhull/theos/vendor/include/_Prefix/BackwardsCompat.h:

/Users/cooperhull/theos/vendor/include/_Prefix/IOSMacros.h:

/Users/cooperhull/theos/vendor/include/HBLog.h:

/Users/cooperhull/theos/vendor/include/CoreFoundation/CFLogUtilities.h:

/Users/cooperhull/Desktop/Tweaks/ZenithDark/ZenithDark.h:

/Users/cooperhull/theos/vendor/include/substrate.h:

BIN
.theos/obj/arm64/Tweak.xm.458c23e8.o View File


+ 105
- 0
.theos/obj/arm64/Tweak.xm.mm View File

@@ -0,0 +1,105 @@
#line 1 "Tweak.xm"











#import "ZenithDark.h"

static BOOL enabled;
static BOOL replaceOriginalView;
static BOOL notificationBadgesEnabled;
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];
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)
#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 35 "Tweak.xm"


static void _logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd, UITraitCollection * previousTraitCollection) {
_logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(self, _cmd, previousTraitCollection);
if (@available(iOS 13, *)) {
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
[self setBackgroundColor:kDarkModeColor];
}

else {
[self setBackgroundColor:kLightModeColor];
}
}
}



static void _logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd, UIColor * backgroundColor) {
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);
}
}
}





static __attribute__((constructor)) void _logosLocalCtor_bbe4a825(int __unused argc, char __unused **argv, char __unused **envp) {

loadPrefs();


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"

BIN
.theos/obj/arm64/ZenithDark.dylib View File


BIN
.theos/obj/arm64/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib View File


BIN
.theos/obj/arm64/ZenithDarkPrefs.bundle/ZenithDarkPrefs View File


+ 20
- 0
.theos/obj/arm64/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Info.plist View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.ZenithDarkPrefs</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

BIN
.theos/obj/arm64/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Resources/DWARF/ZenithDarkPrefs View File


+ 25
- 0
.theos/obj/arm64/ZnthDrkRootListController.m.6bc7b8e1.Td View File

@@ -0,0 +1,25 @@
/Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/arm64/ZnthDrkRootListController.m.6bc7b8e1.o: \
ZnthDrkRootListController.m /Users/cooperhull/theos/Prefix.pch \
/Users/cooperhull/theos/vendor/include/_Prefix/BackwardsCompat.h \
/Users/cooperhull/theos/vendor/include/_Prefix/IOSMacros.h \
/Users/cooperhull/theos/vendor/include/HBLog.h \
/Users/cooperhull/theos/vendor/include/CoreFoundation/CFLogUtilities.h \
ZnthDrkRootListController.h \
/Users/cooperhull/theos/vendor/include/Preferences/PSListController.h \
/Users/cooperhull/theos/vendor/include/Preferences/PSViewController.h

/Users/cooperhull/theos/Prefix.pch:

/Users/cooperhull/theos/vendor/include/_Prefix/BackwardsCompat.h:

/Users/cooperhull/theos/vendor/include/_Prefix/IOSMacros.h:

/Users/cooperhull/theos/vendor/include/HBLog.h:

/Users/cooperhull/theos/vendor/include/CoreFoundation/CFLogUtilities.h:

ZnthDrkRootListController.h:

/Users/cooperhull/theos/vendor/include/Preferences/PSListController.h:

/Users/cooperhull/theos/vendor/include/Preferences/PSViewController.h:

BIN
.theos/obj/arm64/ZnthDrkRootListController.m.6bc7b8e1.o View File


+ 21
- 0
.theos/obj/arm64/ZnthDrkRootListController.m.a07a2f8d.Td View File

@@ -0,0 +1,21 @@
/Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/arm64/ZnthDrkRootListController.m.a07a2f8d.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:

BIN
.theos/obj/arm64/ZnthDrkRootListController.m.a07a2f8d.o View File


+ 23
- 0
.theos/obj/arm64e/Tweak.xm.09225f44.Td View File

@@ -0,0 +1,23 @@
/Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/arm64e/Tweak.xm.09225f44.o: \
/Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/arm64e/Tweak.xm.mm \
/Users/cooperhull/theos/Prefix.pch \
/Users/cooperhull/theos/vendor/include/_Prefix/BackwardsCompat.h \
/Users/cooperhull/theos/vendor/include/_Prefix/IOSMacros.h \
/Users/cooperhull/theos/vendor/include/HBLog.h \
/Users/cooperhull/theos/vendor/include/CoreFoundation/CFLogUtilities.h \
/Users/cooperhull/Desktop/Tweaks/ZenithDark/ZenithDark.h \
/Users/cooperhull/theos/vendor/include/substrate.h

/Users/cooperhull/theos/Prefix.pch:

/Users/cooperhull/theos/vendor/include/_Prefix/BackwardsCompat.h:

/Users/cooperhull/theos/vendor/include/_Prefix/IOSMacros.h:

/Users/cooperhull/theos/vendor/include/HBLog.h:

/Users/cooperhull/theos/vendor/include/CoreFoundation/CFLogUtilities.h:

/Users/cooperhull/Desktop/Tweaks/ZenithDark/ZenithDark.h:

/Users/cooperhull/theos/vendor/include/substrate.h:

BIN
.theos/obj/arm64e/Tweak.xm.09225f44.o View File


BIN
.theos/obj/arm64e/ZenithDark.dylib View File


BIN
.theos/obj/arm64e/ZenithDark.dylib.dSYM/Contents/Resources/DWARF/ZenithDark.dylib View File


BIN
.theos/obj/arm64e/ZenithDarkPrefs.bundle/ZenithDarkPrefs View File


+ 20
- 0
.theos/obj/arm64e/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Info.plist View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.ZenithDarkPrefs</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

BIN
.theos/obj/arm64e/ZenithDarkPrefs.bundle/ZenithDarkPrefs.dSYM/Contents/Resources/DWARF/ZenithDarkPrefs View File


+ 21
- 0
.theos/obj/arm64e/ZnthDrkRootListController.m.8d8dbbf4.Td View File

@@ -0,0 +1,21 @@
/Users/cooperhull/Desktop/Tweaks/ZenithDark/.theos/obj/arm64e/ZnthDrkRootListController.m.8d8dbbf4.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:

BIN
.theos/obj/arm64e/ZnthDrkRootListController.m.8d8dbbf4.o View File


+ 3
- 0
Makefile View File

@@ -1,6 +1,7 @@
ARCHS = arm64 arm64e
SDK = iPhoneOS12.4
FINALPACKAGE = 1
export TARGET = iphone:clang:11.2:latest

include $(THEOS)/makefiles/common.mk

@@ -14,3 +15,5 @@ include $(THEOS_MAKE_PATH)/tweak.mk

after-install::
install.exec "sbreload"
SUBPROJECTS += zenithdarkprefs
include $(THEOS_MAKE_PATH)/aggregate.mk

+ 22
- 1
Tweak.xm View File

@@ -11,9 +11,28 @@ Written for Cooper Hull, @(mac-user669).

#import "ZenithDark.h"

static BOOL enabled;
static BOOL replaceOriginalView;
static BOOL notificationBadgesEnabled;
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];
replaceOriginalView = [([settings objectForKey:@"replaceoriginalview"] ? [settings objectForKey:@"replaceoriginalview"] : @(YES)) boolValue];
notificationBadgesEnabled = [([settings objectForKey:@"notificationBadgesEnabled"] ? [settings objectForKey:@"notificationBadgesEnabled"] : NO) 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!
-(void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
%orig(previousTraitCollection);
@@ -49,6 +68,8 @@ Written for Cooper Hull, @(mac-user669).
// 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);


BIN
packages/com.mac-user669.zenithdark_1.0_iphoneos-arm.deb View File


+ 17
- 0
zenithdarkprefs/Makefile View File

@@ -0,0 +1,17 @@
include $(THEOS)/makefiles/common.mk

ARCHS = arm64 arm64e
export TARGET = iphone:clang:11.2: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)

+ 24
- 0
zenithdarkprefs/Resources/Info.plist View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>ZenithDarkPrefs</string>
<key>CFBundleIdentifier</key>
<string>com.mac-user669.zenithdarkprefs</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>ZnthDrkRootListController</string>
</dict>
</plist>

+ 71
- 0
zenithdarkprefs/Resources/Root.plist View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>Enable</string>
</dict>
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<true/>
<key>defaults</key>
<string>com.mac-user669.zenithdarkprefs</string>
<key>key</key>
<string>enabled</string>
<key>label</key>
<string>Enable</string>
</dict>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>Customization</string>
</dict>
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<true/>
<key>defaults</key>
<string>com.mac-user669.zenithdarkprefs</string>
<key>key</key>
<string>replaceoriginalview</string>
<key>label</key>
<string>Replace Original View</string>
</dict>
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<false/>
<key>defaults</key>
<string>com.mac-user669.zenithdarkprefs</string>
<key>key</key>
<string>notificationBadgesEnabled</string>
<key>label</key>
<string>Enable Notification Badges</string>
</dict>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
</dict>
<dict>
<key>cell</key>
<string>PSButtonCell</string>
<key>label</key>
<string>@mac_user669</string>
<key>action</key>
<string>openTwitter</string>
</dict>
</array>
<key>title</key>
<string>ZenithDark</string>
</dict>
</plist>

+ 5
- 0
zenithdarkprefs/ZnthDrkRootListController.h View File

@@ -0,0 +1,5 @@
#import <Preferences/PSListController.h>

@interface ZnthDrkRootListController : PSListController

@end

+ 40
- 0
zenithdarkprefs/ZnthDrkRootListController.m View File

@@ -0,0 +1,40 @@
#import "ZnthDrkRootListController.h"
#import <spawn.h>
@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

+ 21
- 0
zenithdarkprefs/entry.plist View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>entry</key>
<dict>
<key>bundle</key>
<string>ZenithDarkPrefs</string>
<key>cell</key>
<string>PSLinkCell</string>
<key>detail</key>
<string>ZnthDrkRootListController</string>
<key>icon</key>
<string>icon.png</string>
<key>isController</key>
<true/>
<key>label</key>
<string>ZenithDarkPrefs</string>
</dict>
</dict>
</plist>

Loading…
Cancel
Save