added Preferences
-Adds preferences -Adds credits to prefefrences -Icon for preferences -Share button for sharing to social media. -Code cleanup -Thanks @skittyblock!
@ -1,14 +1,14 @@
|
||||
ARCHS = arm64 arm64e
|
||||
SDK = iPhoneOS12.4
|
||||
FINALPACKAGE = 1
|
||||
|
||||
include $(THEOS)/makefiles/common.mk
|
||||
|
||||
ARCHS = arm64 arm64e
|
||||
export TARGET = iphone:clang:13.0:latest
|
||||
BUNDLE_NAME = ZenithDarkPrefs
|
||||
|
||||
ZenithDarkPrefs_FILES = ZnthDrkRootListController.m
|
||||
ZenithDarkPrefs_FILES = ZNDarkPrefsRootListController.m
|
||||
ZenithDarkPrefs_INSTALL_PATH = /Library/PreferenceBundles
|
||||
ZenithDarkPrefs_FRAMEWORKS = UIKit
|
||||
ZenithDarkPrefs_PRIVATE_FRAMEWORKS = Preferences
|
||||
ZenithDarkPrefs_CFLAGS = -fobjc-arc
|
||||
|
||||
include $(THEOS_MAKE_PATH)/bundle.mk
|
||||
|
||||
|
@ -19,6 +19,6 @@
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>ZnthDrkRootListController</string>
|
||||
<string>ZNDarkPrefsRootListController</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -8,35 +8,92 @@
|
||||
<key>cell</key>
|
||||
<string>PSGroupCell</string>
|
||||
<key>label</key>
|
||||
<string>Enable</string>
|
||||
<string>Enable Tweak</string>
|
||||
<key>footerText</key>
|
||||
<string>Enable to give Zenith's pull tabs a dark look!</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>PostNotification</key>
|
||||
<string>com.mac-user669.zenithdark.prefschanged</string>
|
||||
<key>cell</key>
|
||||
<string>PSSwitchCell</string>
|
||||
<key>default</key>
|
||||
<true/>
|
||||
<key>defaults</key>
|
||||
<string>com.mac-user669.zenithdarkprefs</string>
|
||||
<string>com.mac-user669.zenithdark</string>
|
||||
<key>key</key>
|
||||
<string>enabled</string>
|
||||
<string>kEnabled</string>
|
||||
<key>label</key>
|
||||
<string>Enable</string>
|
||||
</dict>
|
||||
|
||||
<dict>
|
||||
<key>cell</key>
|
||||
<string>PSGroupCell</string>
|
||||
<key>label</key>
|
||||
<string>Credits</string>
|
||||
<key>footerText</key>
|
||||
<string>Conceptualized by your yours truly.</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>icon</key>
|
||||
<string>mac-user669.png</string>
|
||||
<key>cell</key>
|
||||
<string>PSButtonCell</string>
|
||||
<key>label</key>
|
||||
<string>mac-user669 (@mac-user669)</string>
|
||||
<key>action</key>
|
||||
<string>followMe</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>cell</key>
|
||||
<string>PSGroupCell</string>
|
||||
<key>footerText</key>
|
||||
<string>Coded most of the tweak.</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>icon</key>
|
||||
<string>iKA.png</string>
|
||||
<key>cell</key>
|
||||
<string>PSButtonCell</string>
|
||||
<key>label</key>
|
||||
<string>J.K. Hayslip (@iKilledAppl3) </string>
|
||||
<key>action</key>
|
||||
<string>followiKA</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>cell</key>
|
||||
<string>PSGroupCell</string>
|
||||
<key>footerText</key>
|
||||
<string>Helped with some of our preferences code and amongst other things.</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>icon</key>
|
||||
<string>skitty.png</string>
|
||||
<key>cell</key>
|
||||
<string>PSButtonCell</string>
|
||||
<key>label</key>
|
||||
<string>Skitty (@skittyblock) </string>
|
||||
<key>action</key>
|
||||
<string>followSkitty</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>cell</key>
|
||||
<string>PSGroupCell</string>
|
||||
<key>label</key>
|
||||
<string>Apply Changes</string>
|
||||
<key>footerText</key>
|
||||
<string>A Respring is needed to apply changes!</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>cell</key>
|
||||
<string>PSButtonCell</string>
|
||||
<key>label</key>
|
||||
<string>@mac_user669</string>
|
||||
<string>Respring</string>
|
||||
<key>action</key>
|
||||
<string>openTwitter</string>
|
||||
<string>doAFancyRespring</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>title</key>
|
||||
<string>ZenithDark</string>
|
||||
</dict>
|
||||
</plist>
|
||||
</plist>
|
||||
|
BIN
zenithdarkprefs/Resources/ZenithDark@2x.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
zenithdarkprefs/Resources/ZenithDark@3x.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
zenithdarkprefs/Resources/iKA@2x.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
zenithdarkprefs/Resources/iKA@3x.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
zenithdarkprefs/Resources/mac-user669@2x.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
zenithdarkprefs/Resources/mac-user669@3x.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
zenithdarkprefs/Resources/skitty@2x.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
zenithdarkprefs/Resources/skitty@3x.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
35
zenithdarkprefs/ZNDarkPrefsRootListController.h
Normal file
@ -0,0 +1,35 @@
|
||||
#import <Preferences/PSListController.h>
|
||||
@import UIKit;
|
||||
|
||||
// image for share button
|
||||
|
||||
#define kImagePath @"/Library/Application Support/ZenithDark/ZNDark.png"
|
||||
|
||||
@interface ZNDarkPrefsRootListController : PSListController
|
||||
@property (nonatomic, strong) UIBlurEffect *respringBlur;
|
||||
@property (nonatomic, strong) UIVisualEffectView *respringEffectView;
|
||||
@property (nonatomic, strong) UIWindow *mainAppRootWindow;
|
||||
@end
|
||||
|
||||
|
||||
// we use this to respring our device!
|
||||
@interface NSTask : NSObject
|
||||
@property (copy) NSArray *arguments;
|
||||
@property (copy) NSString *currentDirectoryPath;
|
||||
@property (copy) NSDictionary *environment;
|
||||
@property (copy) NSString *launchPath;
|
||||
@property (readonly) int processIdentifier;
|
||||
@property (retain) id standardError;
|
||||
@property (retain) id standardInput;
|
||||
@property (retain) id standardOutput;
|
||||
+ (id)currentTaskDictionary;
|
||||
+ (id)launchedTaskWithDictionary:(id)arg1;
|
||||
+ (id)launchedTaskWithLaunchPath:(id)arg1 arguments:(id)arg2;
|
||||
- (id)init;
|
||||
- (void)interrupt;
|
||||
- (bool)isRunning;
|
||||
- (void)launch;
|
||||
- (bool)resume;
|
||||
- (bool)suspend;
|
||||
- (void)terminate;
|
||||
@end
|
101
zenithdarkprefs/ZNDarkPrefsRootListController.m
Normal file
@ -0,0 +1,101 @@
|
||||
#import "ZNDarkPrefsRootListController.h"
|
||||
|
||||
@implementation ZNDarkPrefsRootListController
|
||||
|
||||
-(void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
// share button for our tweak :P
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:self action:@selector(shareTapped)];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//share button action
|
||||
- (void)shareTapped {
|
||||
|
||||
NSString *shareText = @"Turn off the lights! It's too bright! Get dark tabs for #Zenith (@Muirey03) by using #ZenithDark from @mac_user669 and @iKilledAppl3! https://mac-user669.github.io/repo/";
|
||||
UIImage *image = [UIImage imageWithContentsOfFile:kImagePath];
|
||||
NSArray * itemsToShare = @[shareText, image];
|
||||
|
||||
UIActivityViewController *controller = [[UIActivityViewController alloc]initWithActivityItems:itemsToShare applicationActivities:nil];
|
||||
|
||||
// and present it
|
||||
[self presentActivityController:controller];
|
||||
}
|
||||
|
||||
- (void)presentActivityController:(UIActivityViewController *)controller {
|
||||
|
||||
// for iPad: make the presentation a Popover
|
||||
controller.modalPresentationStyle = UIModalPresentationPopover;
|
||||
[self presentViewController:controller animated:YES completion:nil];
|
||||
|
||||
UIPopoverPresentationController *popController = [controller popoverPresentationController];
|
||||
popController.permittedArrowDirections = UIPopoverArrowDirectionAny;
|
||||
popController.barButtonItem = self.navigationItem.rightBarButtonItem;
|
||||
|
||||
}
|
||||
|
||||
- (NSArray *)specifiers {
|
||||
if (!_specifiers) {
|
||||
_specifiers = [[self loadSpecifiersFromPlistName:@"Root" target:self] retain];
|
||||
}
|
||||
|
||||
return _specifiers;
|
||||
}
|
||||
|
||||
|
||||
-(void)followMe {
|
||||
NSURL *twitter = [NSURL URLWithString:@"https://twitter.com/mac_user669"];
|
||||
[[UIApplication sharedApplication] openURL:twitter options:@{} completionHandler:nil];
|
||||
}
|
||||
|
||||
-(void)followiKA {
|
||||
NSURL *twitter = [NSURL URLWithString:@"https://twitter.com/iKilledAppl3"];
|
||||
[[UIApplication sharedApplication] openURL:twitter options:@{} completionHandler:nil];
|
||||
}
|
||||
|
||||
-(void)followSkitty {
|
||||
NSURL *twitter = [NSURL URLWithString:@"https://twitter.com/SkittyBlock"];
|
||||
[[UIApplication sharedApplication] openURL:twitter options:@{} completionHandler:nil];
|
||||
}
|
||||
|
||||
|
||||
-(void)respring {
|
||||
NSTask *task = [[[NSTask alloc] init] autorelease];
|
||||
[task setLaunchPath:@"/usr/bin/killall"];
|
||||
[task setArguments:[NSArray arrayWithObjects:@"backboardd", nil]];
|
||||
[task launch];
|
||||
|
||||
}
|
||||
|
||||
-(void)doAFancyRespring {
|
||||
|
||||
UIAlertController *confirmRespringAlert = [UIAlertController alertControllerWithTitle:@"Apply Settings?" message:@"This will respring your device." preferredStyle:UIAlertControllerStyleActionSheet];
|
||||
UIAlertAction *confirm = [UIAlertAction actionWithTitle:@"Respring" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
|
||||
|
||||
// blur then respring our device!
|
||||
self.mainAppRootWindow = [UIApplication sharedApplication].keyWindow;
|
||||
self.respringBlur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
|
||||
self.respringEffectView = [[UIVisualEffectView alloc] initWithEffect:self.respringBlur];
|
||||
self.respringEffectView.frame = [[UIScreen mainScreen] bounds];
|
||||
[self.mainAppRootWindow addSubview:self.respringEffectView];
|
||||
[UIView beginAnimations:nil context:NULL];
|
||||
[UIView setAnimationDuration:5.0];
|
||||
[self.respringEffectView setAlpha:0];
|
||||
[UIView commitAnimations];
|
||||
|
||||
[self performSelector:@selector(respring) withObject:nil afterDelay:3.0];
|
||||
|
||||
}];
|
||||
|
||||
UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
|
||||
|
||||
[confirmRespringAlert addAction:cancel];
|
||||
[confirmRespringAlert addAction:confirm];
|
||||
|
||||
[self presentViewController:confirmRespringAlert animated:YES completion:nil];
|
||||
}
|
||||
|
||||
@end
|
@ -1,5 +0,0 @@
|
||||
#import <Preferences/PSListController.h>
|
||||
|
||||
@interface ZnthDrkRootListController : PSListController
|
||||
|
||||
@end
|
@ -1,40 +0,0 @@
|
||||
#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
|
@ -9,13 +9,13 @@
|
||||
<key>cell</key>
|
||||
<string>PSLinkCell</string>
|
||||
<key>detail</key>
|
||||
<string>ZnthDrkRootListController</string>
|
||||
<string>ZNDarkPrefsRootListController</string>
|
||||
<key>icon</key>
|
||||
<string>icon.png</string>
|
||||
<string>ZenithDark.png</string>
|
||||
<key>isController</key>
|
||||
<true/>
|
||||
<key>label</key>
|
||||
<string>ZenithDarkPrefs</string>
|
||||
<string>ZenithDark</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|