The source code, duh.
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

132 líneas
6.9KB

  1. #line 1 "Tweak.x"
  2. #include <UIKit/UIKit.h>
  3. #import <SpringBoard/SpringBoard.h>
  4. #import "dockifyHeaders.h"
  5. #import <Cephei/HBPreferences.h>
  6. static BOOL transparent;
  7. static BOOL hidden;
  8. static double setHeight;
  9. static double customOpacity;
  10. static NSInteger setIconNumber;
  11. @implementation SBDockIconListView
  12. @synthesize minimumNumberOfIconsToDistributeEvenlyToEdges=_minimumNumberOfIconsToDistributeEvenlyToEdges;
  13. @end
  14. HBPreferences *preferences;
  15. #include <substrate.h>
  16. #if defined(__clang__)
  17. #if __has_feature(objc_arc)
  18. #define _LOGOS_SELF_TYPE_NORMAL __unsafe_unretained
  19. #define _LOGOS_SELF_TYPE_INIT __attribute__((ns_consumed))
  20. #define _LOGOS_SELF_CONST const
  21. #define _LOGOS_RETURN_RETAINED __attribute__((ns_returns_retained))
  22. #else
  23. #define _LOGOS_SELF_TYPE_NORMAL
  24. #define _LOGOS_SELF_TYPE_INIT
  25. #define _LOGOS_SELF_CONST
  26. #define _LOGOS_RETURN_RETAINED
  27. #endif
  28. #else
  29. #define _LOGOS_SELF_TYPE_NORMAL
  30. #define _LOGOS_SELF_TYPE_INIT
  31. #define _LOGOS_SELF_CONST
  32. #define _LOGOS_RETURN_RETAINED
  33. #endif
  34. @class SBDockView; @class SBDockIconListView;
  35. static void (*_logos_orig$_ungrouped$SBDockView$setBackgroundAlpha$)(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST, SEL, double); static void _logos_method$_ungrouped$SBDockView$setBackgroundAlpha$(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST, SEL, double); static double (*_logos_orig$_ungrouped$SBDockView$dockHeight)(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST, SEL); static double _logos_method$_ungrouped$SBDockView$dockHeight(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST, SEL); static double (*_logos_orig$_ungrouped$SBDockView$defaultHeight)(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST, SEL); static double _logos_method$_ungrouped$SBDockView$defaultHeight(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST, SEL); static NSInteger (*_logos_meta_orig$_ungrouped$SBDockIconListView$maxIcons)(_LOGOS_SELF_TYPE_NORMAL Class _LOGOS_SELF_CONST, SEL); static NSInteger _logos_meta_method$_ungrouped$SBDockIconListView$maxIcons(_LOGOS_SELF_TYPE_NORMAL Class _LOGOS_SELF_CONST, SEL); static unsigned long long (*_logos_orig$_ungrouped$SBDockIconListView$maximumIconCount)(_LOGOS_SELF_TYPE_NORMAL SBDockIconListView* _LOGOS_SELF_CONST, SEL); static unsigned long long _logos_method$_ungrouped$SBDockIconListView$maximumIconCount(_LOGOS_SELF_TYPE_NORMAL SBDockIconListView* _LOGOS_SELF_CONST, SEL); static unsigned long long (*_logos_orig$_ungrouped$SBDockIconListView$minimumNumberOfIconsToDistributeEvenlyToEdges)(_LOGOS_SELF_TYPE_NORMAL SBDockIconListView* _LOGOS_SELF_CONST, SEL); static unsigned long long _logos_method$_ungrouped$SBDockIconListView$minimumNumberOfIconsToDistributeEvenlyToEdges(_LOGOS_SELF_TYPE_NORMAL SBDockIconListView* _LOGOS_SELF_CONST, SEL);
  36. #line 26 "Tweak.x"
  37. static void _logos_method$_ungrouped$SBDockView$setBackgroundAlpha$(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd, double arg1) {
  38. if (transparent == NO && hidden == NO) {
  39. _logos_orig$_ungrouped$SBDockView$setBackgroundAlpha$(self, _cmd, customOpacity);
  40. }else if (transparent || hidden) {
  41. _logos_orig$_ungrouped$SBDockView$setBackgroundAlpha$(self, _cmd, 0.0);
  42. } else {
  43. NSLog(@"Dock not Transparent/hidden, no custom opacity\n");
  44. }
  45. }
  46. static double _logos_method$_ungrouped$SBDockView$dockHeight(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd) {
  47. if (hidden) {
  48. return (0);
  49. } else {
  50. return (_logos_orig$_ungrouped$SBDockView$dockHeight(self, _cmd)*setHeight);
  51. }
  52. }
  53. static double _logos_method$_ungrouped$SBDockView$defaultHeight(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd) {
  54. if (hidden) {
  55. return (0);
  56. } else {
  57. return (_logos_orig$_ungrouped$SBDockView$defaultHeight(self, _cmd)*setHeight);
  58. }
  59. }
  60. static NSInteger _logos_meta_method$_ungrouped$SBDockIconListView$maxIcons(_LOGOS_SELF_TYPE_NORMAL Class _LOGOS_SELF_CONST __unused self, SEL __unused _cmd) {
  61. if (hidden) {
  62. return (0);
  63. } else {
  64. return (setIconNumber);
  65. }
  66. }
  67. static unsigned long long _logos_method$_ungrouped$SBDockIconListView$maximumIconCount(_LOGOS_SELF_TYPE_NORMAL SBDockIconListView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd) {
  68. if (hidden) {
  69. return (0);
  70. } else {
  71. return (setIconNumber);
  72. }
  73. }
  74. static unsigned long long _logos_method$_ungrouped$SBDockIconListView$minimumNumberOfIconsToDistributeEvenlyToEdges(_LOGOS_SELF_TYPE_NORMAL SBDockIconListView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd) {
  75. return(3);
  76. }
  77. static __attribute__((constructor)) void _logosLocalCtor_a036efd8(int __unused argc, char __unused **argv, char __unused **envp) {
  78. preferences = [[HBPreferences alloc] initWithIdentifier:@"com.burritoz.dockifyprefs"];
  79. [preferences registerDefaults:@{
  80. @"setHeight": @1,
  81. @"customOpacity": @1,
  82. @"hidden": @NO,
  83. }];
  84. [preferences registerBool:&transparent default:YES forKey:@"transparent"];
  85. [preferences registerBool:&hidden default:NO forKey:@"hidden"];
  86. [preferences registerDouble:(double *)&setHeight default:1 forKey:@"setHeight"];
  87. [preferences registerDouble:(double *)&customOpacity default:1 forKey:@"customOpacity"];
  88. [preferences registerInteger:(NSInteger *)&setIconNumber default:4 forKey:@"setIconNumber"];
  89. }
  90. static __attribute__((constructor)) void _logosLocalInit() {
  91. {Class _logos_class$_ungrouped$SBDockView = objc_getClass("SBDockView"); MSHookMessageEx(_logos_class$_ungrouped$SBDockView, @selector(setBackgroundAlpha:), (IMP)&_logos_method$_ungrouped$SBDockView$setBackgroundAlpha$, (IMP*)&_logos_orig$_ungrouped$SBDockView$setBackgroundAlpha$);MSHookMessageEx(_logos_class$_ungrouped$SBDockView, @selector(dockHeight), (IMP)&_logos_method$_ungrouped$SBDockView$dockHeight, (IMP*)&_logos_orig$_ungrouped$SBDockView$dockHeight);MSHookMessageEx(_logos_class$_ungrouped$SBDockView, @selector(defaultHeight), (IMP)&_logos_method$_ungrouped$SBDockView$defaultHeight, (IMP*)&_logos_orig$_ungrouped$SBDockView$defaultHeight);Class _logos_class$_ungrouped$SBDockIconListView = objc_getClass("SBDockIconListView"); Class _logos_metaclass$_ungrouped$SBDockIconListView = object_getClass(_logos_class$_ungrouped$SBDockIconListView); MSHookMessageEx(_logos_metaclass$_ungrouped$SBDockIconListView, @selector(maxIcons), (IMP)&_logos_meta_method$_ungrouped$SBDockIconListView$maxIcons, (IMP*)&_logos_meta_orig$_ungrouped$SBDockIconListView$maxIcons);MSHookMessageEx(_logos_class$_ungrouped$SBDockIconListView, @selector(maximumIconCount), (IMP)&_logos_method$_ungrouped$SBDockIconListView$maximumIconCount, (IMP*)&_logos_orig$_ungrouped$SBDockIconListView$maximumIconCount);MSHookMessageEx(_logos_class$_ungrouped$SBDockIconListView, @selector(minimumNumberOfIconsToDistributeEvenlyToEdges), (IMP)&_logos_method$_ungrouped$SBDockIconListView$minimumNumberOfIconsToDistributeEvenlyToEdges, (IMP*)&_logos_orig$_ungrouped$SBDockIconListView$minimumNumberOfIconsToDistributeEvenlyToEdges);} }
  92. #line 103 "Tweak.x"