The source code, duh.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

126 行
5.8KB

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