diff --git a/Makefile b/Makefile
index 3f5103d..e4975bd 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
INSTALL_TARGET_PROCESSES = SpringBoard
-ARCHS = armv7 armv7s arm64 arm64e
+ARCHS = arm64e arm64 armv7 armv7s
include ~/theos/makefiles/common.mk
TWEAK_NAME = TruthfulDock
@@ -8,3 +8,5 @@ TruthfulDock_FILES = Tweak.x
TruthfulDock_CFLAGS = -fobjc-arc
include ~/theos/makefiles/tweak.mk
+SUBPROJECTS += truthfuldockprefs
+include $(THEOS_MAKE_PATH)/aggregate.mk
diff --git a/Tweak.x b/Tweak.x
index e9c432c..4ad42e4 100644
--- a/Tweak.x
+++ b/Tweak.x
@@ -1,5 +1,28 @@
%hook SBDockView
+
-(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
\ No newline at end of file
diff --git a/control b/control
index dbe9f24..0aa8e7a 100644
--- a/control
+++ b/control
@@ -1,7 +1,7 @@
Package: com.exoticswingset.truthfuldock
Name: TruthfulDock
Depends: mobilesubstrate
-Version: 0.0.2
+Version: 2.0
Architecture: iphoneos-arm
Description: An awesome MobileSubstrate tweak!
Maintainer: ExoticSwingset
diff --git a/truthfuldockprefs/Makefile b/truthfuldockprefs/Makefile
new file mode 100644
index 0000000..e38d255
--- /dev/null
+++ b/truthfuldockprefs/Makefile
@@ -0,0 +1,15 @@
+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)
diff --git a/truthfuldockprefs/Resources/Info.plist b/truthfuldockprefs/Resources/Info.plist
new file mode 100644
index 0000000..e4a3c7b
--- /dev/null
+++ b/truthfuldockprefs/Resources/Info.plist
@@ -0,0 +1,24 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleExecutable
+ TruthfulDockPrefs
+ CFBundleIdentifier
+ com.exoticswingset.truthfuldockprefs
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundlePackageType
+ BNDL
+ CFBundleShortVersionString
+ 1.0.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1.0
+ NSPrincipalClass
+ TDPRootListController
+
+
diff --git a/truthfuldockprefs/Resources/Root.plist b/truthfuldockprefs/Resources/Root.plist
new file mode 100644
index 0000000..394c3aa
--- /dev/null
+++ b/truthfuldockprefs/Resources/Root.plist
@@ -0,0 +1,93 @@
+
+
+
+
+ items
+
+
+ cell
+ PSGroupCell
+ label
+ General
+
+
+
+ cell
+ PSSwitchCell
+ default
+
+ defaults
+ com.exoticswingset.truthfuldockprefs
+ key
+ isTweakEnabled
+ label
+ Enabled
+
+
+
+ cell
+ PSGroupCell
+ label
+ Classic Dock (for notched devices)
+
+
+
+ cell
+ PSSwitchCell
+ default
+
+ defaults
+ com.exoticswingset.truthfuldockprefs
+ key
+ classicDockEnabled
+ label
+ Enabled
+
+
+
+ cell
+ PSGroupCell
+ label
+ Custom Dock Opacity
+
+
+
+ cell
+ PSSliderCell
+ default
+ 0
+ defaults
+ com.exoticswingset.truthfuldockprefs
+ key
+ alphaValue
+ min
+ 0
+ max>
+ 1
+ showValue
+
+ label
+ Set Dock Opacity
+
+
+
+ cell
+ PSGroupCell
+ label
+ Save Settings
+
+
+
+ cell
+ PSButtonCell
+ label
+ Respring
+ action
+ respring
+
+
+
+ title
+ TruthfulDock
+
+
diff --git a/truthfuldockprefs/TDPRootListController.h b/truthfuldockprefs/TDPRootListController.h
new file mode 100644
index 0000000..478fbdf
--- /dev/null
+++ b/truthfuldockprefs/TDPRootListController.h
@@ -0,0 +1,5 @@
+#import
+
+@interface TDPRootListController : PSListController
+
+@end
diff --git a/truthfuldockprefs/TDPRootListController.m b/truthfuldockprefs/TDPRootListController.m
new file mode 100644
index 0000000..7a97e0a
--- /dev/null
+++ b/truthfuldockprefs/TDPRootListController.m
@@ -0,0 +1,23 @@
+#include "TDPRootListController.h"
+#import
+
+@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
diff --git a/truthfuldockprefs/entry.plist b/truthfuldockprefs/entry.plist
new file mode 100644
index 0000000..d033770
--- /dev/null
+++ b/truthfuldockprefs/entry.plist
@@ -0,0 +1,21 @@
+
+
+
+
+ entry
+
+ bundle
+ TruthfulDockPrefs
+ cell
+ PSLinkCell
+ detail
+ TDPRootListController
+ icon
+ icon.png
+ isController
+
+ label
+ TruthfulDockPrefs
+
+
+