iPhone customization suite
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.
 
 
 
 
 

157 lines
3.4 KiB

  1. // 888 888 888 d8b
  2. // 888 888 888 Y8P
  3. // 888 888 888
  4. // 88888b. 8888b. 88888b. 8888b. 88888b. 8888b. 888 888 888
  5. // 888 "88b "88b 888 "88b "88b 888 "88b "88b 888 .88P 888
  6. // 888 888 .d888888 888 888 .d888888 888 888 .d888888 888888K 888
  7. // 888 888 888 888 888 888 888 888 888 888 888 888 888 "88b 888
  8. // 888 888 "Y888888 888 888 "Y888888 888 888 "Y888888 888 888 888
  9. //
  10. // (c) lillian rose winter 2019-2020 all rights reserved or whateva
  11. #import "Headers.h"
  12. NSString *ctaText = @"hanahaki"; //this is for the custom CTA
  13. %hook NSObject
  14. @interface NSObject (customObject)
  15. - (BOOL)isSettingOn:(NSString *)keyStr;
  16. @end
  17. // grabs preferences
  18. %new
  19. - (BOOL)isSettingOn:(NSString *)keyStr {
  20. const char *keyStrC = [keyStr cStringUsingEncoding:NSUTF8StringEncoding];
  21. CFPreferencesAppSynchronize(CFSTR("toys.lily.hanahakiprefs"));
  22. CFPropertyListRef value = CFPreferencesCopyAppValue(CFStringCreateWithCString(NULL, keyStrC, kCFStringEncodingUTF8), CFSTR("toys.lily.hanahakiprefs"));
  23. NSString *valueString = [NSString stringWithFormat:@"%@", value];
  24. NSString *noVal = @"0";
  25. if ([valueString isEqualToString:noVal]) {
  26. return NO;
  27. }
  28. else {
  29. return YES;
  30. }
  31. }
  32. %end
  33. //DOCK BG
  34. %hook SBDockView
  35. - (void)setBackgroundAlpha:(double)arg1 {
  36. NSObject *object = [[NSObject alloc] init];
  37. BOOL isSettingOn = [object isSettingOn:@"dockbg"];
  38. if (isSettingOn) {
  39. arg1 = 0;
  40. }
  41. else {
  42. arg1 = 1;
  43. }
  44. %orig(arg1);
  45. }
  46. %end
  47. %hook SBFloatingDockPlatterView
  48. - (void)layoutSubviews {
  49. NSObject *object = [[NSObject alloc] init];
  50. BOOL isSettingOn = [object isSettingOn:@"dockbg"];
  51. %orig;
  52. if(isSettingOn) {
  53. self.backgroundView = nil;
  54. }
  55. }
  56. %end
  57. //SCREEN BORDERS
  58. %hook _UIRootWindow
  59. - (void)layoutSubviews {
  60. NSObject *object = [[NSObject alloc] init];
  61. BOOL isSettingOn = [object isSettingOn:@"borders"];
  62. %orig;
  63. if(isSettingOn) {
  64. self._continuousCornerRadius = 10;
  65. self.clipsToBounds = YES;
  66. }
  67. return;
  68. }
  69. %end
  70. //ICON LABELS
  71. %hook SBIconView
  72. - (void)_applyIconLabelAlpha:(double)arg1 {
  73. NSObject *object = [[NSObject alloc] init];
  74. BOOL isSettingOn = [object isSettingOn:@"iconlabels"];
  75. if(isSettingOn) {
  76. arg1 = 0;
  77. }
  78. else {
  79. arg1 = 1;
  80. }
  81. %orig(arg1);
  82. }
  83. - (void)layoutSubviews {
  84. %orig;
  85. NSObject *object = [[NSObject alloc] init];
  86. BOOL isSettingOn = [object isSettingOn:@"iconlabels"];
  87. if (isSettingOn) {
  88. self.iconLabelAlpha = 0;
  89. }
  90. else {
  91. self.iconLabelAlpha = 1;
  92. }
  93. }
  94. %end
  95. %hook SBIconZoomAnimator
  96. - (void)_applyLabelAlphaFraction:(double)arg1 {
  97. NSObject *object = [[NSObject alloc] init];
  98. BOOL isSettingOn = [object isSettingOn:@"iconlabels"];
  99. if(isSettingOn) {
  100. arg1 = 0;
  101. }
  102. else {
  103. arg1 = 1;
  104. }
  105. %orig(arg1);
  106. }
  107. %end
  108. // CUSTOM CALL TO ACTION (press home to unlock)
  109. %hook SBUICallToActionLabel
  110. - (void)setText:(id)arg1 forLanguage:(id)arg2 animated:(bool)arg3 {
  111. NSObject *object = [[NSObject alloc] init];
  112. BOOL isSettingOn = [object isSettingOn:@"customctaction"];
  113. if (isSettingOn) {
  114. NSDictionary *pref = [NSDictionary dictionaryWithContentsOfFile:[NSString stringWithFormat:@"/var/mobile/Library/Preferences/toys.lily.hanahakiprefs.plist"]];
  115. ctaText = [[pref objectForKey:@"customctatext"] stringValue];
  116. return %orig(ctaText, arg2, arg3);
  117. }
  118. else {
  119. return %orig(arg1, arg2, arg3);
  120. }
  121. }
  122. %end