The source code, duh.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.5KB

  1. //I looked at Kritanta's "Home Plus" tweak for help with ios13 stuff. I DID NOT
  2. //copy anything, at least knowingly because these tweaks are simillar, please
  3. //understand the code may be simillar becuase we are doing similar things.
  4. //I am liscensing this under MIT, anyone can use anything they need to from here
  5. #include <UIKit/UIKit.h>
  6. #import <Cephei/HBPreferences.h>
  7. @interface SBDockView
  8. @property (nonatomic, assign) double dockHeight;
  9. @end
  10. @interface SBDockIconListView
  11. @end
  12. @interface SBIconListView
  13. @end
  14. @interface SBRootIconListView : UIView
  15. + (NSInteger)iconColumnsForInterfaceOrientation;
  16. @end
  17. @interface SBDockIconListView : SBRootIconListView
  18. @end
  19. //Set up variables for use with Cephei
  20. static BOOL transparent;
  21. static BOOL hidden;
  22. static double setHeight;
  23. static double customOpacity;
  24. static NSInteger setIconNumber;
  25. HBPreferences *preferences;
  26. //hook the dock
  27. %hook SBDockView
  28. //this deals with everything adjusting opacity/transparency
  29. //ios 12 and 13
  30. -(void)setBackgroundAlpha:(double)arg1 {
  31. if (transparent == NO && hidden == NO) { //if not transparent and not hidden
  32. %orig(customOpacity);
  33. }else if (transparent || hidden) { // Note: || means or in objc
  34. %orig(0.0); //hides background of the dock (transparent)
  35. } else {
  36. NSLog(@"Dock not Transparent/hidden, no custom opacity\n");
  37. }
  38. }
  39. //ios 12
  40. -(double)dockHeight {
  41. return (%orig*setHeight); //sets custom height if dock is not set to hidden
  42. }
  43. //ios 13
  44. +(double)defaultHeight {
  45. return (%orig*setHeight); //sets custom height if dock is not set to hidden
  46. }
  47. %end
  48. %hook SBDockIconListView
  49. //ios 12
  50. +(NSInteger)maxIcons {
  51. if (hidden) {
  52. return (0);
  53. } else {
  54. return (setIconNumber);
  55. }
  56. }
  57. //ios13
  58. %end
  59. %ctor {
  60. preferences = [[HBPreferences alloc] initWithIdentifier:@"com.burritoz.dockifyprefs"];
  61. [preferences registerDefaults:@{ //defaults for prefernces
  62. @"setHeight": @1,
  63. @"customOpacity": @1,
  64. @"hidden": @NO,
  65. @"setIconNumber": @4,
  66. }];
  67. [preferences registerBool:&transparent default:YES forKey:@"transparent"]; //registering transparent as a Boolean
  68. [preferences registerBool:&hidden default:NO forKey:@"hidden"]; //registering hidden as a Boolean
  69. [preferences registerDouble:(double *)&setHeight default:1 forKey:@"setHeight"]; //registering setHeigt as a double (number)
  70. [preferences registerDouble:(double *)&customOpacity default:1 forKey:@"customOpacity"]; //registering customOpacity as a double (number)
  71. [preferences registerInteger:(NSInteger *)&setIconNumber default:4 forKey:@"setIconNumber"]; //Integer of how many icons to allow
  72. }