Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. /* How to Hook with Logos
  2. Hooks are written with syntax similar to that of an Objective-C @implementation.
  3. You don't need to #include <substrate.h>, it will be done automatically, as will
  4. the generation of a class list and an automatic constructor.
  5.  
  6. %hook ClassName
  7.  
  8. // Hooking a class method
  9. + (id)sharedInstance {
  10. return %orig;
  11. }
  12.  
  13. // Hooking an instance method with an argument.
  14. - (void)messageName:(int)argument {
  15. %log; // Write a message about this call, including its class, name and arguments, to the system log.
  16.  
  17. %orig; // Call through to the original function with its original arguments.
  18. %orig(nil); // Call through to the original function with a custom argument.
  19.  
  20. // If you use %orig(), you MUST supply all arguments (except for self and _cmd, the automatically generated ones.)
  21. }
  22.  
  23. // Hooking an instance method with no arguments.
  24. - (id)noArguments {
  25. %log;
  26. id awesome = %orig;
  27. [awesome doSomethingElse];
  28.  
  29. return awesome;
  30. }
  31.  
  32. // Always make sure you clean up after yourself; Not doing so could have grave consequences!
  33. %end
  34. */
  35. #import <UIKit/UIKit.h>
  36. #import <SpringBoard/SpringBoard.h>
  37.  
  38. @interface SBFLockScreenDateView : UIView
  39. @property (nonatomic,retain) UIColor * textColor;
  40. @end
  41. @interface SBLockScreenDateView : UIView
  42. @property (nonatomic,retain) UIColor * textColor;
  43. @end
  44.  
  45. @interface SBIconListView : UIView
  46. @end
  47.  
  48.  
  49.  
  50.  
  51. %hook SBLockScreenDateViewController
  52. -(void)setCustomSubtitleText:(id)arg1 withColor:(id)arg2{
  53. %orig(@β€œTEST”,[UIColor colorWithRed:(188/255.f) green:(188/255.f) blue:(188/255.f) alpha:1.0]);
  54.  
  55.  
  56. }
  57.  
  58. %end
  59.  
  60.  
  61. %hook SBHUDController
  62. -(void)presentHUDView:(UIView*)HUDView autoDismissWithDelay:(CGFloat)delay{
  63. CGRect dimensions = [[UIScreen mainScreen] bounds];
  64. HUDView.frame = dimensions;
  65. %orig;
  66. }
  67. %end
  68. %hook SpringBoard
  69. -(BOOL)isOnAC{
  70.  
  71. return YES; // TRUE
  72. }
  73. -(float)batteryCapacity{
  74. 55.0;
  75. }
  76.  
  77. %end
  78.  
  79. %hook SBDockIconListView
  80. + (NSUInteger)maxIcons {
  81. return 10;
  82. }
  83. %end
  84.  
  85. %hook SBIconListView
  86. +(unsigned long long)maxIcons {
  87.  
  88. return 10;
  89. }
  90. +(unsigned long long)iconRowsForInterfaceOrientation:(long long)arg1{
  91. return 10;
  92. }
  93. -(CGSize)defaultIconSize{
  94. CGSize srcSize = %orig;
  95. srcSize = CGSizeMake(50.0, 100.0);
  96. return srcSize;
  97. }
  98. %end
  99. %hook SBFLockScreenDateView
  100. -(UIColor *)textColor {
  101. return [UIColor colorWithRed:(188/255.f) green:(188/255.f) blue:(188/255.f) alpha:1.0];
  102. }
  103. %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement