-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathExcitant.xm
executable file
·1189 lines (1043 loc) · 45.6 KB
/
Excitant.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
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#import <UIKit/UIKit.h>
#import <objc/runtime.h>
#import <FrontBoardServices/FBSSystemService.h>
#import <spawn.h>
#import <notify.h>
#import <sys/wait.h>
#import "AppList.h"
#import <Foundation/Foundation.h>
#include <Excitant.h>
#include <libexcitant.h>
//Prefs
@interface NSUserDefaults (Excitant)
- (id)objectForKey:(NSString *)key inDomain:(NSString *)domain;
- (void)setObject:(id)value forKey:(NSString *)key inDomain:(NSString *)domain;
@end
//Define Prefs
static NSString *nsDomainString = @"com.auxilium.excitant";
static NSString *nsNotificationString = @"com.auxilium.excitant/preferences.changed";
/*#define PLIST_PATH @"/var/mobile/Library/Preferences/EXCITANTTAPS.plist"
#define kTapTap (CFStringRef)@"com.auxilium.excitant/preferences.changed"
#define EXCITANTTOUCHES_PATH @"/var/mobile/Library/Preferences/EXCITANTTOUCHES.plist"
#define kVolPath @"/var/mobile/Library/Preferences/com.midnightchips.volume.plist"
#define kHijackSettingsChangedNotification (CFStringRef)@"EXCITANTTOUCHES.plist/saved"
//Testing Lonestar Prefs
#define kIdentifier @"com.midnightchips.volume"
#define kSettingsChangedNotification (CFStringRef)@"com.midnightchips.volume.plist/ReloadPrefs"
#define kSettingsPath @"/var/mobile/Library/Preferences/com.midnightchips.volume.plist"*/
// Status Bar Shit
/*inline bool GetPrefBool(NSString *key) {
return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];
}
inline int GetPrefInt(NSString *key) {
return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] intValue];
}
inline float GetPrefFloat(NSString *key) {
return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] floatValue];
}
//Loading for UIView taps
inline bool GetTouchBool(NSString *key) {
return [[[NSDictionary dictionaryWithContentsOfFile:EXCITANTTOUCHES_PATH] valueForKey:key] boolValue];
}*/
/*inline bool GetVolumeBool(NSString *key) {
return [[[NSDictionary dictionaryWithContentsOfFile:Volume_PATH] valueForKey:key] boolValue];
}
inline float GetTouchFloats(NSString *key) {
return [[[NSDictionary dictionaryWithContentsOfFile:EXCITANTTOUCHES_PATH] valueForKey:key] floatValue];
}*/
static NSString *tapapp;
// End the Status Bar Shit
//HomeHijack Stuff
static NSString *selectedApp; //Applist stuff
static NSString *tapLaunch; //TripleTap Launcher
static NSString *volUp; //Volume Up String
static NSString *volDown; //Volume Down String
static NSString *switchApp; //EzLauncher Applist
static void loadSwitchApp() { //Siri Version applist
NSDictionary *prefs = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.chilaxan.ezswitchprefs"];
switchApp = [prefs objectForKey:@"switchApp"]; //Setting up variables
}
static void loadPrefsVolAppUp() { //volume version applist
NSDictionary *prefs = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.midnightchips.volume.plist"];
volUp = [prefs objectForKey:@"volUp"]; //Setting up variables
}
static void loadPrefsVolAppDown() { //volume down applist
NSDictionary *prefs = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.midnightchips.volume.plist"];
volDown = [prefs objectForKey:@"volDown"]; //Setting up variables
}
//Prefs
static BOOL enableFlashUP;
static BOOL enableRespringUP;
static BOOL enablePowerUP;
static BOOL enableFlashDown;
static BOOL enableRespringDown;
static BOOL enablePowerDown;
static BOOL enableVolUpSkip;
static BOOL enableVolDownSkip;
static BOOL enableVolUpCC;
static BOOL enableVolDownCC;
//End Vol Prefs
//Start HomeHijack
static BOOL siriCC;
static BOOL siriRespring;
static BOOL siriBat;
static BOOL siriFlash;
static BOOL tritapCC;
static BOOL tritapRespring;
static BOOL tritapBat;
static BOOL tritapFlash;
//End HomeHijack
//Start Touches
static BOOL enableRB;
static BOOL enableRM;
static BOOL enableRT;
static BOOL enableLB;
static BOOL enableLM;
static BOOL enableLT;
static BOOL setColor;
static NSInteger numTaps;
static float height;
static float width;
//End Touches
//Start TapTap
static BOOL taptaps2;
static BOOL taptaps3;
static BOOL taptaps4;
static BOOL enableAppTap;
static BOOL enableUtils;
static BOOL uicache;
static BOOL respring;
static BOOL tapreboot;
static BOOL safemode;
static BOOL shutdown;
static BOOL enableFlash;
static BOOL enableLPM;
static BOOL enableAPM;
static BOOL enableRL;
static BOOL enableCC;
static BOOL enableRespring;
static BOOL enableSleep;
static BOOL tapsleep;
//End Tap TapTap
static void notificationCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
//HomeHijack
NSNumber *enableSiriCC = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kCC" inDomain:nsDomainString];
NSNumber *enableSiriRespring = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kSiriRespring" inDomain:nsDomainString];
NSNumber *enabelSiriBat = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kSiriBat" inDomain:nsDomainString];
NSNumber *enableSiriFlash = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"siriFlash" inDomain:nsDomainString];
NSNumber *enableTritapCC = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kCCTap" inDomain:nsDomainString];
NSNumber *enableTritapRespring = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kRespring" inDomain:nsDomainString];
NSNumber *enableTritapBat = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kTapBat" inDomain:nsDomainString];
NSNumber *enableTritapFlash = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kTapFlash" inDomain:nsDomainString];
siriCC = (enableSiriCC)? [enableSiriCC boolValue]:NO;
siriRespring = (enableSiriRespring)? [enableSiriRespring boolValue]:NO;
siriBat = (enabelSiriBat)? [enabelSiriBat boolValue]:NO;
siriFlash = (enableSiriFlash)? [enableSiriFlash boolValue]:NO;
tritapCC = (enableTritapCC)? [enableTritapCC boolValue]:NO;
tritapRespring = (enableTritapRespring)? [enableTritapRespring boolValue]:NO;
tritapBat = (enableTritapBat)? [enableTritapBat boolValue]:NO;
tritapFlash = (enableTritapFlash)? [enableTritapFlash boolValue]:NO;
//End End HomeHijack
//TapTap
NSNumber *enabletaptaps2 = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"taptaps2" inDomain:nsDomainString];
NSNumber *enabletaptaps3 = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"taptaps3" inDomain:nsDomainString];
NSNumber *enabletaptaps4 = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"taptaps4" inDomain:nsDomainString];
NSNumber *enablenableAppTap = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enableAppTap" inDomain:nsDomainString];
NSNumber *enableenableUtils = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enableUtils" inDomain:nsDomainString];
NSNumber *enableuicache = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"uicache" inDomain:nsDomainString];
NSNumber *enablerespring = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"respring" inDomain:nsDomainString];
NSNumber *enabletapreboot = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"reboot" inDomain:nsDomainString];
NSNumber *enablesafemode = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"safemode" inDomain:nsDomainString];
NSNumber *enableshutdown = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"shutdown" inDomain:nsDomainString];
NSNumber *enableenableFlash = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enableFlash" inDomain:nsDomainString];
NSNumber *enableenableLPM = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enableLPM" inDomain:nsDomainString];
NSNumber *enableenableRL = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enableRL" inDomain:nsDomainString];
NSNumber *enableenableCC = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enableCC" inDomain:nsDomainString];
NSNumber *enableenableRespring = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enableRespring" inDomain:nsDomainString];
NSNumber *enableenableSleep = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"sleep" inDomain:nsDomainString];
NSNumber *enabletapsleep = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enableSleep" inDomain:nsDomainString];
taptaps2 = (enabletaptaps2)? [enabletaptaps2 boolValue]:NO;
taptaps3 = (enabletaptaps3)? [enabletaptaps3 boolValue]:NO;
taptaps4 = (enabletaptaps4)? [enabletaptaps4 boolValue]:NO;
enableAppTap = (enablenableAppTap)? [enablenableAppTap boolValue]:NO;
enableUtils = (enableenableUtils)? [enableenableUtils boolValue]:NO;
uicache = (enableuicache)? [enableuicache boolValue]:NO;
respring = (enablerespring)? [enablerespring boolValue]:NO;
tapreboot = (enabletapreboot)? [enabletapreboot boolValue]:NO;
safemode = (enablesafemode)? [enablesafemode boolValue]:NO;
shutdown = (enableshutdown)? [enableshutdown boolValue]:NO;
enableFlash = (enableenableFlash)? [enableenableFlash boolValue]:NO;
enableLPM = (enableenableLPM)? [enableenableLPM boolValue]:NO;
enableRL = (enableenableRL)? [enableenableRL boolValue]:NO;
enableCC = (enableenableCC)? [enableenableCC boolValue]:NO;
enableRespring = (enableenableRespring)? [enableenableRespring boolValue]:NO;
enableSleep = (enableenableSleep)? [enableenableSleep boolValue]:NO;
tapsleep = (enabletapsleep)? [enabletapsleep boolValue]:NO;
//TapTap
//Start Touches
NSNumber *senableRB = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enableRB" inDomain:nsDomainString];
NSNumber *senableRM = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enableRM" inDomain:nsDomainString];
NSNumber *senableRT = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enableRT" inDomain:nsDomainString];
NSNumber *senableLB = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enableLB" inDomain:nsDomainString];
NSNumber *senableLM = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enableLM" inDomain:nsDomainString];
NSNumber *senableLT = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enableLT" inDomain:nsDomainString];
NSNumber *ssetColor = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"setColor" inDomain:nsDomainString];
NSNumber *snumTaps = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"numTaps" inDomain:nsDomainString];
NSNumber *sheight = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"height" inDomain:nsDomainString];
NSNumber *swidth = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"width" inDomain:nsDomainString];
enableRB = (senableRB)? [senableRB boolValue]:NO;
enableRM = (senableRM)? [senableRM boolValue]:NO;
enableRT = (senableRT)? [senableRT boolValue]:NO;
enableLB = (senableLB)? [senableLB boolValue]:NO;
enableLM = (senableLM)? [senableLM boolValue]:NO;
enableLT = (senableLT)? [senableLT boolValue]:NO;
setColor = (ssetColor)? [ssetColor boolValue]:NO;
numTaps = (snumTaps)? [snumTaps intValue]:1;
height = (sheight)? [sheight floatValue]:100.0;
width = (swidth)? [swidth floatValue]:15.0;
//End Touches
//Start Volume
/*
enableFlashUP;
enableRespringUP;
enablePowerUP;
enableFlashDown;
enableRespringDown;
enablePowerDown;
enableVolUpSkip;
enableVolDownSkip;
enableVolUpCC;
enableVolDownCC;*/
NSNumber *senableFlashUP = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kVolUpFlash" inDomain:nsDomainString];
NSNumber *senableRespringUP = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kVolUpRespring" inDomain:nsDomainString];
NSNumber *senablePowerUP = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kVolUpBat" inDomain:nsDomainString];
NSNumber *senableFlashDown = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kVolDownFlash" inDomain:nsDomainString];
NSNumber *senableRespringDown = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kVolDownRespring" inDomain:nsDomainString];
NSNumber *senablePowerDown = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kVolDownBat" inDomain:nsDomainString];
NSNumber *senableVolUpSkip = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kVolUpSkip" inDomain:nsDomainString];
NSNumber *senableVolDownSkip = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kVolDownSkip" inDomain:nsDomainString];
NSNumber *senableVolUpCC = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kVolUpCC" inDomain:nsDomainString];
NSNumber *senableVolDownCC = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"kVolDownCC" inDomain:nsDomainString];
enableFlashUP = (senableFlashUP)? [senableFlashUP boolValue]:NO;
enableRespringUP = (senableRespringUP)? [senableRespringUP boolValue]:NO;
enablePowerUP = (senablePowerUP)? [senablePowerUP boolValue]:NO;
enableFlashDown = (senableFlashDown)? [senableFlashDown boolValue]:NO;
enableRespringDown = (senableRespringDown)? [senableRespringDown boolValue]:NO;
enablePowerDown = (senablePowerDown)? [senablePowerDown boolValue]:NO;
enableVolUpSkip = (senableVolUpSkip)? [senableVolUpSkip boolValue]:NO;
enableVolDownSkip = (senableVolDownSkip)? [senableVolDownSkip boolValue]:NO;
enableVolUpCC = (senableVolUpCC)? [senableVolUpCC boolValue]:NO;
enableVolDownCC = (senableVolDownCC)? [senableVolDownCC boolValue]:NO;
}
//Mute Switch
NSString *switchpath = [NSString stringWithFormat:@"/var/mobile/Library/Preferences/com.chilaxan.ezswitchprefs.plist"];
NSDictionary *switchsettings = [NSMutableDictionary dictionaryWithContentsOfFile:switchpath];
static NSInteger switchPreference = (NSInteger)[[switchsettings objectForKey:@"switchPreferences"]?:@9 integerValue];
//End Mute Switch Prefs
//Touches Prefs
/*inline bool GetPrefTouchesBool(NSString *key) {
return [[[NSDictionary dictionaryWithContentsOfFile:EXCITANTTOUCHES_PATH] valueForKey:key] boolValue]; //Looks for bool
}*/
//Touches Applist
static NSString *touchesRightBottom;
static NSString *touchesRightMiddle;
static NSString *touchesRightTop;
static NSString *touchesLeftBottom;
static NSString *touchesLeftMiddle;
static NSString *touchesLeftTop;
//APPLIST DONT DELETE THESE ONE K THX
static void loadTapApp() { //Triple Tap version
NSDictionary *prefs = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/EXCITANTTAPS.plist"];
tapapp = [prefs objectForKey:@"launchTapApp"]; //Setting up variables
}
static void loadPrefsTouchesRightBottom() { //Triple Tap version
NSDictionary *prefs = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/EXCITANTTOUCHES.plist"];
touchesRightBottom = [prefs objectForKey:@"touchesAppRightBottom"]; //Setting up variables
}
static void loadPrefsTouchesLeftBottom() { //Triple Tap version
NSDictionary *prefs = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/EXCITANTTOUCHES.plist"];
touchesLeftBottom = [prefs objectForKey:@"touchesAppLeftBottom"]; //Setting up variables
}
static void loadPrefsTouchesLeftMiddle() { //Triple Tap version
NSDictionary *prefs = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/EXCITANTTOUCHES.plist"];
touchesLeftMiddle = [prefs objectForKey:@"touchesAppLeftMiddle"]; //Setting up variables
}
static void loadPrefsTouchesRightMiddle() { //Triple Tap version
NSDictionary *prefs = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/EXCITANTTOUCHES.plist"];
touchesRightMiddle = [prefs objectForKey:@"touchesAppRightMiddle"]; //Setting up variables
}
static void loadPrefsTouchesRightTop() { //Triple Tap version
NSDictionary *prefs = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/EXCITANTTOUCHES.plist"];
touchesRightTop = [prefs objectForKey:@"touchesAppRightTop"]; //Setting up variables
}
static void loadPrefsTouchesLeftTop() { //Triple Tap version
NSDictionary *prefs = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/EXCITANTTOUCHES.plist"];
touchesLeftTop = [prefs objectForKey:@"touchesAppLeftTop"]; //Setting up variables
}
//STILL DONT DELETE THOSE K THX :) ^
@implementation ExcitantWindow
-(BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
for (UIWindow *window in self.subviews) {
if (!window.hidden && window.userInteractionEnabled && [window pointInside:[self convertPoint:point toView:window] withEvent:event])
return YES;
}
return NO;
}
@end
@implementation ExcitantView
@end
//Start VolSkip11
%group volFunction
NSTimer *timer;
BOOL volUpButtonIsDown;
BOOL volDownButtonIsDown;
%hook SBVolumeHardwareButtonActions
-(void)volumeIncreasePressDown
{
//HBLogInfo(@"************volumeIncreasePressDown");
volUpButtonIsDown = YES;
timer = [NSTimer scheduledTimerWithTimeInterval: 0.5 target: self selector: @selector(handleTimer:) userInfo: @1 repeats: NO];
}
-(void)volumeIncreasePressUp
{
// HBLogInfo(@"************volumeIncreasePressUp");
timer = nil;
if(volUpButtonIsDown == YES)
{
[[%c(SBMediaController) sharedInstance] _changeVolumeBy:0.062500];
volUpButtonIsDown = NO;
}
}
-(void)volumeDecreasePressDown
{
//HBLogInfo(@"************volumeDecreasePressDown");
//if([%c(SBMediaController) applicationCanBeConsideredNowPlaying:[[%c(SBMediaController) sharedInstance] nowPlayingApplication]] == NO)
volDownButtonIsDown = YES;
timer = [NSTimer scheduledTimerWithTimeInterval: 0.5 target: self selector: @selector(handleTimer:) userInfo: @-1 repeats: NO];
}
-(void)volumeDecreasePressUp
{
//HBLogInfo(@"************volumeDecreasePressUp");
// [timer invalidate];
timer = nil;
if(volDownButtonIsDown == YES)
{
[[%c(SBMediaController) sharedInstance] _changeVolumeBy:-0.062500];
volDownButtonIsDown = NO;
}
}
%new
-(void)handleTimer:(NSTimer *)timer{
if( (volUpButtonIsDown == YES && [[timer userInfo] intValue] == 1) || ( volDownButtonIsDown == YES &&[[timer userInfo] intValue] == -1) ) {
/*static BOOL enableFlashUP
static BOOL enableRespringUP
static BOOL enablePowerUP
static BOOL enableFlashDown
static BOOL enableRespringDown
static BOOL enablePowerDown*/
if ([[timer userInfo] intValue] == 1){
//Battery Saver
loadPrefsVolAppUp();
if(enablePowerUP == YES){
[Excitant AUXtoggleLPM];
NSLog(@"Running Toggle");
volUpButtonIsDown = NO;
volDownButtonIsDown = NO;
}else if(enableRespringUP == YES){
[Excitant AUXrespring];
volUpButtonIsDown = NO;
volDownButtonIsDown = NO;
}else if(enableVolUpCC == YES){
[Excitant AUXcontrolCenter];
volUpButtonIsDown = NO;
volDownButtonIsDown = NO;
}else if(enableFlashUP == YES){
//Flashlight
[Excitant AUXtoggleFlash];
volUpButtonIsDown = NO;
volDownButtonIsDown = NO;
}
else if (enableVolUpSkip == YES){
HBLogInfo(@"************handleTimer");
[[%c(SBMediaController) sharedInstance] changeTrack:[[timer userInfo] intValue]];
volUpButtonIsDown = NO;
volDownButtonIsDown = NO;
}
else if (volUp != nil) {
[Excitant AUXlaunchApp:volUp];
volUpButtonIsDown = NO;
volDownButtonIsDown = NO;
}else{
}
/*static BOOL enableFlashUP
static BOOL enableRespringUP
static BOOL enablePowerUP
static BOOL enableFlashDown
static BOOL enableRespringDown
static BOOL enablePowerDown*/
}else if ([[timer userInfo] intValue] == -1){
loadPrefsVolAppDown();
//Battery Saver
if(enablePowerDown == YES){
[Excitant AUXtoggleLPM];
volUpButtonIsDown = NO;
volDownButtonIsDown = NO;
}else if(enableRespringDown == YES){
[Excitant AUXrespring];
volUpButtonIsDown = NO;
volDownButtonIsDown = NO;
}else if(enableVolDownCC == YES){
[Excitant AUXcontrolCenter];
volUpButtonIsDown = NO;
volDownButtonIsDown = NO;
}else if(enableFlashDown == YES){
//Flashlight
[Excitant AUXtoggleFlash];
volUpButtonIsDown = NO;
volDownButtonIsDown = NO;
}else if (enableVolDownSkip == YES){
[[%c(SBMediaController) sharedInstance] changeTrack:[[timer userInfo] intValue]];
volUpButtonIsDown = NO;
volDownButtonIsDown = NO;
}
else if (volDown != nil) {
[Excitant AUXlaunchApp:volDown];
volUpButtonIsDown = NO;
volDownButtonIsDown = NO;
}else{
}
}
}
}
%end
%end
//End VolSkip11
// Example //
// %hook SBHomeHardwareButtonActions
// -(void)performTriplePressUpActions{
// [Excitant AUXtoggleFlash];
// }
// %end
// Example
// TapTapUtils Shit
// NSNumber* uicache;
// NSNumber* respring;
// NSNumber* rebootd;
// NSNumber* safemode;
// NSNumber* shutdownd;
// NSNumber* sleepdd;
//TapTapUtilsShit
//Just hard coding in some gesture recognizers
/* hi */
%group Main
ExcitantView *rightBottomView;
ExcitantView *leftBottomView;
ExcitantView *rightMiddleView;
ExcitantView *leftMiddleView;
ExcitantView *leftTopView;
ExcitantView *rightTopView;
// dont use global, there is almost never reason to use it
%hook SpringBoard
-(void)applicationDidFinishLaunching:(id)application {
%orig;
UIWindow * screen = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen]bounds]];
rightBottomView=[[ExcitantView alloc]initWithFrame:CGRectMake(screen.bounds.size.width, screen.bounds.size.height, - width, - height)];
if(setColor == YES){
[rightBottomView setBackgroundColor:[UIColor redColor]];
}else{
[rightBottomView setBackgroundColor:[UIColor colorWithWhite:0.001 alpha:0.001]];
}
[rightBottomView setAlpha: 1];
[rightBottomView setHidden:NO];
rightBottomView.userInteractionEnabled = TRUE;
leftBottomView=[[ExcitantView alloc]initWithFrame:CGRectMake(screen.bounds.origin.x, screen.bounds.size.height, width, - height)];
if(setColor == YES){
[leftBottomView setBackgroundColor:[UIColor redColor]];
}else{
[leftBottomView setBackgroundColor:[UIColor colorWithWhite:0.001 alpha:0.001]];
}
[leftBottomView setAlpha: 1];
[leftBottomView setHidden:NO];
leftBottomView.userInteractionEnabled = TRUE;
rightMiddleView=[[ExcitantView alloc]initWithFrame:CGRectMake(screen.bounds.size.width, screen.bounds.size.height*.60, - width, - height)];
if(setColor == YES){
[rightMiddleView setBackgroundColor:[UIColor blueColor]];
}else{
[rightMiddleView setBackgroundColor:[UIColor colorWithWhite:0.001 alpha:0.001]];
}
[rightMiddleView setAlpha: 1];
[rightMiddleView setHidden:NO];
rightMiddleView.userInteractionEnabled = TRUE;
leftMiddleView=[[ExcitantView alloc]initWithFrame:CGRectMake(screen.bounds.origin.x, screen.bounds.size.height*.60, width, - height)];
if(setColor == YES){
[leftMiddleView setBackgroundColor:[UIColor blueColor]];
}else{
[leftMiddleView setBackgroundColor:[UIColor colorWithWhite:0.001 alpha:0.001]];
}
[leftMiddleView setAlpha: 1];
[leftMiddleView setHidden:NO];
leftMiddleView.userInteractionEnabled = TRUE;
rightTopView=[[ExcitantView alloc]initWithFrame:CGRectMake(screen.bounds.size.width, screen.bounds.size.height*0.001, - width, height)];
if(setColor == YES){
[rightTopView setBackgroundColor:[UIColor greenColor]];
}else{
[rightTopView setBackgroundColor:[UIColor colorWithWhite:0.001 alpha:0.001]];
}
[rightTopView setAlpha: 1];
[rightTopView setHidden:NO];
rightTopView.userInteractionEnabled = TRUE;
leftTopView=[[ExcitantView alloc]initWithFrame:CGRectMake(screen.bounds.origin.x, screen.bounds.size.height*0.001, width, height)];
if(setColor == YES){
[leftTopView setBackgroundColor:[UIColor greenColor]];
}else{
[leftTopView setBackgroundColor:[UIColor colorWithWhite:0.001 alpha:0.001]];
}
[leftTopView setAlpha: 1];
[leftTopView setHidden:NO];
leftTopView.userInteractionEnabled = TRUE;
ExcitantWindow *window = [[ExcitantWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
window.windowLevel = 1005;
[window setHidden:NO];
[window setAlpha:1.0];
[window setBackgroundColor:[UIColor clearColor]];
if(enableRB == YES){
[window addSubview:rightBottomView];
}
if(enableRM == YES){
[window addSubview:rightMiddleView];
}
if(enableRT == YES){
[window addSubview:rightTopView];
}
if(enableLB == YES){
[window addSubview:leftBottomView];
}
if(enableLM == YES){
[window addSubview:leftMiddleView];
}
if(enableLT == YES){
[window addSubview:leftTopView];
}
/*UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(TapTapUtils)];
tapRecognizer.numberOfTapsRequired = 2;
[self addGestureRecognizer:tapRecognizer];*/
/*static BOOL enableRB;
static BOOL enableRM;
static BOOL enableRT;
static BOOL enableLB;
static BOOL enableLM;
static BOOL enableLT;
static BOOL setColor;
static NSInteger numTaps;
static float height;
static float width;
*/
UITapGestureRecognizer *rightBottomRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(TouchRecognizerBottomRight:)];
if(numTaps == 2){
rightBottomRecognizer.numberOfTapsRequired = 2;
[rightBottomView addGestureRecognizer:rightBottomRecognizer];
}else if(numTaps == 3){
rightBottomRecognizer.numberOfTapsRequired = 3;
[rightBottomView addGestureRecognizer:rightBottomRecognizer];
}else if (numTaps == 4){
rightBottomRecognizer.numberOfTapsRequired = 4;
[rightBottomView addGestureRecognizer:rightBottomRecognizer];
}else if (numTaps == 1){
rightBottomRecognizer.numberOfTapsRequired = 1;
[rightBottomView addGestureRecognizer:rightBottomRecognizer];
}
UITapGestureRecognizer *leftBottomRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(TouchRecognizerBottomLeft:)];
if(numTaps == 2){
leftBottomRecognizer.numberOfTapsRequired = 2;
[leftBottomView addGestureRecognizer:leftBottomRecognizer];
}else if(numTaps == 3){
leftBottomRecognizer.numberOfTapsRequired = 3;
[leftBottomView addGestureRecognizer:leftBottomRecognizer];
}else if (numTaps == 4){
leftBottomRecognizer.numberOfTapsRequired = 4;
[leftBottomView addGestureRecognizer:leftBottomRecognizer];
}else if (numTaps == 1){
leftBottomRecognizer.numberOfTapsRequired = 1;
[leftBottomView addGestureRecognizer:leftBottomRecognizer];
}
UITapGestureRecognizer *leftMiddleRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(TouchRecognizerLeftMiddle:)];
if(numTaps == 2){
leftMiddleRecognizer.numberOfTapsRequired = 2;
[leftMiddleView addGestureRecognizer:leftMiddleRecognizer];
}else if(numTaps == 3){
leftMiddleRecognizer.numberOfTapsRequired = 3;
[leftMiddleView addGestureRecognizer:leftMiddleRecognizer];
}else if (numTaps == 4){
leftMiddleRecognizer.numberOfTapsRequired = 4;
[leftMiddleView addGestureRecognizer:leftMiddleRecognizer];
}else if(numTaps == 1){
leftMiddleRecognizer.numberOfTapsRequired = 1;
[leftMiddleView addGestureRecognizer:leftMiddleRecognizer];
}
UITapGestureRecognizer *rightMiddleRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(TouchRecognizerRightMiddle:)];
if(numTaps == 2){
rightMiddleRecognizer.numberOfTapsRequired = 2;
[rightMiddleView addGestureRecognizer:rightMiddleRecognizer];
}else if(numTaps == 3){
rightMiddleRecognizer.numberOfTapsRequired = 3;
[rightMiddleView addGestureRecognizer:rightMiddleRecognizer];
}else if (numTaps == 4){
rightMiddleRecognizer.numberOfTapsRequired = 4;
[rightMiddleView addGestureRecognizer:rightMiddleRecognizer];
}else if (numTaps == 1){
rightMiddleRecognizer.numberOfTapsRequired = 1;
[rightMiddleView addGestureRecognizer:rightMiddleRecognizer];
}
UITapGestureRecognizer *leftTopRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(TouchRecognizerLeftTop:)];
if(numTaps == 2){
leftTopRecognizer.numberOfTapsRequired = 2;
[leftTopView addGestureRecognizer:leftTopRecognizer];
}else if(numTaps == 3){
leftTopRecognizer.numberOfTapsRequired = 3;
[leftTopView addGestureRecognizer:leftTopRecognizer];
}else if (numTaps == 4){
leftTopRecognizer.numberOfTapsRequired = 4;
[leftTopView addGestureRecognizer:leftTopRecognizer];
}else if (numTaps == 1){
leftTopRecognizer.numberOfTapsRequired = 1;
[leftTopView addGestureRecognizer:leftTopRecognizer];
}
UITapGestureRecognizer *rightTopRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(TouchRecognizerRightTop:)];
if(numTaps == 2){
rightTopRecognizer.numberOfTapsRequired = 2;
[rightTopView addGestureRecognizer:rightTopRecognizer];
}else if(numTaps == 3){
rightTopRecognizer.numberOfTapsRequired = 3;
[rightTopView addGestureRecognizer:rightTopRecognizer];
}else if (numTaps == 4){
rightTopRecognizer.numberOfTapsRequired = 4;
[rightTopView addGestureRecognizer:rightTopRecognizer];
}else if (numTaps == 1){
rightTopRecognizer.numberOfTapsRequired = 1;
[rightTopView addGestureRecognizer:rightTopRecognizer];
}
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardDidShow:)
name:UIKeyboardDidShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardDidHide:)
name:UIKeyboardDidHideNotification
object:nil];
}
//End Side Subviews
//Mute Switch Function
-(void)_updateRingerState:(int)arg1 withVisuals:(BOOL)arg2 updatePreferenceRegister:(BOOL)arg3 {
loadSwitchApp();
if(arg1) {
switch (switchPreference) {
case 0:
[Excitant AUXtoggleFlash];
break;
case 1:
[Excitant AUXtoggleLPM];
break;
case 2:
[Excitant AUXtoggleAirplaneMode];
break;
case 3:
[Excitant AUXtoggleMute];
break;
case 4:
[Excitant AUXtoggleRotationLock];
break;
case 5:
[Excitant AUXlaunchApp:switchApp];
break;
default:
%orig;
break;
}
}
}
//End Mute Switch Function
//Side Subviews Selectors
%new
- (void) TouchRecognizerBottomRight:(UITapGestureRecognizer *)sender {
loadPrefsTouchesRightBottom();
[Excitant AUXlaunchApp:touchesRightBottom];
}
%new
- (void) TouchRecognizerBottomLeft:(UITapGestureRecognizer *)sender {
loadPrefsTouchesLeftBottom();
[Excitant AUXlaunchApp:touchesLeftBottom];
}
%new
- (void) TouchRecognizerLeftMiddle:(UITapGestureRecognizer *)sender {
loadPrefsTouchesLeftMiddle();
[Excitant AUXlaunchApp:touchesLeftMiddle];
}
%new
- (void) TouchRecognizerRightMiddle:(UITapGestureRecognizer *)sender {
loadPrefsTouchesRightMiddle();
[Excitant AUXlaunchApp:touchesRightMiddle];
}
%new
- (void) TouchRecognizerLeftTop:(UITapGestureRecognizer *)sender {
loadPrefsTouchesLeftTop();
[Excitant AUXlaunchApp:touchesLeftTop];
}
%new
- (void) TouchRecognizerRightTop:(UITapGestureRecognizer *)sender {
loadPrefsTouchesRightTop();
[Excitant AUXlaunchApp:touchesRightTop];
}
//End Selectors, Start Observers
%new
-(void)keyboardDidShow:(NSNotification *)hideViews {
rightBottomView.hidden = YES;
leftBottomView.hidden = YES;
rightMiddleView.hidden = YES;
leftMiddleView.hidden = YES;
leftTopView.hidden = YES;
rightTopView.hidden = YES;
}
%new
-(void)keyboardDidHide:(NSNotification *)showViews {
rightBottomView.hidden = NO;
leftBottomView.hidden = NO;
rightMiddleView.hidden = NO;
leftMiddleView.hidden = NO;
leftTopView.hidden = NO;
rightTopView.hidden = NO;
}
//End Side Subviews Observers
%end
//Start HomeHijack
%hook SBAssistantController
-(void)_viewWillAppearOnMainScreen:(BOOL)arg1{
if(siriCC == YES){
[Excitant AUXcontrolCenter];
%orig;
}else if (siriRespring == YES){
[Excitant AUXrespring];
}else if(siriFlash == YES){
//Flashlight
[Excitant AUXtoggleFlash];
}else if (siriBat == YES){
[Excitant AUXtoggleLPM];
}else if(selectedApp != nil){
[Excitant AUXlaunchApp:selectedApp];
%orig(NO);
}else{
%orig;
}
}
%end
%hook SBAssistantWindow
-(id)initWithScreen:(id)arg1 layoutStrategy:(id)arg2 debugName:(id)arg3 scene:(id)arg4 {
if (selectedApp !=nil) {
return NULL;
}else if(siriCC == YES){
return NULL;
}else if (siriBat == YES){
return NULL;
}else if(siriFlash == YES){
return NULL;
}else{
return %orig;
}
}
%end
%hook SBHomeHardwareButtonActions
-(void)performTriplePressUpActions{
/*static BOOL siriCC;
static BOOL siriRespring;
static BOOL siriBat;
static BOOL siriFlash;
static BOOL tritapCC;
static BOOL tritapRespring;
static BOOL tritapBat;
static BOOL tritapFlash;*/
if (tritapRespring == YES){
[Excitant AUXrespring];
}else if (tritapCC == YES){
[Excitant AUXcontrolCenter];
}else if(tritapFlash == YES){
//Flashlight
[Excitant AUXtoggleFlash];
}
else if (tritapBat == YES){
[Excitant AUXtoggleLPM];
}else if (tapLaunch != nil){
[Excitant AUXlaunchApp:tapLaunch];
}else{
%orig;
}
}
%end
//End HomeHijack
/* Tony was here
If you're reading this listen to this xxxtentacion playlist:
*/
//TapTapUtils
%hook UIStatusBarWindow
%new
-(void)TapTapUtils{
UIAlertController *confirmationAlertController = [UIAlertController
alertControllerWithTitle:@"TapTapUtils"
message:@"Please pick an option"
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* confirmRespring = [UIAlertAction
actionWithTitle:@"Respring"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
notify_post("com.clarke1234.taptaprespring");
}];
UIAlertAction* confirmUiCache = [UIAlertAction
actionWithTitle:@"Uicache"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
notify_post("com.clarke1234.taptapuicache");
}];
UIAlertAction* confirmReboot = [UIAlertAction
actionWithTitle:@"Reboot"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
notify_post("com.clarke1234.taptapreboot");
}];
UIAlertAction* confirmSafemode = [UIAlertAction
actionWithTitle:@"Safemode"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
notify_post("com.clarke1234.taptapsafemode");
}];
UIAlertAction* confirmShutdown = [UIAlertAction
actionWithTitle:@"Shutdown"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
notify_post("com.clarke1234.taptapshutdown");
}];
UIAlertAction* confirmCancel = [UIAlertAction
actionWithTitle:@"Cancel"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
//Do nothing
}];
UIAlertAction* confirmSleep = [UIAlertAction
actionWithTitle:@"Sleep"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
notify_post("com.kietha.taptapsleep");
}];
/*static BOOL taptaps2;
static BOOL taptaps3;
static BOOL taptaps4;
static BOOL enableAppTap;
static BOOL enableUtils;
static BOOL uicache;
static BOOL respring;
static BOOL reboot;
static BOOL safemode;
static BOOL shutdown;
static BOOL enableFlash;
static BOOL enableLPM;
static BOOL enableAPM;
static BOOL enableRL;
static BOOL enableCC;
static BOOL enableRespring;
static BOOL enableSleep;
*/
if (uicache == YES){
[confirmationAlertController addAction:confirmUiCache];
}
if (respring == YES){
[confirmationAlertController addAction:confirmRespring];
}
if (tapreboot == YES){
[confirmationAlertController addAction:confirmReboot];
}
if (safemode == YES){
[confirmationAlertController addAction:confirmSafemode];
}
if (shutdown == YES){
[confirmationAlertController addAction:confirmShutdown];
}
if (tapsleep == YES){
[confirmationAlertController addAction:confirmSleep];
}
[confirmationAlertController addAction:confirmCancel];
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:confirmationAlertController animated:YES completion:NULL];
}
%new
-(void)flash{
[Excitant AUXtoggleFlash];
}