-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tweak.xm
782 lines (634 loc) · 19.5 KB
/
Tweak.xm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
#import <UIKit/UIKit.h>
#import "Headers/IMTypingIndicatorLayer.h"
#import "Headers/CKConversationListStandardCell.h"
#import "Headers/CKColoredBalloonView.h"
#import "Headers/CKConversationListTableView.h"
#import "Headers/CKLabel.h"
#import "Headers/CKTranscriptCollectionViewController.h"
#import "Headers/CKBalloonView.h"
#import "Headers/CKUITheme.h"
#import "Headers/LPTheme.h"
#import "Headers/LPLinkView.h"
#import "Headers/LPImageView.h"
#import "Headers/CKMessageEntryView.h"
#import "Hue.h"
#import "Themes/HueThemeDark.h"
#import "Themes/HueThemeStyle.h"
#import "Themes/HueThemeBlack.h"
#import "Headers/CKConversationListController.h"
// Transparent Background
#import "Headers/SMSApplication.h"
#import "Headers/CKMessagesController.h"
// Contact Specific Themes
#import <ChatKit/CKConversation.h>
#import "Headers/CKConversationList.h"
// Pin
// #import "Headers/UITableViewRowAction.h"
/*
- Selecting Conversations to delete messages looks all fucked
- going horizontal in chat then going back makes the navbar go back to white (leave chat window to fix)
- Once and awhile a balloon will use the theme color instead of the user defined one (this is because
when a contact theme convo is opened first, it will keep that recipient color without updating, even
though, CKUITheme calls the gray_bubbleColors and it goes to the right color)
- Apple's pin integration will open the wrong convo if the user clicks on the convo before the compose button is done animating
*/
/*
https://stackoverflow.com/questions/3924446/long-press-on-uitableview
*/
%group HueStyle
/*
UIBackgroundStyleDefault,
UIBackgroundStyleTransparent,
UIBackgroundStyleLightBlur,
UIBackgroundStyleDarkBlur,
UIBackgroundStyleDarkTranslucent
*/
// Transparent Background
%hook SMSApplication
- (BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
BOOL result = %orig;
NSString *style = [Hue style]; // @"style_none", @"style_trap", @"style_light", @"style_dark", @"style_tral"
if ([style isEqualToString:@"style_trap"]) {
[application _setBackgroundStyle:UIBackgroundStyleTransparent];
} else if ([style isEqualToString:@"style_light"]) {
[application _setBackgroundStyle:UIBackgroundStyleLightBlur];
} else if ([style isEqualToString:@"style_dark"]) { // For some reason it is not a dark blur
[application _setBackgroundStyle:UIBackgroundStyleDarkBlur];
} else if ([style isEqualToString:@"style_tral"]) {
[application _setBackgroundStyle:UIBackgroundStyleDarkTranslucent];
}
UIWindow *window = MSHookIvar<UIWindow*>(application, "_window");
[window setBackgroundColor:[UIColor clearColor]];
[window setOpaque:NO];
return result;
}
- (void) _setBackgroundStyle:(UIBackgroundStyle)style {
%orig(style);
}
%end
%hook CKMessagesController
- (void) viewDidLoad {
%orig;
[self.view setOpaque:NO];
[self.view setBackgroundColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.1]]; // alpha of 0 will make is not able to register touches
}
%end
// Fix Search Results being unreadable
%hook UISearchController
- (void) viewDidLoad {
%orig;
UIBlurEffectStyle style = [[Hue theme] isEqual:@"theme_stock"] ? UIBlurEffectStyleLight : UIBlurEffectStyleDark;
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:style];
UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
blurEffectView.frame = self.view.bounds;
blurEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.view insertSubview:blurEffectView atIndex:0];
}
%end
// Hide list before seguing
%hook CKConversationListController
- (void) viewWillAppear:(BOOL)arg1 {
%orig;
if (self.view) {
[self.view setHidden:NO];
}
}
- (void) viewWillDisappear:(BOOL)arg1 {
%orig;
if (self.view) {
[self.view setHidden:YES];
}
}
%end
%end // End of HueStyle group
%group HueTheme
// Set Themes
%hook CKUIBehaviorPhone
- (id) theme {
NSString *currentTheme = [Hue theme];
if ([currentTheme isEqual:@"theme_dark"]) {
HueThemeDark *theme = [[%c(HueThemeDark) alloc] init];
return theme;
} else if ([currentTheme isEqual:@"theme_black"]) {
HueThemeBlack *theme = [[%c(HueThemeBlack) alloc] init];
return theme;
}
if ([Hue enableStyle]) { // Stock Transparent
HueThemeStyle *theme = [[%c(HueThemeStyle) alloc] init];
return theme;
}
return %orig; // Stock
}
%end
%hook CKUIBehaviorPad
- (id) theme {
NSString *currentTheme = [Hue theme];
if ([currentTheme isEqual:@"theme_dark"]) {
HueThemeDark *theme = [[%c(HueThemeDark) alloc] init];
return theme;
} else if ([currentTheme isEqual:@"theme_black"]) {
HueThemeBlack *theme = [[%c(HueThemeBlack) alloc] init];
return theme;
}
if ([Hue enableStyle]) { // Stock Transparent
HueThemeStyle *theme = [[%c(HueThemeStyle) alloc] init];
return theme;
}
return %orig; // Stock
}
%end
// Makes it render as a template so a tintColor can be used
%hook CKConversationListStandardCell
- (void) updateUnreadIndicatorWithImage:(UIImage*)arg1 {
UIImage *replacement = [arg1 imageWithRenderingMode:2];
%orig(replacement);
}
%end
// Composing new message NavBar title color
%hook CKNavigationBarCanvasView
- (void) setTitleView:(UIView*)title {
if ([title isKindOfClass:[UILabel class]]) {
NSString *theme = [Hue theme];
if ([theme isEqual:@"theme_dark"] || [theme isEqual:@"theme_black"]) {
UILabel *label = (UILabel*)title;
[label setTextColor:[UIColor whiteColor]];
%orig(label);
} else {
%orig;
}
} else {
%orig;
}
}
%end
/*
%hook CKNavigationController
// Set to true if not translucent
- (BOOL) extendedLayoutIncludesOpaqueBars {
return YES;
}
%end
%hook CKAvatarNavigationBar
- (BOOL) isTranslucent {
return NO;
}
%end
%hook CKMessagesController
// Set to true if not translucent
- (BOOL) extendedLayoutIncludesOpaqueBars {
return YES;
}
%end
*/
/*
%hook CKAvatarNavigationBar
// - (bool) isTranslucent {
// // return ![[Hue theme] isEqual:@"theme_black"];
// return NO;
// }
// - (id) shadowImage {
// return [[UIImage alloc] init];
// }
// - (void)_setHidesShadow:(bool)arg1 {
// %orig(YES);
// }
%end
*/
%hook CKMessageEntryView
// 0 = white, transparent
// 1 = dark, unreadable, transparent
// 2 = dark, readable, transparent
// 4 = default
- (void) setStyle:(long long)arg1 {
NSString *theme = [Hue theme];
if ([theme isEqual:@"theme_dark"] || [theme isEqual:@"theme_black"]) {
%orig(2);
} else {
%orig;
}
}
- (void) layoutSubviews {
%orig;
self.contentClipView.backgroundColor = [UIColor clearColor];
}
%end
// Bar the the bottom of the screen when deleting conversations
%hook UIToolbar
// 0 = white (default)
- (NSInteger) barStyle {
NSString *theme = [Hue theme];
return ([theme isEqual:@"theme_dark"] || [theme isEqual:@"theme_black"]) ? 1 : 0;
}
%end
%hook CKAvatarTitleCollectionReusableView
// 1 = gray, 2 = white, 4 = black (default)
- (void) setStyle:(int)style {
NSString *theme = [Hue theme];
if ([theme isEqual:@"theme_dark"] || [theme isEqual:@"theme_black"]) {
%orig(2);
} else {
%orig;
}
}
%end
%end // End of HueTheme Group
%group HueOutline
// Unfilled bubbles do no work with gradients
%hook CKColoredBalloonView
- (bool) isFilled {
return NO;
}
- (bool) wantsSkinnyMask {
return NO;
}
- (bool) hasBackground {
return NO;
}
- (bool) wantsGradient {
return NO;
}
%end
// fixes app bubbles being invisible
%hook CKTranscriptPluginColoredBalloonView
- (bool) isFilled {
return YES;
}
%end
%end // End of HueOutline Group
%group HueBubbles
// Theme Links and App bubbles
%hook LPTheme
- (id) backgroundColor {
NSString *theme = [Hue theme];
// TODO: Reimplement Contact Theme for reciever bubbles [these work fine]
/*if ([Hue contactHasTheme]) {
return [[Hue contactRecvrBubble] firstObject];
} else*/ if ([Hue useCustomColors]) {
return [[Hue recColor] firstObject];
} else if ([theme isEqual:@"theme_dark"] || [theme isEqual:@"theme_black"]) {
return [UIColor grayColor];
} else {
return %orig;
}
}
// - (id) highlightColor {
// return [UIColor purpleColor];
// }
- (id) mediaBackgroundColor {
NSString *theme = [Hue theme];
// TODO: Reimplement Contact Theme for reciever bubbles [these work fine]
/*if ([Hue contactHasTheme]) {
return [[Hue contactRecvrBubble] firstObject];
} else*/ if ([Hue useCustomColors]) {
return [[Hue recColor] firstObject];
} else if ([theme isEqual:@"theme_dark"] || [theme isEqual:@"theme_black"]) {
return [UIColor grayColor];
} else {
return %orig;
}
}
%end
%hook LPTapToLoadViewStyle
- (id) backgroundColor {
NSString *theme = [Hue theme];
// TODO: Reimplement Contact Theme for reciever bubbles [these work fine]
/*if ([Hue contactHasTheme]) {
return [[Hue contactRecvrBubble] firstObject];
} else*/ if ([Hue useCustomColors]) {
return [[Hue recColor] firstObject];
} else if ([theme isEqual:@"theme_dark"] || [theme isEqual:@"theme_black"]) {
return [UIColor lightGrayColor];
} else {
return %orig;
}
}
%end
%hook LPTextViewStyle
- (id) color {
NSString *theme = [Hue theme];
// TODO: Reimplement Contact Theme for reciever bubbles [these work fine]
/*if ([Hue contactHasTheme]) {
return [Hue contactRecvrText];
} else*/ if ([Hue useCustomColors]) {
return [Hue recTextColor];
} else if ([theme isEqual:@"theme_dark"] || [theme isEqual:@"theme_black"]) {
return [UIColor whiteColor];
} else {
return %orig;
}
}
%end
// Typing Indicator
%hook IMTypingIndicatorLayer
- (id) bubbleColor {
NSString *theme = [Hue theme];
// TODO: Reimplement Contact Theme for reciever bubbles [these work fine]
/*if ([Hue contactHasTheme]) {
return [[Hue contactRecvrBubble] firstObject];
} else */ if ([Hue useCustomColors]) {
return [[Hue recColor] firstObject];
} else if ([theme isEqual:@"theme_dark"] || [theme isEqual:@"theme_black"]) {
return [UIColor grayColor];
} else {
return %orig;
}
}
- (id) thinkingDotColor {
NSString *theme = [Hue theme];
// TODO: Reimplement Contact Theme for reciever bubbles [these work fine]
/*if ([Hue contactHasTheme]) {
return [Hue contactRecvrText];
} else*/ if ([Hue useCustomColors]) {
return [Hue recTextColor];
} else if ([theme isEqual:@"theme_dark"] || [theme isEqual:@"theme_black"]) {
return [UIColor whiteColor];
} else {
return %orig;
}
}
%end
// Change the "To:" text color when composing a new message
%hook MFHeaderLabelView
+ (id) _defaultColor {
NSString *theme = [Hue theme];
return ([theme isEqual:@"theme_dark"] || [theme isEqual:@"theme_black"]) ? [UIColor whiteColor] : %orig;
}
%end
%hook MFModernAtomView
// iMessage
+ (id) _defaultTintColor {
id tint = [[Hue imSenderColors] lastObject];
return [Hue useCustomColors] ? tint : %orig;
}
+ (id) _SMSTintColor {
id tint = [[Hue smsSenderColors] lastObject];
return [Hue useCustomColors] ? tint : %orig;
}
%end
%hook CKConversationListController
-(void) viewDidLoad {
%orig;
// [self.navigationController.navigationBar setTranslucent:NO];
// self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];
// self.extendedLayoutIncludesOpaqueBars = YES;
}
%end
%hook CKTranscriptCollectionViewController
- (void) viewDidLoad {
%orig;
// self.extendedLayoutIncludesOpaqueBars = NO;
}
%end
%end // End of HueBubbles Group
// doesnt work
// %hook CKEditableCollectionViewCell
// - (void) setCheckmark:(UIImageView*)check {
// UIImage *replacement = [[check image] imageWithRenderingMode:2];
// [check setImage:replacement];
// %orig(check);
// }
// %end
/*CNContactHeaderDisplayView
avatarStyle
0 = circle
1 = rounded rect
name label text color needs to be changed
background of tableview needs to be changed
*/
// Background colors dont change, but the separatorColor does
/*
static UIColor *bgColor = [UIColor colorWithRed:0.11 green:0.11 blue:0.11 alpha:1.0];
%hook CNContactView
- (id) backgroundColor {
return bgColor;
}
- (id) sectionBackgroundColor {
return bgColor;
}
- (id) selectedCellBackgroundColor {
return bgColor;
}
- (id) separatorColor {
return [UIColor clearColor];
}
%end
*/
// Dividers
// [UIColor colorWithRed:(69/255.0) green:(71/255.0) blue:(81/255.0) alpha:1.0];
%group HueContact
%hook CKConversationListController
- (void) tableView:(CKConversationListTableView*)convoList didSelectRowAtIndexPath:(id)arg2 {
CKConversationListStandardCell *cell = [convoList cellForRowAtIndexPath:arg2];
CKLabel *label = MSHookIvar<CKLabel*>(cell, "_fromLabel");
[Hue setContact:label.text];
NSLog(@"[Hue] Opening Chat with %@", [Hue getContact]);
%orig;
}
%end
%hook CKTranscriptCollectionViewController
- (void) viewWillAppear:(BOOL)arg1 {
%orig;
// NSLog(@"[Hue] Appearing... reload the bad boi");
// [self.collectionView reloadData];
// [self reloadData];
// [self.collectionView layoutSubviews];
}
%end
// %hook CKTranscriptCollectionView
// - (bool) dynamicsDisabled {
// return NO;
// }
// %end
%end // End of HueContact group
// %group HueHide
// %end // End of HueHide group
%group HuePin
// %hook CKConversationListStandardCell
// %property (nonatomic, assign, getter=isPinned) BOOL pinned;
// %new
// - (void) setPinned:(BOOL)pin {
// self.pinned = pin;
// }
// - (id) init {
// if ((self = %orig)) {
// // self.pinned = NO;
// NSLog(@"[Hue] init called");
// [self setPinned:NO];
// }
// return self;
// }
// - (id) init {
// self = %orig;
// self.pinned = NO;
// return self;
// }
// - (void) updateUnreadIndicatorWithImage:(UIImage*)image {
// // CKLabel *label = MSHookIvar<CKLabel*>(self, "_fromLabel");
// // NSString *name = label.text;
// if (self.pinned) {
// // NSLog(@"[Hue] %@ cell is pinned", name);
// %orig([UIImage imageNamed:@"Pinned"]);
// } else {
// // NSLog(@"[Hue] %@ cell isnt pinned", name);
// %orig;
// }
// }
// %end
@interface CKConversation (Hue)
@property (getter=isPinned, nonatomic) bool pinned;
+ (bool) pinnedConversationsEnabled;
- (bool)isPinned;
- (void)setPinned:(bool)arg1;
@end
// %hook CKConversationListStandardCell
// - (void) updateUnreadIndicatorWithImage:(UIImage*)image {
// // CKLabel *label = MSHookIvar<CKLabel*>(self, "_fromLabel");
// // NSString *name = label.text;
// CKConversation *convo = [self conversation];
// if ([convo isPinned]) {
// // NSLog(@"[Hue] %@ cell is pinned", name);
// %orig([UIImage imageNamed:@"Pinned"]);
// } else {
// // NSLog(@"[Hue] %@ cell isnt pinned", name);
// %orig;
// }
// }
// %end
%hook CKConversation
+ (bool) pinnedConversationsEnabled {
return YES;
}
%end
// ISSUE: Opens wrong chat if user pins convo and tries to open it before the Compose button returns
// Wait for compose button to return before allowing cells to be pressed
%hook CKConversationListController
// - (void) viewDidLoad {
// %orig;
// // add long press gesture for hidding?
// }
// - (id) tableView:(CKConversationListTableView*)table trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath*)index {
// if (@available(iOS 11, *)) {
// NSLog(@"[Hue] adding action");
// UISwipeActionsConfiguration *original = %orig;
// // CKConversationListStandardCell *cell = [table cellForRowAtIndexPath:index];
// // CKLabel *label = MSHookIvar<CKLabel*>(cell, "_fromLabel");
// // NSString *name = label.text;
// NSMutableArray *actions = [NSMutableArray arrayWithArray:[original actions]];
// // NSIndexPath *newIndex = [NSIndexPath indexPathForRow:0 inSection:2];
// // NSArray<CKConversation*> convoList = nonPlaceholderConversations;
// CKConversation *current = [self.nonPlaceholderConversations objectAtIndex:index.row];
// NSString *name = [current name];
// // Destroy
// // original = nil;
// // label = nil;
// UIContextualActionHandler pinHandler = ^void (UIContextualAction *action, UIView *source, void (^completionHandler)(BOOL actionPerformed)) {
// NSLog(@"[Hue] Pinning %@", name);
// // [Hue setAttribute:name value:@YES];
// // current.pinned = YES;
// [current setPinned:YES];
// // [table moveRowAtIndexPath:index toIndexPath:newIndex];
// // [cell updateUnreadIndicatorWithImage:[UIImage imageNamed:@"Pinned"]];
// completionHandler(YES);
// };
// UIContextualActionHandler unpinHandler = ^void (UIContextualAction *action, UIView *source, void (^completionHandler)(BOOL actionPerformed)) {
// NSLog(@"[Hue] Unpinning %@", name);
// // [Hue setAttribute:name value:@NO];
// // current.pinned = NO;
// [current setPinned:NO];
// // [cell updateUnreadIndicatorWithImage:[UIImage imageNamed:@"CKWhatsNewViewBulletPoint_Normal"]];
// completionHandler(YES);
// };
// // if ([Hue isPinned:name]) {
// if ([current isPinned]) {
// UIContextualAction *unpinAction = [UIContextualAction contextualActionWithStyle:0 title:@"Unpin" handler:unpinHandler];
// [unpinAction setBackgroundColor:[UIColor orangeColor]];
// [actions addObject:unpinAction];
// } else {
// UIContextualAction *pinAction = [UIContextualAction contextualActionWithStyle:0 title:@"Pin" handler:pinHandler];
// [pinAction setBackgroundColor:[UIColor orangeColor]];
// [actions addObject:pinAction];
// }
// UISwipeActionsConfiguration *config = [UISwipeActionsConfiguration configurationWithActions:actions];
// [config setPerformsFirstActionWithFullSwipe:NO];
// return config;
// }
// return %orig;
// }
// navigationItem.rightBarButtonItem
/*
- (void) setNonPlaceholderConversations:(NSArray*)convos {
NSMutableArray *editable = [NSMutableArray arrayWithArray:convos];
if ([[Hue attributes] count] > 0) {
NSLog(@"[Hue] There are pinned contacts, moving...");
for (CKConversation *convo in convos) {
if ([convo isPinned]) {
[editable removeObject:convo];
[editable insertObject:convo atIndex:0];
}
}
}
%orig(editable);
}
*/
%end
%end // End of HuePin group
// Groupless
%hook CKConversationListTableView
- (id) separatorColor {
return [Hue separatorColor];
}
%end
%ctor {
@autoreleasepool {
NSArray *args = [[NSClassFromString(@"NSProcessInfo") processInfo] arguments];
NSUInteger count = args.count;
if (count != 0) {
NSString *executablePath = args[0];
if (executablePath) {
NSString *processName = [executablePath lastPathComponent];
BOOL isSpringBoard = [processName isEqualToString:@"SpringBoard"];
BOOL isApplication = [executablePath rangeOfString:@"/Application/"].location != NSNotFound || [executablePath rangeOfString:@"/Applications/"].location != NSNotFound;
BOOL isNotif = [processName isEqualToString:@"MessagesNotificationExtension"];
BOOL isSMS = [processName isEqualToString:@"MobileSMS"];
if ((isSpringBoard || isApplication) && (isSMS || isNotif) && [Hue isEnabled]) {
NSLog(@"[Hue] Hue is enabled, injecting into MobileSMS");
%init; // Enable groupless (Seperator color)
// Enable HueTheme Group
if (![[Hue theme] containsString:@"theme_stock"] || [Hue enableStyle]) {
NSLog(@"[Hue] Isn't using Stock theme, enabling HueTheme Group");
%init(HueTheme);
}
// Enable HueBubbles Group
if ([Hue useCustomColors]) {
NSLog(@"[Hue] Using Custom Colors, enabling HueBubbles Group");
%init(HueBubbles);
}
// Enable HueContact Group
%init(HueContact);
// Enable HueOutline Group
if ([Hue useSkinny]) {
NSLog(@"[Hue] Outline bubbles");
%init(HueOutline);
}
// Enable HuePin Group
if (@available(iOS 11, *)) {
if ([Hue enablePin]) {
NSLog(@"[Hue] Enabling Pinning");
%init(HuePin);
}
}
// Disable HueStyle in Notification
if (isNotif) {
NSLog(@"[Hue] In Notification");
[Hue setInNotif:YES];
}
// Enable HueStyle Group
if ([Hue enableStyle] && !isNotif) {
NSLog(@"[Hue] Background style selected, enabling HueStyle Group");
%init(HueStyle);
}
}
}
}
}
}