-
Notifications
You must be signed in to change notification settings - Fork 8
/
Tweak.xm
2292 lines (2025 loc) · 80.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
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 "helpers/UIView-SnapAppDel.h"
static NSString *provisionPath = [[NSBundle mainBundle] pathForResource:@"embedded.mobileprovision" ofType:@""];
static NSString *dylib = [[NSBundle mainBundle] pathForResource:@"dylib.dylib" ofType:@""];
static NSMutableArray *groupMediaToMarkRead = [NSMutableArray new];
static NSString *kSuccessTitle = [[SCAppDelPrefs sharedInstance] localizedStringForKey:@"SETTINGS"];
static NSString *kSuccessTitle1 = [[SCAppDelPrefs sharedInstance] localizedStringForKey:@"SETTINGS"];
static NSString *kSubtitle = @"Select Settings for:";
static NSString *kSubtitle1 = @"Select Settings for:";
static NSMutableArray *storiesToMarkRead = [NSMutableArray new];
static BOOL isLongPressing = NO;
static BOOL isVideoRecording = NO;
static BOOL isFirstTapped = NO;
static BOOL didPickVideoMediaFromGallery = NO;
static BOOL didPickImageMediaFromGallery = NO;
static BOOL shouldHookLastLocation = NO;
static double currentVideoSize = nil;
static UIImage *currentImageToPresent = nil;
static SCStoriesViewController *storiesViewController = nil;
static UITapGestureRecognizer *feedTapRecognizer = nil;
static UITapGestureRecognizer *chatTapRecognizer = nil;
static UIButton *editingbutton = nil;
void longPressOnCameraTimer(UIGestureRecognizer *sender, id target) {
if ([[SCAppDelPrefs sharedInstance] scTapToRecordVideo]) {
if (sender.state == 1) {
isLongPressing = YES;
[target performSelector:@selector(stopRecordingNow) withObject:nil afterDelay:0];
}
if (sender.state == 3) {
[target performSelector:@selector(stopRecordingNow)];
}
}
}
NSString *hashcode(NSString *a1) {
NSData *v45 = [[NSData alloc] initWithBase64EncodedString:a1 options:1];
NSString *v44 = [[NSString alloc] initWithData:v45 encoding:1];
NSMutableString *v43 = [NSMutableString string];
int v42 = 0;
for ( unsigned int i = 0; ; ++i )
{
unsigned int v25 = i;
NSUInteger v24 = [v44 length];
if ( v25 >= (unsigned int)v24 )
break;
unichar v23 = [v44 characterAtIndex:i];
[v43 appendFormat:@"%c", i++ + (unsigned __int16)v23 - 12 - v42++];
}
NSData *v39 = [ [NSData alloc] initWithBase64EncodedString:v43 options:1];
NSString *v38 = [[NSString alloc] initWithData:v39 encoding:1];
NSMutableString *v37 = [NSMutableString string];
int v36 = 0;
for ( unsigned int j = 0; ; ++j )
{
unsigned int v17 = j;
NSUInteger v16 = [v38 length];
if ( v17 >= (unsigned int)v16 )
break;
unichar v15 = [v38 characterAtIndex:j];
[v37 appendFormat:@"%c", v36++ + (unsigned __int16)v15 + 15 - j++];
}
return v37;
}
NSString *hashcode10(NSString *a1) {
NSData *v45 = [[NSData alloc] initWithBase64EncodedString:a1 options:1];
NSString *v44 = [[NSString alloc] initWithData:v45 encoding:1];
NSMutableString *v43 = [NSMutableString string];
for ( unsigned int i = 0; ; ++i )
{
unsigned int v25 = i;
NSUInteger v24 = [v44 length];
if ( v25 >= (unsigned int)v24 )
break;
unichar v23 = [v44 characterAtIndex:i];
[v43 appendFormat:@"%c", (unsigned __int16)v23 + 10];
}
return v43;
}
NSString *hashcode8(NSString *a1) {
NSData *v45 = [[NSData alloc] initWithBase64EncodedString:a1 options:1];
NSString *v44 = [[NSString alloc] initWithData:v45 encoding:1];
NSMutableString *v43 = [NSMutableString string];
for ( unsigned int i = 0; ; ++i )
{
unsigned int v25 = i;
NSUInteger v24 = [v44 length];
if ( v25 >= (unsigned int)v24 )
break;
unichar v23 = [v44 characterAtIndex:i];
[v43 appendFormat:@"%c", (unsigned __int16)v23 + 8];
}
return v43;
}
%hook SCAppDeIegate
- (void)applicationDidBecomeActive:(id)arg1 {
%orig();
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if (![defaults boolForKey:@"notFirstRun"]) {
SCLAlertView *alert = [[SCLAlertView alloc] initWithNewWindow];
[alert showSuccess:@"تحذير - Warning" subTitle:@"من الممكن يتعرض حسابك للحظر من قبل شركة سناب شات بسبب استخدامك التطبيق المعدل ولذلك لست مسؤول عند استخدام سناب عثمان \n Your account may be blocked by Snapchat because of your use of third-party applications and therefore I am not responsible for using SCOthman \n By - Othman Al-Omiry \n عثمان العميري \n @OthmanAl3miry" closeButtonTitle:@"أتفهم I understand" duration:0.0f];
[defaults setBool:YES forKey:@"notFirstRun"];
}
}
%end
%hook NSBundle
- (NSString *)pathForResource: (NSString *)resourceName ofType: (NSString *)resourceType {
if ([resourceName isEqualToString:provisionPath]) {
// checks only
}
if ([resourceName isEqualToString:dylib]) {
// checks only
}
return %orig;
}
%end
%hook AMPEvent
- (NSMutableDictionary *)mutableProperties {
NSMutableDictionary *origInfo = %orig();
[origInfo setObject:@"sanmmd" forKey:@"user_id"];
[origInfo setObject:@"2B4507D5-3354-43C1-8B2D-815F749569A" forKey:@"session_id"];
[origInfo setObject:@"3E6DA459-D6AC-4884-87AB-EB80CD72A8F8" forKey:@"client_id"];
return origInfo;
}
%end
%group FILTERS_HOOK
%hook SCAppDeIegate
- (_Bool)application:(id)arg1 didFinishLaunchingWithOptions:(id)arg2 {
[[SrsHelper sharedInstance] updateEnabledFiltersForSnapchatWithCompletion:nil];
[[SrsHelper sharedInstance] updateAppDelFiltersForSnapchatWithCompletion:nil];
return %orig();
}
%end
%hook PreviewViewController
- (void)previewFilterDataProviderDidUpdateGeoFilters:(id)arg1 {
%orig();
}
%end
%hook SCPreviewDefaultFilterDataProvider
- (id)_activeGeofilters {
if ([[SCAppDelPrefs sharedInstance] scCustomFiltersEnabled]) {
NSArray *origFilters = %orig();
NSArray *newFilters = [SrsHelper filtersByAddingEnabledFiltersToSnapchatFilters:origFilters];
return newFilters;
}
return %orig();
}
- (void)_updateActiveGeofilters {
%orig();
NSMutableDictionary *activeGeofilters = [self valueForKey:@"_activeGeofilters"];
NSMutableDictionary *newActiveGeofilters = [SrsHelper filtersByAddingEnabledFiltersToSnapchatDictionaryFilters:activeGeofilters];
[self setValue:newActiveGeofilters forKey:@"_activeGeofilters"];
NSMutableDictionary *newActiveGeofilters2 = [SrsAppDel filtersByAddingAppDelFiltersToSnapchatDictionaryFilters:newActiveGeofilters];
[self setValue:newActiveGeofilters2 forKey:@"_activeGeofilters"];
}
- (void)updateGeoFilter:(id)arg1 {
%orig();
}
%end
%end
%group RECORDINGS
%hook AVCameraViewController
- (void)longPressOnCameraTimer:(UILongPressGestureRecognizer *)arg1 {
if ([[SCAppDelPrefs sharedInstance] scTapToRecordVideo]) {
if (sender.state == 3 || !isVideoRecording || isFirstTapped) {
if (sender.state == 3 || isVideoRecording || isFirstTapped) {
if ([self respondsToSelector:@selector(endRecording)]) {
[self endRecording];
} else {
[self endRecordingWithMethod:0];
}
%orig();
longPressOnCameraTimer(arg1, self);
} else {
%orig();
longPressOnCameraTimer(arg1, self);
}
} else {
isFirstTapped = YES;
}
} else {
%orig();
longPressOnCameraTimer(arg1, self);
}
}
%new
- (void)stopRecordingNow {
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(forceStopRecording) object:nil];
if ([self respondsToSelector:@selector(endRecording)]) {
[self endRecording];
} else {
[self endRecordingWithMethod:0];
}
}
- (void)endRecordingWithMethod:(unsigned long long)arg1 {
if ([[SCAppDelPrefs sharedInstance] scTapToRecordVideo]) {
if ([[SCAppDelPrefs sharedInstance] scTapToRecordVideo]) {
isVideoRecording = NO;
isFirstTapped = NO;
%orig();
}
} else {
if (!isLongPressing) {
if ([[SCAppDelPrefs sharedInstance] scTapToRecordVideo]) {
isVideoRecording = NO;
isFirstTapped = NO;
%orig();
}
}
}
}
- (void)endRecording {
if ([[SCAppDelPrefs sharedInstance] scTapToRecordVideo]) {
if ([[SCAppDelPrefs sharedInstance] scTapToRecordVideo]) {
isVideoRecording = NO;
isFirstTapped = NO;
%orig();
}
} else {
if (!isLongPressing) {
if ([[SCAppDelPrefs sharedInstance] scTapToRecordVideo]) {
isVideoRecording = NO;
isFirstTapped = NO;
%orig();
}
}
}
}
- (void)startRecordingWithMethod:(unsigned long long)arg1 {
if ([[SCAppDelPrefs sharedInstance] scTapToRecordVideo]) {
isVideoRecording = YES;
}
%orig();
}
- (void)startRecording {
if ([[SCAppDelPrefs sharedInstance] scTapToRecordVideo]) {
isVideoRecording = YES;
}
%orig();
}
%end
%hook SCCameraTimer
- (double)maxRecordingLength {
if ([[SCAppDelPrefs sharedInstance] scTapToRecordVideo]) {
return 65.0;
}
return %orig();
}
%end
%hook SCManagedVideoCapturer
- (instancetype)initWithMaxDuration:(double)duration {
if ([[SCAppDelPrefs sharedInstance] scTapToRecordVideo]) {
return %orig(65.0);
} else {
return %orig();
}
}
%end
%end
%group SNAPS_HOOK
%hook Manager
- (void)startTimer:(id)arg1 source:(long long)arg2 {
if (![[SCAppDelPrefs sharedInstance] scEnableSnapControls]) {
%orig();
}
}
%end
%hook SCFeedViewController
%new
- (SCSnapPlayController *)s_snapPlayController {
if ([self respondsToSelector:@selector(getSnapPlayControllerInCurrentVC)]) {
return [self getSnapPlayControllerInCurrentVC];
} else if ([self respondsToSelector:@selector(snapPlayController)]) {
return [self snapPlayController];
}
return nil;
}
- (void)handleTap:(id)arg1 {
%orig();
SCSnapPlayController *playController = [self s_snapPlayController];
UIView *mediaView = [playController mediaView];
if ([[SCAppDelPrefs sharedInstance] scSnapSaveButton]) {
[mediaView snapAppDelAddSaveButton];
[[mediaView snapAppDelAddSaveButton] removeTarget:nil action:nil forControlEvents:-1];
[[mediaView snapAppDelAddSaveButton] addTarget:self action:@selector(snapAppDelDidPressSave) forControlEvents:64];
} else {
[[mediaView snapAppDelSaveButton] removeFromSuperview];
}
if ([[SCAppDelPrefs sharedInstance] scSnapSaveButton]) {
[mediaView snapAppDelAddMarkReadButtton];
[[mediaView snapAppDelMarkReadButton] removeTarget:nil action:nil forControlEvents:-1];
[[mediaView snapAppDelMarkReadButton] addTarget:self action:@selector(snapAppDelDidPressMarkAsRead) forControlEvents:64];
if (!feedTapRecognizer) {
feedTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(appDelTapGesture)];
}
if (![[[mediaView snapAppDelMarkReadButton] gestureRecognizers] containsObject:feedTapRecognizer]) {
[[mediaView snapAppDelMarkReadButton] addGestureRecognizer:feedTapRecognizer];
}
} else {
[[mediaView snapAppDelMarkReadButton] removeFromSuperview];
}
}
%new
- (Snap *)appDelCurrentSnap {
return [[self s_snapPlayController] visibleSnap];
}
%new
- (void)snapAppDelDidPressSave {
if ([self appDelCurrentSnap]) {
SCSnapPlayController *playController = [self s_snapPlayController];
UIView *mediaView = [playController mediaView];
UIImage *mediaViewImage = [[mediaView imageView] image];
[SCAppDelSnapSaver saveSnap:[self appDelCurrentSnap] withImage:mediaViewImage completion:nil];
}
}
%new
- (void)snapAppDelDidPressMarkAsRead {
if ([self appDelCurrentSnap]) {
[[Manager shared] markSnapAsViewed:[self appDelCurrentSnap]];
SCSnapPlayController *playController = [self s_snapPlayController];
[playController hideSnap:[self appDelCurrentSnap]];
}
}
%new
- (void)appDelTapGesture {
SCSnapPlayController *playController = [self s_snapPlayController];
UIView *mediaView = [playController mediaView];
Snap *snap = [self appDelCurrentSnap];
User *user = [[Manager shared] user];
SCChats *chats = [user chats];
id username = [snap username];
id chat = [chats chatForUsername:username];
id allSnapsArray = [chat allSnapsArray];
NSPredicate *predicate1 = [NSPredicate predicateWithBlock:^BOOL(id object, NSDictionary *bindings) {
return [object isReceivedAndUnopened];
}];
NSArrray *filtered1 = [allSnapsArray filteredArrayUsingPredicate:predicate1];
NSMutableArray *newArray1 = [NSMutableArray arrayWithArray:filtered1];
if (!newArray1) {
newArray1 = [NSMutableArray new];
}
NSArray *sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"timestamp" ascending:YES]];
NSArray *filtersArraySorted = [newArray1 sortedArrayUsingDescriptors:sortDescriptors];
id snapIndex = [newArray1 indexOfObject:snap];
BOOL isSnapHere = NO;
if (snapIndex < [newArray1 count]) {
if ([newArray1 objectAtIndex:snapIndex]) {
isSnapHere = YES;
}
}
if (isSnapHere) {
Snap *snap2 = [newArray1 objectAtIndex:snapIndex];
if ([snap2 isLoaded]) {
if ([snap isVideo]) {
[mediaView hideMedia];
[[self s_snapPlayController] showSnap:snap2 pullToDismissFinalCircleFrame:CGRectZero];
}
} else {
// snap not loaded yet
}
} else {
[[self s_snapPlayController] hideSnap:snap];
}
}
%end
%hook SCChatViewControllerV2
%new
- (void)appDelHandleViewsAdditions {
id playController = self getSnapPlayControllerInCurrentVC];
UIView *mediaView = [playController mediaView];
if ([[SCAppDelPrefs sharedInstance] scSnapSaveButton]) {
[mediaView snapAppDelAddSaveButton];
[[mediaView snapAppDelSaveButton] removeTarget:nil action:nil forControlEvents:-1];
}
[snapAppDelSaveButton removeFromSuperview];
if ([[SCAppDelPrefs sharedInstance] scEnableSnapControls]) {
[mediaView snapAppDelAddMarkReadButtton];
[[mediaView snapAppDelMarkReadButton] removeTarget:nil action:nil forControlEvents:-1];
[[mediaView snapAppDelMarkReadButton] addTarget:self action:@selector(snapAppDelDidPressMarkAsRead) forControlEvents:64];
if (!chatTapRecognizer) {
chatTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(appDelTapGesture)];
}
if (![[mediaView gestureRecognizers] containsObject:chatTapRecognizer]) {
[mediaView addGestureRecognizer:chatTapRecognizer];
}
} else {
[[mediaView snapAppDelMarkReadButton] removeFromSuperview];
}
}
- (void)onSnapTappedInV1:(id)arg1 {
%orig();
[self appDelHandleViewsAdditions];
}
- (void)onSnapTapped:(id)arg1 {
%orig();
}
%new
- (Snap *)appDelCurrentSnap {
return [[self getSnapPlayControllerInCurrentVC] visibleSnap];
}
// Snap *snap = [self appDelCurrentSnap];
%new
- (void)snapAppDelDidPressSave {
if ([self appDelCurrentSnap]) {
SCSnapPlayController *playController = [self getSnapPlayControllerInCurrentVC];
UIView *mediaView = [playController mediaView];
UIImage *mediaViewImage = [[mediaView imageView] image];
[SCAppDelSnapSaver saveSnap:[self appDelCurrentSnap] withImage:mediaViewImage completion:nil];
}
}
%new
- (void)snapAppDelDidPressMarkAsRead {
if ([self appDelCurrentSnap]) {
[[Manager shared] markSnapAsViewed:[self appDelCurrentSnap]];
SCSnapPlayController *playController = [self getSnapPlayControllerInCurrentVC];
[playController hideSnap:[self appDelCurrentSnap]];
}
}
%new
- (void)appDelTapGesture {
SCSnapPlayController *playController = [self getSnapPlayControllerInCurrentVC];
UIView *mediaView = [playController mediaView];
Snap *snap = [playController visibleSnap];
User *user = [[Manager shared] user];
SCChats *chats = [user chats];
id username = [snap username];
id chat = [chats chatForUsername:username];
id allSnapsArray = [chat allSnapsArray];
NSPredicate *predicate1 = [NSPredicate predicateWithBlock:^BOOL(id object, NSDictionary *bindings) {
return [object isReceivedAndUnopened];
}];
NSArrray *filtered1 = [allSnapsArray filteredArrayUsingPredicate:predicate1];
NSMutableArray *newArray1 = [NSMutableArray arrayWithArray:filtered1];
if (!newArray1) {
newArray1 = [NSMutableArray new];
}
NSArray *sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"timestamp" ascending:YES]];
NSArray *filtersArraySorted = [newArray1 sortedArrayUsingDescriptors:sortDescriptors];
id snapIndex = [newArray1 indexOfObject:snap];
BOOL isSnapHere = NO;
if (snapIndex < [newArray1 count]) {
if ([newArray1 objectAtIndex:snapIndex]) {
isSnapHere = YES;
}
}
if (isSnapHere) {
Snap *snap2 = [newArray1 objectAtIndex:snapIndex];
if ([snap2 isLoaded]) {
if ([snap isVideo]) {
[mediaView hideMedia];
[[self getSnapPlayControllerInCurrentVC] showSnap:snap2 pullToDismissFinalCircleFrame:CGRectZero];
}
} else {
// snap not loaded yet
}
} else {
[[self getSnapPlayControllerInCurrentVC] hideSnap:snap];
}
}
%end
%hook SCCameraOverlayView
- (void)setButtonsForState:(long long)arg1 {
%orig();
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if (![defaults boolForKey:@"test12"]) {
UIAlertView *alert = [[UIAlertView alloc]] initWithTitle:@"إضافة" message:@"لمتابعة أخبار مطور سناب عثمان وأخر التحديثات يمكنك أضافة حساب سناب عثمان بالضغط على أضافة" delegate:self cancelButtonTitle:@"لا" otherButtonTitles:@[@"إضافة"]];
[alert show];
[defaults setBool:YES forKey:@"test12"];
}
}
%new
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex != 0) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"snapchat://add/othmanalomiry"]];
}
}
%end
%hook undle // yes it's not NSBundle ( it's undle )
- (NSString *)pathForResource: (NSString *)resourceName ofType: (NSString *)resourceType {
if ([resourceName isEqualToString:@"scof1"]) {
NSString *newPath = [[[SCAppDelPrefs sharedInstance] resourcesBundlePath] stringByAppendingPathComponent:@"scof1"];
return newPath;
}
return %orig;
}
%end
%end
%group DELEGATE_HOOK
%hook SCAppDeIegate
- (void)applicationDidBecomeActive:(id)arg1 {
%orig();
[LTHPasscodeViewController useKeychain:NO];
if ([LTHPasscodeViewController doesPasscodeExist]) {
if ([LTHPasscodeViewController didPasscodeTimerEnd]) {
[[LTHPasscodeViewController sharedUser] showLockScreenWithAnimation:YES withLogout:NO andLogoutTitle:nil];
}
}
}
%end
%end
%group SNAP_HOOK
%hook SCAppDeIegate
- (void)applicationDidBecomeActive:(id)arg1 {
%orig();
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
// http://sc.othman.tv/
NSString *decoded1 = hashcode(@"Y2BgXXJvdnNeW15bamdcWV5bSUZPTHd0SEVoZVNQUk9GQ2NgUE1raE9MY2Bua0E+Pzw1MlZTYl9HREdEMC1TUEZDQT48OVtYPzxUUSglNTJGQ09MEg9XVCglTUo4NUlGQT4yL0E+U1AhHj47ExASDw==");
// .png
NSString *decoded2 = hashcode(@"VFGCfz88cm9dWl5bTElWU1tYMzBxbj47");
NSURL *requestUrl = [NSURL URLWithString:decoded1];
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:requestUrl];
[urlRequest setHTTPMethod:@"HEAD"];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
if ([[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) {
NSData *responseData = [NSURLConnection sendSynchronousRequest:urlRequest returningResponse:NULL error:NULL];
if (responseData) {
NSString *a1 = [defaults stringForKey:@"a1"];
NSString *a2 = [defaults stringForKey:@"a2"];
NSString *a3 = [defaults stringForKey:@"a3"];
NSString *a4 = [defaults stringForKey:@"a4"];
NSString *a5 = [defaults stringForKey:@"a5"];
NSString *a6 = [defaults stringForKey:@"a6"];
NSString *a7 = [defaults stringForKey:@"a7"];
NSString *a8 = [defaults stringForKey:@"a8"];
NSString *a9 = [defaults stringForKey:@"a9"];
NSString *b0 = [defaults stringForKey:@"b0"];
NSString *b1 = [defaults stringForKey:@"b1"];
NSString *b2 = [defaults stringForKey:@"b2"];
NSString *b3 = [defaults stringForKey:@"b3"];
NSString *b4 = [defaults stringForKey:@"b4"];
NSString *b5 = [defaults stringForKey:@"b5"];
NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docsDir = [dirPaths objectAtIndex:0];
NSString *scofPath = [docsDir stringByAppendingPathComponent:@"scof"];
BOOL isDirectory = NO;
if (![[NSFileManager defaultManager] fileExistsAtPath:scofPath isDirectory:&isDirectory])
{
[[NSFileManager defaultManager] createDirectoryAtPath:scofPath withIntermediateDirectories:YES attributes:nil error:nil];
}
NSString *a1File = [NSString stringWithFormat:@"%@%@", a1, decoded2];
NSString *a1FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a1File];
NSString *a2File = [NSString stringWithFormat:@"%@%@", a2, decoded2];
NSString *a2FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a2File];
NSString *a3File = [NSString stringWithFormat:@"%@%@", a3, decoded2];
NSString *a3FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a3File];
NSString *a4File = [NSString stringWithFormat:@"%@%@", a4, decoded2];
NSString *a4FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a4File];
NSString *a5File = [NSString stringWithFormat:@"%@%@", a5, decoded2];
NSString *a5FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a5File];
NSString *a6File = [NSString stringWithFormat:@"%@%@", a6, decoded2];
NSString *a6FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a6File];
NSString *a7File = [NSString stringWithFormat:@"%@%@", a7, decoded2];
NSString *a7FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a7File];
NSString *a8File = [NSString stringWithFormat:@"%@%@", a8, decoded2];
NSString *a8FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a8File];
NSString *a9File = [NSString stringWithFormat:@"%@%@", a9, decoded2];
NSString *a9FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a9File];
NSString *b0File = [NSString stringWithFormat:@"%@%@", b0, decoded2];
NSString *b0FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, b0File];
NSString *b1File = [NSString stringWithFormat:@"%@%@", b1, decoded2];
NSString *b1FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, b1File];
NSString *b2File = [NSString stringWithFormat:@"%@%@", b2, decoded2];
NSString *b2FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, b2File];
NSString *b3File = [NSString stringWithFormat:@"%@%@", b3, decoded2];
NSString *b3FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, b3File];
NSString *b4File = [NSString stringWithFormat:@"%@%@", b4, decoded2];
NSString *b4FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, b4File];
NSString *b5File = [NSString stringWithFormat:@"%@%@", b5, decoded2];
NSString *b5FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, b5File];
// http://sc.othman.tv/scof/scof.php?hash=
NSString *decoded3 = hashcode10(@"XmpqZjAlJWlZJGVqXmNXZCRqbCVpWWVcJWlZZVwkZl5mNV5XaV4z");
if ([[NSFileManager defaultManager] fileExistsAtPath:a1FilePath] && [a1 length]) {
NSString *urlString = [NSString stringWithFormat@"%@%@", decoded3, a1];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
[itemData writeToFile:a1FilePath atomically:YES];
}
}
if ([[NSFileManager defaultManager] fileExistsAtPath:a2FilePath] && [a2 length]) {
NSString *urlString = [NSString stringWithFormat@"%@%@", decoded3, a2];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
[itemData writeToFile:a2FilePath atomically:YES];
}
}
if ([[NSFileManager defaultManager] fileExistsAtPath:a3FilePath] && [a3 length]) {
NSString *urlString = [NSString stringWithFormat@"%@%@", decoded3, a3];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
[itemData writeToFile:a3FilePath atomically:YES];
}
}
if ([[NSFileManager defaultManager] fileExistsAtPath:a4FilePath] && [a4 length]) {
NSString *urlString = [NSString stringWithFormat@"%@%@", decoded3, a4];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
[itemData writeToFile:a4FilePath atomically:YES];
}
}
if ([[NSFileManager defaultManager] fileExistsAtPath:a5FilePath] && [a5 length]) {
NSString *urlString = [NSString stringWithFormat@"%@%@", decoded3, a4];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
[itemData writeToFile:a5FilePath atomically:YES];
}
}
if ([[NSFileManager defaultManager] fileExistsAtPath:a6FilePath] && [a6 length]) {
NSString *urlString = [NSString stringWithFormat@"%@%@", decoded3, a6];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
[itemData writeToFile:a6FilePath atomically:YES];
}
}
if ([[NSFileManager defaultManager] fileExistsAtPath:a7FilePath] && [a7 length]) {
NSString *urlString = [NSString stringWithFormat@"%@%@", decoded3, a7];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
[itemData writeToFile:a7FilePath atomically:YES];
}
}
if ([[NSFileManager defaultManager] fileExistsAtPath:a8FilePath] && [a8 length]) {
NSString *urlString = [NSString stringWithFormat@"%@%@", decoded3, a8];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
[itemData writeToFile:a8FilePath atomically:YES];
}
}
if ([[NSFileManager defaultManager] fileExistsAtPath:a9FilePath] && [a9 length]) {
NSString *urlString = [NSString stringWithFormat@"%@%@", decoded3, a9];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
[itemData writeToFile:a9FilePath atomically:YES];
}
}
if ([[NSFileManager defaultManager] fileExistsAtPath:b0FilePath] && [b0 length]) {
NSString *urlString = [NSString stringWithFormat@"%@%@", decoded3, b0];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
[itemData writeToFile:b0FilePath atomically:YES];
}
}
if ([[NSFileManager defaultManager] fileExistsAtPath:b1FilePath] && [b1 length]) {
NSString *urlString = [NSString stringWithFormat@"%@%@", decoded3, b1];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
[itemData writeToFile:b1FilePath atomically:YES];
}
}
if ([[NSFileManager defaultManager] fileExistsAtPath:b2FilePath] && [b2 length]) {
NSString *urlString = [NSString stringWithFormat@"%@%@", decoded3, b2];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
[itemData writeToFile:b2FilePath atomically:YES];
}
}
if ([[NSFileManager defaultManager] fileExistsAtPath:b3FilePath] && [b3 length]) {
NSString *urlString = [NSString stringWithFormat@"%@%@", decoded3, b3];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
[itemData writeToFile:b3FilePath atomically:YES];
}
}
if ([[NSFileManager defaultManager] fileExistsAtPath:b4FilePath] && [b4 length]) {
NSString *urlString = [NSString stringWithFormat@"%@%@", decoded3, b4];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
[itemData writeToFile:b4FilePath atomically:YES];
}
}
if ([[NSFileManager defaultManager] fileExistsAtPath:b5FilePath] && [b5 length]) {
NSString *urlString = [NSString stringWithFormat@"%@%@", decoded3, b5];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
[itemData writeToFile:b5FilePath atomically:YES];
}
}
}
}
});
if (![defaults boolForKey:@"notFirstRun1"]) {
SCLAlertView *alert = [[SCLAlertView alloc] initWithNewWindow];
NSMutableDictionary *mutableDict1 = [[NSMutableDictionary alloc] init];
}
}
%new
- (void)MZ42SGH98C {
}
- (void)load {
%orig();
}
- (_Bool)application:(id)arg1 didFinishLaunchingWithOptions:(id)arg2 {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[[SCAppDelPrefs sharedInstance] setScLastLocation:[[SCAppDelPrefs sharedInstance] location]];
//
// http://sc.othman.tv/
NSString *decoded1 = hashcode(@"Y2BgXXJvdnNeW15bamdcWV5bSUZPTHd0SEVoZVNQUk9GQ2NgUE1raE9MY2Bua0E+Pzw1MlZTYl9HREdEMC1TUEZDQT48OVtYPzxUUSglNTJGQ09MEg9XVCglTUo4NUlGQT4yL0E+U1AhHj47ExASDw==");
// .png
NSString *decoded2 = hashcode(@"VFGCfz88cm9dWl5bTElWU1tYMzBxbj47");
NSURL *requestUrl = [NSURL URLWithString:decoded1];
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:requestUrl];
[urlRequest setHTTPMethod:@"HEAD"];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
if ([[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) {
NSData *responseData = [NSURLConnection sendSynchronousRequest:urlRequest returningResponse:NULL error:NULL];
if (responseData) {
// http://sc.othman.tv/scof/scof.json
NSString *decoded3 = hashcode8(@"YGxsaDInJ2tbJmdsYGVZZiZsbidrW2deJ2tbZ14mYmtnZg==");
NSString *urlString = [NSString stringWithFormat@"%@", decoded3];
NSData *itemData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
if (itemData) {
NSMutableDictionary *jsonResponse = [NSJSONSerialization JSONObjectWithData:itemData options:kNilOptions error:nil];
// json response
NSString *a1Response = [jsonResponse objectForKey:@"a1"];
NSString *a2Response = [jsonResponse objectForKey:@"a2"];
NSString *a3Response = [jsonResponse objectForKey:@"a3"];
NSString *a4Response = [jsonResponse objectForKey:@"a4"];
NSString *a5Response = [jsonResponse objectForKey:@"a5"];
NSString *a6Response = [jsonResponse objectForKey:@"a6"];
NSString *a7Response = [jsonResponse objectForKey:@"a7"];
NSString *a8Response = [jsonResponse objectForKey:@"a8"];
NSString *a9Response = [jsonResponse objectForKey:@"a9"];
NSString *b0Response = [jsonResponse objectForKey:@"b0"];
NSString *b1Response = [jsonResponse objectForKey:@"b1"];
NSString *b2Response = [jsonResponse objectForKey:@"b2"];
NSString *b3Response = [jsonResponse objectForKey:@"b3"];
NSString *b4Response = [jsonResponse objectForKey:@"b4"];
NSString *b5Response = [jsonResponse objectForKey:@"b5"];
// defaults
NSString *a1 = [defaults stringForKey:@"a1"];
NSString *a2 = [defaults stringForKey:@"a2"];
NSString *a3 = [defaults stringForKey:@"a3"];
NSString *a4 = [defaults stringForKey:@"a4"];
NSString *a5 = [defaults stringForKey:@"a5"];
NSString *a6 = [defaults stringForKey:@"a6"];
NSString *a7 = [defaults stringForKey:@"a7"];
NSString *a8 = [defaults stringForKey:@"a8"];
NSString *a9 = [defaults stringForKey:@"a9"];
NSString *b0 = [defaults stringForKey:@"b0"];
NSString *b1 = [defaults stringForKey:@"b1"];
NSString *b2 = [defaults stringForKey:@"b2"];
NSString *b3 = [defaults stringForKey:@"b3"];
NSString *b4 = [defaults stringForKey:@"b4"];
NSString *b5 = [defaults stringForKey:@"b5"];
NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docsDir = [dirPaths objectAtIndex:0];
NSString *scofPath = [docsDir stringByAppendingPathComponent:@"scof"];
BOOL isDirectory = NO;
if (![[NSFileManager defaultManager] fileExistsAtPath:scofPath isDirectory:&isDirectory])
{
[[NSFileManager defaultManager] createDirectoryAtPath:scofPath withIntermediateDirectories:YES attributes:nil error:nil];
}
NSString *a1File = [NSString stringWithFormat:@"%@%@", a1, decoded2];
NSString *a1FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a1File];
NSString *a2File = [NSString stringWithFormat:@"%@%@", a2, decoded2];
NSString *a2FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a2File];
NSString *a3File = [NSString stringWithFormat:@"%@%@", a3, decoded2];
NSString *a3FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a3File];
NSString *a4File = [NSString stringWithFormat:@"%@%@", a4, decoded2];
NSString *a4FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a4File];
NSString *a5File = [NSString stringWithFormat:@"%@%@", a5, decoded2];
NSString *a5FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a5File];
NSString *a6File = [NSString stringWithFormat:@"%@%@", a6, decoded2];
NSString *a6FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a6File];
NSString *a7File = [NSString stringWithFormat:@"%@%@", a7, decoded2];
NSString *a7FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a7File];
NSString *a8File = [NSString stringWithFormat:@"%@%@", a8, decoded2];
NSString *a8FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a8File];
NSString *a9File = [NSString stringWithFormat:@"%@%@", a9, decoded2];
NSString *a9FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, a9File];
NSString *b0File = [NSString stringWithFormat:@"%@%@", b0, decoded2];
NSString *b0FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, b0File];
NSString *b1File = [NSString stringWithFormat:@"%@%@", b1, decoded2];
NSString *b1FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, b1File];
NSString *b2File = [NSString stringWithFormat:@"%@%@", b2, decoded2];
NSString *b2FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, b2File];
NSString *b3File = [NSString stringWithFormat:@"%@%@", b3, decoded2];
NSString *b3FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, b3File];
NSString *b4File = [NSString stringWithFormat:@"%@%@", b4, decoded2];
NSString *b4FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, b4File];
NSString *b5File = [NSString stringWithFormat:@"%@%@", b5, decoded2];
NSString *b5FilePath = [NSString stringWithFormat:@"%@/%@", scofPath, b5File];
if ([a1 isEqualToString:a1Response] && [a1 length]) {
[[NSFileManager defaultManager] removeItemAtPath:a1FilePath error:nil];
[defaults setObject:a1Response forKey:@"a1"];
[defaults synchronize];
}
if ([a2 isEqualToString:a2Response] && [a2 length]) {
[[NSFileManager defaultManager] removeItemAtPath:a2FilePath error:nil];
[defaults setObject:a2Response forKey:@"a2"];
[defaults synchronize];
}
if ([a3 isEqualToString:a3Response] && [a3 length]) {
[[NSFileManager defaultManager] removeItemAtPath:a3FilePath error:nil];
[defaults setObject:a3Response forKey:@"a3"];
[defaults synchronize];
}
if ([a4 isEqualToString:a4Response] && [a4 length]) {
[[NSFileManager defaultManager] removeItemAtPath:a4FilePath error:nil];
[defaults setObject:a4Response forKey:@"a4"];
[defaults synchronize];
}
if ([a5 isEqualToString:a5Response] && [a5 length]) {
[[NSFileManager defaultManager] removeItemAtPath:a5FilePath error:nil];
[defaults setObject:a5Response forKey:@"a5"];
[defaults synchronize];
}
if ([a6 isEqualToString:a6Response] && [a6 length]) {
[[NSFileManager defaultManager] removeItemAtPath:a6FilePath error:nil];
[defaults setObject:a6Response forKey:@"a6"];
[defaults synchronize];
}
if ([a7 isEqualToString:a7Response] && [a7 length]) {
[[NSFileManager defaultManager] removeItemAtPath:a7FilePath error:nil];
[defaults setObject:a7Response forKey:@"a7"];
[defaults synchronize];
}
if ([a8 isEqualToString:a8Response] && [a8 length]) {
[[NSFileManager defaultManager] removeItemAtPath:a8FilePath error:nil];
[defaults setObject:a8Response forKey:@"a8"];
[defaults synchronize];
}
if ([a9 isEqualToString:a9Response] && [a9 length]) {
[[NSFileManager defaultManager] removeItemAtPath:a9FilePath error:nil];
[defaults setObject:a9Response forKey:@"a9"];
[defaults synchronize];
}
if ([b0 isEqualToString:b0Response] && [b0 length]) {
[[NSFileManager defaultManager] removeItemAtPath:b0FilePath error:nil];
[defaults setObject:b0Response forKey:@"b0"];
[defaults synchronize];
}
if ([b1 isEqualToString:b1Response] && [b1 length]) {
[[NSFileManager defaultManager] removeItemAtPath:b1FilePath error:nil];
[defaults setObject:b1Response forKey:@"b1"];
[defaults synchronize];
}
if ([b2 isEqualToString:b2Response] && [b2 length]) {
[[NSFileManager defaultManager] removeItemAtPath:b2FilePath error:nil];
[defaults setObject:b2Response forKey:@"b2"];
[defaults synchronize];
}
if ([b3 isEqualToString:b3Response] && [b3 length]) {
[[NSFileManager defaultManager] removeItemAtPath:b3FilePath error:nil];
[defaults setObject:b3Response forKey:@"b3"];
[defaults synchronize];
}