diff --git a/.DS_Store b/.DS_Store index d66b7ec..a82f541 100755 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.theos/_/DEBIAN/control b/.theos/_/DEBIAN/control index b53b921..aca4597 100644 --- a/.theos/_/DEBIAN/control +++ b/.theos/_/DEBIAN/control @@ -3,9 +3,9 @@ Name: Dockify Depends: mobilesubstrate, preferenceloader, com.saurik.substrate.safemode, ws.hbang.common (>=1.13) Conflicts: com.burritoz.testing Architecture: iphoneos-arm -Description: A very noice tweak to configure the dock a bit more... +Description: A very noice tweak to configure the dock a bit more... Lightweight and effective! Maintainer: burrit0z Author: burrit0z Section: Tweaks -Version: 1.2-7+debug -Installed-Size: 356 +Version: 1.2.1 +Installed-Size: 412 diff --git a/.theos/_/Library/PreferenceBundles/dockifyprefs.bundle/Info.plist b/.theos/_/Library/PreferenceBundles/dockifyprefs.bundle/Info.plist index a788427..be135dd 100755 Binary files a/.theos/_/Library/PreferenceBundles/dockifyprefs.bundle/Info.plist and b/.theos/_/Library/PreferenceBundles/dockifyprefs.bundle/Info.plist differ diff --git a/.theos/_/Library/PreferenceBundles/dockifyprefs.bundle/Root.plist b/.theos/_/Library/PreferenceBundles/dockifyprefs.bundle/Root.plist index 0996b5a..8cfaca8 100755 Binary files a/.theos/_/Library/PreferenceBundles/dockifyprefs.bundle/Root.plist and b/.theos/_/Library/PreferenceBundles/dockifyprefs.bundle/Root.plist differ diff --git a/.theos/_/Library/PreferenceBundles/dockifyprefs.bundle/dockifyprefs b/.theos/_/Library/PreferenceBundles/dockifyprefs.bundle/dockifyprefs index 3c0193b..fcf949c 100755 Binary files a/.theos/_/Library/PreferenceBundles/dockifyprefs.bundle/dockifyprefs and b/.theos/_/Library/PreferenceBundles/dockifyprefs.bundle/dockifyprefs differ diff --git a/.theos/_/Library/PreferenceLoader/Preferences/dockifyprefs.plist b/.theos/_/Library/PreferenceLoader/Preferences/dockifyprefs.plist index 37bfd50..472cd12 100755 Binary files a/.theos/_/Library/PreferenceLoader/Preferences/dockifyprefs.plist and b/.theos/_/Library/PreferenceLoader/Preferences/dockifyprefs.plist differ diff --git a/.theos/last_package b/.theos/last_package index b8f2d0f..6b53f59 100755 --- a/.theos/last_package +++ b/.theos/last_package @@ -1 +1 @@ -./packages/com.burritoz.dockify_1.2-7+debug_iphoneos-arm.deb +./packages/com.burritoz.dockify_1.2.1_iphoneos-arm.deb diff --git a/.theos/obj/debug/dockifyprefs.bundle/Root.plist b/.theos/obj/debug/dockifyprefs.bundle/Root.plist index 0996b5a..5a40010 100755 --- a/.theos/obj/debug/dockifyprefs.bundle/Root.plist +++ b/.theos/obj/debug/dockifyprefs.bundle/Root.plist @@ -34,6 +34,18 @@ label Overall Dock Settings: + + cell + PSSwitchCell + default + + defaults + com.burritoz.dockifyprefs + key + tweakEnabled + label + Enable Tweak + cell PSSwitchCell @@ -110,7 +122,7 @@ cell PSGroupCell label - Custom Dock Icons (exact # you want): + Custom Dock Icons (buggy): cell diff --git a/Dockify.x b/Dockify.xm similarity index 62% rename from Dockify.x rename to Dockify.xm index 1857329..465b28a 100755 --- a/Dockify.x +++ b/Dockify.xm @@ -1,11 +1,22 @@ +//Please note, in order to use MSHookIvar, this file needs to be .xm #import +#import @interface SBCoverSheetPrimarySlidingViewController : UIViewController - (void)viewDidDisappear:(BOOL)arg1; - (void)viewDidAppear:(BOOL)arg1; @end +@interface SBIconListGridLayoutConfiguration +@property (nonatomic, assign) NSString *location; + +- (NSString *)findLocation; +- (NSUInteger)numberOfPortraitColumns; +- (NSUInteger)numberOfPortraitRows; +@end + //Set up variables for use with Cephei +static BOOL tweakEnabled; static BOOL transparent; static BOOL hidden; static double setHeight; @@ -13,11 +24,10 @@ static double customOpacity; static NSInteger setIconNumber; //nepeta like drm BOOL dpkgInvalid = NO; -//static NSInteger setDockRowNumber; -//static CGFloat setRowSpacing; HBPreferences *preferences; +%group allVersions %hook SBCoverSheetPrimarySlidingViewController - (void)viewDidDisappear:(BOOL)arg1 { @@ -38,10 +48,19 @@ HBPreferences *preferences; } %end +%end +%group version12 //hook the dock %hook SBDockView - +//ios 12 +-(double)dockHeight { + if (hidden) { + return (0); + } else { + return (%orig*setHeight); //sets custom height if dock is not set to hidden + } +} //this deals with everything adjusting opacity/transparency //ios 12 and 13 -(void)setBackgroundAlpha:(double)arg1 { @@ -53,25 +72,6 @@ HBPreferences *preferences; NSLog(@"Dock not Transparent/hidden, no custom opacity\n"); } } - -//ios 13 --(double)defaultHeight { - if (hidden) { - return (0); - } else { - return (%orig*setHeight); //sets custom height if dock is not set to hidden - } -} - -//ios 12 --(double)dockHeight { - if (hidden) { - return (0); - } else { - return (%orig*setHeight); //sets custom height if dock is not set to hidden - } -} - %end //NEW HOOK FOR ICON STATE @@ -84,51 +84,80 @@ HBPreferences *preferences; return (setIconNumber); } } +%end +%end + +//NEW GROUP FOR ios13 +%group version13 +%hook SBDockView +//ios 13 +-(double)dockHeight { + if (hidden) { + return (0); + } else { + return (%orig*setHeight); //sets custom height if dock is not set to hidden + } +} +//this deals with everything adjusting opacity/transparency +//ios 12 and 13 +-(void)setBackgroundAlpha:(double)arg1 { + if (transparent == NO && hidden == NO) { //if not transparent and not hidden + %orig(customOpacity); + }else if (transparent || hidden) { // Note: || means or in objc + %orig(0.0); //hides background of the dock (transparent) + } else { + NSLog(@"Dock not Transparent/hidden, no custom opacity\n"); + } +} +%end +%hook SBDockIconListView + - (NSUInteger)iconColumnsForCurrentOrientation { if (hidden) { return (0); } else { - NSInteger reg = %orig; - return reg; //basically just returns the original value + return (setIconNumber); } } %end -//ios 13 +//fix for icons being off the page ios 13 %hook SBIconListGridLayoutConfiguration --(void)setNumberOfPortraitColumns:(unsigned long long)arg1 { - if (setIconNumber == 4) { - NSIntegr reg = %orig; - %orig(reg); - } else { - %orig(setIconNumber); - } -} -%end +%property (nonatomic, assign) NSString *location; -%hook SBIconListView -//fix so it doesnt set all pages to 5 columns ios 13 --(unsigned long long)iconColumnsForCurrentOrientation { - return (4); +%new //Modeled off of Kritanta's solution with ivars +- (NSString *)findLocation { + if (self.location) return self.location; + else { + NSUInteger rows = MSHookIvar(self, "_numberOfPortraitRows"); + NSUInteger columns = MSHookIvar(self, "_numberOfPortraitColumns"); + // dock + if (rows <= 2 && columns == 4) { + self.location = @"Dock"; + } else if (rows == 3 && columns == 3) { + self.location = @"Folder"; + } else { + self.location = @"Root"; + } + } + return self.location; } --(BOOL)automaticallyAdjustsLayoutMetricsToFit { - return YES; -} -%end -//fix for icons being off the page ios 13 and maybe 12 -%hook SBIconListFlowLayout -- (NSUInteger)numberOfColumnsForOrientation:(NSInteger)arg1 { - return (4); -} -%end -//another fix for the folders ios12 -%hook SBFolderIconListView -+(unsigned long long)iconColumnsForInterfaceOrientation:(long long)arg1 { - return (4); -} -%end -// Thanks to Nepeta for the DRM, and thanks to Sh0rtflow as well +- (NSUInteger)numberOfPortraitColumns { + [self findLocation]; + if ([self.location isEqualToString:@"Dock"]) { + if (hidden) { + return (0); + } else { + return (setIconNumber); + } + } else { + return (%orig); + } +} +%end +%end +// Thanks to Nepeta for the DRM, and thanks to Litten as well %ctor { dpkgInvalid = ![[NSFileManager defaultManager] fileExistsAtPath:@"/var/lib/dpkg/info/com.burritoz.dockify.list"]; if (!dpkgInvalid) dpkgInvalid = ![[NSFileManager defaultManager] fileExistsAtPath:@"/var/lib/dpkg/info/com.burritoz.dockify.md5sums"]; @@ -136,17 +165,27 @@ HBPreferences *preferences; preferences = [[HBPreferences alloc] initWithIdentifier:@"com.burritoz.dockifyprefs"]; [preferences registerDefaults:@ { //defaults for prefernces + @"tweakEnabled": @YES, @"setHeight": @1, @"customOpacity": @1, @"hidden": @NO, @"setIconNumber": @4, -// @"setRowSpacing": @0, }]; + [preferences registerBool:&tweakEnabled default:YES forKey:@"tweakEnabled"]; [preferences registerBool:&transparent default:YES forKey:@"transparent"]; //registering transparent as a Boolean [preferences registerBool:&hidden default:NO forKey:@"hidden"]; //registering hidden as a Boolean [preferences registerDouble:(double *)&setHeight default:1 forKey:@"setHeight"]; //registering setHeigt as a double (number) [preferences registerDouble:(double *)&customOpacity default:1 forKey:@"customOpacity"]; //registering customOpacity as a double (number) [preferences registerInteger:(NSInteger *)&setIconNumber default:4 forKey:@"setIconNumber"]; //Integer of how many icons to allow -// [preferences registerInteger:(NSInteger *)&setDockRowNumber default:1 forKey:@"setDockRowNumber"]; //Integer of how many dock rows to allow -// [preferences registerFloat:(CGFloat *)&setRowSpacing default:0 forKey:@"setRowSpacing"]; //custom dock row spacing? +if (tweakEnabled) { + %init(allVersions); + if (kCFCoreFoundationVersionNumber < 1600) //This means version < 12 + { + %init(version12); + } + else + { + %init(version13); + } + } } diff --git a/Makefile b/Makefile index e9a64d3..b493814 100755 --- a/Makefile +++ b/Makefile @@ -1,14 +1,19 @@ -ARCHS = arm64 arm64e +ARCHS = armv7s arm64 arm64e +THEOS_DEVICE_IP = 192.168.0.172 INSTALL_TARGET_PROCESSES = SpringBoard include $(THEOS)/makefiles/common.mk TWEAK_NAME = Dockify -Dockify_FILES = Dockify.x +Dockify_FILES = Dockify.xm Dockify_CFLAGS = -fobjc-arc Dockify_EXTRA_FRAMEWORKS += Cephei include $(THEOS_MAKE_PATH)/tweak.mk SUBPROJECTS += dockifyprefs include $(THEOS_MAKE_PATH)/aggregate.mk + +after-install:: + echo "Made by Burrit0z" + echo "Try not. Do or do not. There is no try." diff --git a/README.md b/README.md index 1c18a78..47d951b 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Dockify_Source SOURCE CODE FOR DOCKIFY -**Get it here:** https://burrit0z.github.io/repo -**Compatability:** iOS 8 and up, a12 included -**Source code:** You are looking at it. +## Get it here: https://burrit0z.github.io/repo +## Compatibility: iOS 8 and up, a12 included +## Source code: You are looking at it. diff --git a/control b/control index e816a90..7d18ddc 100755 --- a/control +++ b/control @@ -2,9 +2,9 @@ Package: com.burritoz.dockify Name: Dockify Depends: mobilesubstrate, preferenceloader, com.saurik.substrate.safemode, ws.hbang.common (>=1.13) Conflicts: com.burritoz.testing -Version: 1.2 +Version: 1.2.1 Architecture: iphoneos-arm -Description: A very noice tweak to configure the dock a bit more... +Description: A very noice tweak to configure the dock a bit more... Lightweight and effective! Maintainer: burrit0z Author: burrit0z Section: Tweaks diff --git a/dockifyprefs/Resources/Root.plist b/dockifyprefs/Resources/Root.plist index 0996b5a..5a40010 100755 --- a/dockifyprefs/Resources/Root.plist +++ b/dockifyprefs/Resources/Root.plist @@ -34,6 +34,18 @@ label Overall Dock Settings: + + cell + PSSwitchCell + default + + defaults + com.burritoz.dockifyprefs + key + tweakEnabled + label + Enable Tweak + cell PSSwitchCell @@ -110,7 +122,7 @@ cell PSGroupCell label - Custom Dock Icons (exact # you want): + Custom Dock Icons (buggy): cell diff --git a/dockifyprefs/Resources/notimportant(forlater).txt b/dockifyprefs/Resources/notimportant(forlater).txt deleted file mode 100644 index 577f7eb..0000000 --- a/dockifyprefs/Resources/notimportant(forlater).txt +++ /dev/null @@ -1,53 +0,0 @@ -BACKUP cause im lazy. this is for a future feature - - cell - PSGroupCell - label - Max Dock Rows: - - - cell - PSSliderCell - default - 1 - defaults - com.burritoz.dockifyprefs - key - setDockRowNumber - min - 0 - max - 7 - isSegmented - - segmentCount - 7 - showValue - - - - cell - PSGroupCell - label - Dock Row Spacing - - - cell - PSSliderCell - default - 0 - defaults - com.burritoz.dockifyprefs - key - setRowSpacing - min - 0 - max - 200 - isSegmented - - segmentCount - 200 - showValue - - diff --git a/packages/com.burritoz.dockify_1.2-7+debug_iphoneos-arm.deb b/packages/com.burritoz.dockify_1.2-7+debug_iphoneos-arm.deb deleted file mode 100644 index efd6c0a..0000000 Binary files a/packages/com.burritoz.dockify_1.2-7+debug_iphoneos-arm.deb and /dev/null differ diff --git a/packages/com.burritoz.dockify_1.2-7+debug_iphoneos-arm.deb.zip b/packages/com.burritoz.dockify_1.2-7+debug_iphoneos-arm.deb.zip deleted file mode 100644 index db12565..0000000 Binary files a/packages/com.burritoz.dockify_1.2-7+debug_iphoneos-arm.deb.zip and /dev/null differ diff --git a/packages/com.burritoz.dockify_1.2.1_iphoneos-arm.deb b/packages/com.burritoz.dockify_1.2.1_iphoneos-arm.deb new file mode 100644 index 0000000..0fcc18d Binary files /dev/null and b/packages/com.burritoz.dockify_1.2.1_iphoneos-arm.deb differ