INSTALL_TARGET_PROCESSES = SpringBoard | INSTALL_TARGET_PROCESSES = SpringBoard | ||||
ARCHS = armv7 armv7s arm64 arm64e | |||||
ARCHS = arm64e arm64 armv7 armv7s | |||||
include ~/theos/makefiles/common.mk | include ~/theos/makefiles/common.mk | ||||
TWEAK_NAME = TruthfulDock | TWEAK_NAME = TruthfulDock | ||||
TruthfulDock_CFLAGS = -fobjc-arc | TruthfulDock_CFLAGS = -fobjc-arc | ||||
include ~/theos/makefiles/tweak.mk | include ~/theos/makefiles/tweak.mk | ||||
SUBPROJECTS += truthfuldockprefs | |||||
include $(THEOS_MAKE_PATH)/aggregate.mk |
%hook SBDockView | %hook SBDockView | ||||
-(void)setBackgroundAlpha:(double)arg1 { | -(void)setBackgroundAlpha:(double)arg1 { | ||||
%orig(0.0); | |||||
NSDictionary *bundleDefaults = [[NSUserDefaults standardUserDefaults]persistentDomainForName:@"com.exoticswingset.truthfuldockprefs"]; | |||||
id isTweakEnabled = [bundleDefaults valueForKey:@"isTweakEnabled"]; | |||||
double alphaValue = [[bundleDefaults valueForKey:@"alphaValue"]doubleValue]; | |||||
if ([isTweakEnabled isEqual:@0]) { | |||||
%orig; | |||||
} else { | |||||
%orig(alphaValue); | |||||
} | |||||
} | } | ||||
%end | |||||
-(BOOL)isDockInset { | |||||
NSDictionary *bundleDefaults = [[NSUserDefaults standardUserDefaults]persistentDomainForName:@"com.exoticswingset.truthfuldockprefs"]; | |||||
id isTweakEnabled = [bundleDefaults valueForKey:@"isTweakEnabled"]; | |||||
id classicDockEnabled = [bundleDefaults valueForKey:@"classicDockEnabled"]; | |||||
if ([isTweakEnabled isEqual:@0]) { | |||||
return %orig; | |||||
} else if ([classicDockEnabled isEqual:@0]) { | |||||
return %orig; | |||||
} else { | |||||
return NO; | |||||
} | |||||
} | |||||
%end |
Package: com.exoticswingset.truthfuldock | Package: com.exoticswingset.truthfuldock | ||||
Name: TruthfulDock | Name: TruthfulDock | ||||
Depends: mobilesubstrate | Depends: mobilesubstrate | ||||
Version: 0.0.2 | |||||
Version: 2.0 | |||||
Architecture: iphoneos-arm | Architecture: iphoneos-arm | ||||
Description: An awesome MobileSubstrate tweak! | Description: An awesome MobileSubstrate tweak! | ||||
Maintainer: ExoticSwingset | Maintainer: ExoticSwingset |
include ~/theos/makefiles/common.mk | |||||
ARCHS = arm64e arm64 armv7 armv7s | |||||
BUNDLE_NAME = TruthfulDockPrefs | |||||
TruthfulDockPrefs_FILES = TDPRootListController.m | |||||
TruthfulDockPrefs_INSTALL_PATH = /Library/PreferenceBundles | |||||
TruthfulDockPrefs_FRAMEWORKS = UIKit | |||||
TruthfulDockPrefs_PRIVATE_FRAMEWORKS = Preferences | |||||
TruthfulDockPrefs_CFLAGS = -fobjc-arc | |||||
include ~/theos/makefiles/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/TruthfulDockPrefs.plist$(ECHO_END) |
<?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>TruthfulDockPrefs</string> | |||||
<key>CFBundleIdentifier</key> | |||||
<string>com.exoticswingset.truthfuldockprefs</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>TDPRootListController</string> | |||||
</dict> | |||||
</plist> |
<?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>General</string> | |||||
</dict> | |||||
<dict> | |||||
<key>cell</key> | |||||
<string>PSSwitchCell</string> | |||||
<key>default</key> | |||||
<true/> | |||||
<key>defaults</key> | |||||
<string>com.exoticswingset.truthfuldockprefs</string> | |||||
<key>key</key> | |||||
<string>isTweakEnabled</string> | |||||
<key>label</key> | |||||
<string>Enabled</string> | |||||
</dict> | |||||
<dict> | |||||
<key>cell</key> | |||||
<string>PSGroupCell</string> | |||||
<key>label</key> | |||||
<string>Classic Dock (for notched devices)</string> | |||||
</dict> | |||||
<dict> | |||||
<key>cell</key> | |||||
<string>PSSwitchCell</string> | |||||
<key>default</key> | |||||
<false/> | |||||
<key>defaults</key> | |||||
<string>com.exoticswingset.truthfuldockprefs</string> | |||||
<key>key</key> | |||||
<string>classicDockEnabled</string> | |||||
<key>label</key> | |||||
<string>Enabled</string> | |||||
</dict> | |||||
<dict> | |||||
<key>cell</key> | |||||
<string>PSGroupCell</string> | |||||
<key>label</key> | |||||
<string>Custom Dock Opacity</string> | |||||
</dict> | |||||
<dict> | |||||
<key>cell</key> | |||||
<string>PSSliderCell</string> | |||||
<key>default</key> | |||||
<real>0</real> | |||||
<key>defaults</key> | |||||
<string>com.exoticswingset.truthfuldockprefs</string> | |||||
<key>key</key> | |||||
<string>alphaValue</string> | |||||
<key>min</key> | |||||
<real>0</real> | |||||
<key>max></key> | |||||
<real>1</real> | |||||
<key>showValue</key> | |||||
<true/> | |||||
<key>label</key> | |||||
<string>Set Dock Opacity</string> | |||||
</dict> | |||||
<dict> | |||||
<key>cell</key> | |||||
<string>PSGroupCell</string> | |||||
<key>label</key> | |||||
<string>Save Settings</string> | |||||
</dict> | |||||
<dict> | |||||
<key>cell</key> | |||||
<string>PSButtonCell</string> | |||||
<key>label</key> | |||||
<string>Respring</string> | |||||
<key>action</key> | |||||
<string>respring</string> | |||||
</dict> | |||||
</array> | |||||
<key>title</key> | |||||
<string>TruthfulDock</string> | |||||
</dict> | |||||
</plist> |
#import <Preferences/PSListController.h> | |||||
@interface TDPRootListController : PSListController | |||||
@end |
#include "TDPRootListController.h" | |||||
#import <spawn.h> | |||||
@implementation TDPRootListController | |||||
- (NSArray *)specifiers { | |||||
if (!_specifiers) { | |||||
_specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self]; | |||||
} | |||||
return _specifiers; | |||||
} | |||||
- (void)respring | |||||
{ | |||||
pid_t pid; | |||||
int status; | |||||
const char* args[] = {"killall", "-9", "backboardd", NULL}; | |||||
posix_spawn(&pid, "/usr/bin/killall", NULL, NULL, (char* const*)args, NULL); | |||||
waitpid(pid, &status, WEXITED); | |||||
} | |||||
@end |
<?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>TruthfulDockPrefs</string> | |||||
<key>cell</key> | |||||
<string>PSLinkCell</string> | |||||
<key>detail</key> | |||||
<string>TDPRootListController</string> | |||||
<key>icon</key> | |||||
<string>icon.png</string> | |||||
<key>isController</key> | |||||
<true/> | |||||
<key>label</key> | |||||
<string>TruthfulDockPrefs</string> | |||||
</dict> | |||||
</dict> | |||||
</plist> |