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.

Tweak.x.m 3.3KB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #line 1 "Tweak.x"
  2. #import <SpringBoard/SpringBoard.h>
  3. #import <Cephei/HBPreferences.h>
  4. static BOOL transparent;
  5. static BOOL hidden;
  6. static double setHeight;
  7. static double customOpacity;
  8. HBPreferences *preferences;
  9. #include <substrate.h>
  10. #if defined(__clang__)
  11. #if __has_feature(objc_arc)
  12. #define _LOGOS_SELF_TYPE_NORMAL __unsafe_unretained
  13. #define _LOGOS_SELF_TYPE_INIT __attribute__((ns_consumed))
  14. #define _LOGOS_SELF_CONST const
  15. #define _LOGOS_RETURN_RETAINED __attribute__((ns_returns_retained))
  16. #else
  17. #define _LOGOS_SELF_TYPE_NORMAL
  18. #define _LOGOS_SELF_TYPE_INIT
  19. #define _LOGOS_SELF_CONST
  20. #define _LOGOS_RETURN_RETAINED
  21. #endif
  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. @class SBDockView;
  29. 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);
  30. #line 14 "Tweak.x"
  31. static void _logos_method$_ungrouped$SBDockView$setBackgroundAlpha$(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd, double arg1) {
  32. if (transparent == NO && hidden == NO) {
  33. _logos_orig$_ungrouped$SBDockView$setBackgroundAlpha$(self, _cmd, customOpacity);
  34. }else if (transparent || hidden) {
  35. _logos_orig$_ungrouped$SBDockView$setBackgroundAlpha$(self, _cmd, 0.0);
  36. } else {
  37. NSLog(@"Dock not Transparent/hidden, no custom opacity\n");
  38. }
  39. }
  40. static double _logos_method$_ungrouped$SBDockView$dockHeight(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd) {
  41. if (hidden) {
  42. return (-50);
  43. } else {
  44. return (_logos_orig$_ungrouped$SBDockView$dockHeight(self, _cmd)*setHeight);
  45. }
  46. }
  47. static __attribute__((constructor)) void _logosLocalCtor_d1a00f3d(int __unused argc, char __unused **argv, char __unused **envp) {
  48. preferences = [[HBPreferences alloc] initWithIdentifier:@"com.burritoz.dockifyprefs"];
  49. [preferences registerDefaults:@{
  50. @"setHeight": @1,
  51. @"customOpacity": @1,
  52. @"hidden": @NO
  53. }];
  54. [preferences registerBool:&transparent default:YES forKey:@"transparent"];
  55. [preferences registerBool:&hidden default:NO forKey:@"hidden"];
  56. [preferences registerDouble:(double *)&setHeight default:1 forKey:@"setHeight"];
  57. [preferences registerDouble:(double *)&customOpacity default:1 forKey:@"customOpacity"];
  58. }
  59. static __attribute__((constructor)) void _logosLocalInit() {
  60. {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);} }
  61. #line 49 "Tweak.x"