-
Notifications
You must be signed in to change notification settings - Fork 24
/
rc.sh
2563 lines (2294 loc) · 101 KB
/
rc.sh
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
#!/bin/sh
#
# Rasticrac v3.2.5 (july 2015)
#
# Rapid Advanced Secure Thorough Intelligent Gaulish Nuclear Acclaimed Cracker
# Rapide Avancé Securisé Tout-terrain Intelligent Gaulois Nucléaire Approfondi Craqueur
#
# Home/Help/Donate: https://twitter.com/iRastignac
#
# ======
# Please, customize the script first!
# Choices are:
# - Default language (US:english, FR:french, ES:spanish, DE:german, IT:italian)
RClang="US"
#RClang="FR1"
#RClang="FR2"
#RClang="ES1"
#RClang="ES2"
#RClang="DE1"
#RClang="DE2"
#RClang="IT1"
#RClang="IT2"
#RClang="VN1"
#RClang="VN2"
# - Default CrackerName (or "Anonymous").
RCcracker="Anonymous"
# - Should "extra details" appear in ipa's filename? (ie: "iPad / 3GS / etc") (You can hate them)
RCextras="YES"
# - Display graphical progress bars? (based on number and/or size of apps) ("by size" is a bit slower)
RCbarNum="YES"
RCbarSize="YES"
# - Should display be verbose? (verbose is messier and a bit slower)
RCverbose="NO"
# - Should script talk to you? (only with iOS4/5/6, only with "speak" tool from Cydia)
RCspeak="YES"
# - Should artist's name be used in ipa's filename?
RCartistfrommeta="YES"
# - Should itemId be used in filename?
RCitemId="NO"
# - Should menu display 'real name' of apps? (slower, slower, and strange sort order)
RCrealnamemenu="NO"
# - Default compression level is blank (aka "-6"), and is the best speed/size ratio.
# - Recommended. Upload/download/storage will be good.
RCcompression=""
# - Maximum compression ("-9") (also "-8" or "-7") is slower, but size is the best.
# - If your iDevice is fast, if you're not in a hurry, if size matters. Best upload/download/storage.
#RCcompression="-9"
# - Minimum compression ("-2") (also "-3" to "-5") is way faster, but size is way worse.
# - Upload/download/storage will be worse. (other tools like CrackTM or Clutch or Crackulous use "-2").
# - With "-2", RC will be as fast as the others.
#RCcompression="-2"
# - Don't use "-1" (sloppy) or "-0" (store), as size will be horrible, and all will suffer. Avoid.
# - Should I generate fake MetaData or not?
# (Some people hate them, some love them, some protections check them; you should really keep them)
RCmetadata="YES"
# - Should I try LamestPatchest on the executable?
# (It won't work 100%, but sometimes it really helps) (and now it's very very fast) (you should keep it)
RClamestpatchest="YES"
# - Which menu dots do you prefer?
RCdots=".............................."
#RCdots="------------------------------"
#RCdots=" "
#RCdots="______________________________"
# Progress bar display
RCxxx="====="
RCsss="-----"
# Various
readonly RCversion="325"
readonly cami="/var/mobile/Library/Caches/com.apple.mobile.installation.plist"
readonly cali="/private/var/db/lsd/com.apple.lsdidentifiers.plist"
readonly lsd="/tmp/lsd.tmp"
readonly RooRoo="/var/root/RCtemp"
# DEBUG ONLY: - Force the "this script is running inside a GUI" check?
RCinaGUI="NEVER"
# DEBUG ONLY: - Check only (all tested but Ipa not created)
RCcheck="NEVER"
# Thanks you for testing.
# ======
# ======
function SelectLanguage
{
# Language US
if [ $RClang = "US" ]; then
MsgAnaAppl="Analyzing application"
MsgAppLoca="Locating"
MsgBadChoi="Bad choice"
MsgBldMenu="Building menu..."
MsgBrzMode="Berzerk mode: cracking ALL"
MsgBrzNoth="nothing"
MsgCntFind="Cannot find"
MsgCopArtw="Copying Artwork"
MsgCopExec="and copying executable"
MsgCreDire="Creating directories"
MsgDskFull="Disk full"
MsgEraMemo="Erasing memory file"
MsgErrrors="Errors"
MsgFakMeta="and faking MetaData"
MsgFoundIt="Found"
MsgInsCydi="Install from Cydia"
MsgIpaDone="Done as"
MsgIpaInco="Incomplete .ipa"
MsgMarDone="Marking all apps done"
MsgMnuEmpt="empty"
MsgNotMeta="and no MetaData"
MsgRemTemp="Removing temporary files"
MsgSgnAppl="Signing the application"
MsgSizUnit="B"
MsgUnaLoca="Unable to locate"
MsgWarning="Warning"
MsgWasAskd="Asked"
MsgWrgChoi="Wrong choice"
MsgWrnMeta="iTunesMetadata format changed"
MsgYouChoi="Your choices"
MsgZipStep="Compressing the .ipa (step"
MsgMrkDone="Mark all done "
MskZroDone="Reset done list "
fi
# Language FR1 or FR2
if [ $RClang = "FR1" -o $RClang = "FR2" ]; then
MsgAnaAppl="Analyse d'application"
MsgAppLoca="Recherche"
MsgBldMenu="Construction du menu..."
MsgBrzMode="Mode Berzerk: on craque TOUT"
MsgCntFind="Introuvable:"
MsgDskFull="Disque plein"
MsgInsCydi="Installer avec Cydia"
MsgMnuEmpt="vide"
MsgRemTemp="Effacement fichiers temporaires"
MsgSizUnit="o"
MsgUnaLoca="Impossible de trouver"
MsgWrgChoi="Mauvais choix"
MsgWarning="Attention"
MsgWrnMeta="nouveau format d'iTunesMetadata"
MsgYouChoi="Votre choix"
MsgSgnAppl="Signature de l'application"
MsgCopArtw="Copie de l'Artwork"
MsgFakMeta="et fausses MetaData"
MsgNotMeta="et pas de MetaData"
MsgWasAskd="Voulu"
MsgErrrors="Erreurs"
MsgBrzNoth="rien"
MsgMrkDone="Tout marquer fait "
MskZroDone="Effacer liste fait "
fi
# Language FR1 (ascii)
if [ $RClang = "FR1" ]; then
MsgBadChoi="$( echo -ne "Choix erron\0351" )"
MsgCopExec="$( echo -ne "& copie de l'ex\0351cutable" )"
MsgCreDire="$( echo -ne "Cr\0351ation r\0351pertoires" )"
MsgIpaInco="$( echo -ne "Ipa incompl\0350te" )"
MsgEraMemo="$( echo -ne "Effacement fichier m\0351moire" )"
MsgIpaDone="$( echo -ne "R\0351sultat:" )"
MsgMarDone="$( echo -ne "Toutes les apps sont marqu\0351es comme trait\0351es" )"
MsgZipStep="$( echo -ne "Compression de l'ipa (\0351tape" )"
MsgFoundIt="$( echo -ne "Trouv\0351" )"
fi
# Language FR2 (utf8)
if [ $RClang = "FR2" ]; then
MsgBadChoi="$( echo -ne "Choix erron\0303\0251" )"
MsgCopExec="$( echo -ne "& copie de l'ex\0303\0251cutable" )"
MsgCreDire="$( echo -ne "Cr\0303\0251ation r\0303\0251pertoires" )"
MsgIpaInco="$( echo -ne "Ipa incompl\0303\0250te" )"
MsgEraMemo="$( echo -ne "Effacement fichier m\0303\0251moire" )"
MsgIpaDone="$( echo -ne "R\0303\0251sultat:" )"
MsgMarDone="$( echo -ne "Toutes les apps sont marqu\0303\0251es comme trait\0303\0251es" )"
MsgZipStep="$( echo -ne "Compression de l'ipa (\0303\0251tape" )"
MsgFoundIt="$( echo -ne "Trouv\0303\0251" )"
fi
# Language ES1 or ES2
if [ $RClang = "ES1" -o $RClang = "ES2" ]; then
MsgBrzMode="Modo Berzerk: crackando TODO"
MsgCntFind="No encontro"
MsgCopExec="y copiando ejecutable"
MsgCreDire="Creando directorios"
MsgEraMemo="Borrado memoria archivo"
MsgInsCydi="Instalarlo desde Cydia"
MsgIpaDone="Done as"
MsgMarDone="Marcando todas aplicaciones como 'hecho'"
MsgRemTemp="Borrando archivos temporales"
MsgSizUnit="B"
MsgUnaLoca="Incapaz de ubicar"
MsgWarning="Warning"
MsgWrnMeta="iTunesMetadata formato cambiado"
MsgCopArtw="Copiando Artwork"
MsgFakMeta="y fingiendo MetaData"
MsgNotMeta="y no MetaData"
MsgFoundIt="Found"
MsgWasAskd="Asked"
MsgErrrors="Errores"
MsgBrzNoth="nada"
MsgMrkDone="Marcar todas hechas "
MskZroDone="Vaciar lista hechas "
fi
# Language ES1 (ascii)
if [ $RClang = "ES1" ]; then
MsgAnaAppl="$( echo -ne "Analizando aplicaci\0363n" )"
MsgAppLoca="$( echo -ne "Ubicaci\0363n" )"
MsgBadChoi="$( echo -ne "Mala elecci\0363n" )"
MsgBldMenu="$( echo -ne "Construyendo men\0372..." )"
MsgIpaInco="$( echo -ne "\0241 Incompleta .ipa" )"
MsgDskFull="$( echo -ne "\0277 Disco lleno" )"
MsgMnuEmpt="$( echo -ne "vac\0355o" )"
MsgWrgChoi="$( echo -ne "Opci\0363n incorrecta" )"
MsgYouChoi="$( echo -ne "\0277 Su elecci\0363" )"
MsgZipStep="$( echo -ne "Compresi\0363n de .ipa (paso" )"
MsgSgnAppl="$( echo -ne "Firma de la aplicaci\0363n" )"
fi
# Language ES2 (utf8)
if [ $RClang = "ES2" ]; then
MsgAnaAppl="$( echo -ne "Analizando aplicaci\0303\0263n" )"
MsgAppLoca="$( echo -ne "Ubicaci\0303\0263n" )"
MsgBadChoi="$( echo -ne "Mala elecci\0303\0263n" )"
MsgBldMenu="$( echo -ne "Construyendo men\0303\0272..." )"
MsgIpaInco="$( echo -ne "\0302\0241 Incompleta .ipa" )"
MsgDskFull="$( echo -ne "\0302\0277 Disco lleno" )"
MsgMnuEmpt="$( echo -ne "vac\0303\0255o" )"
MsgWrgChoi="$( echo -ne "Opci\0303\0263n incorrecta" )"
MsgYouChoi="$( echo -ne "\0302\0277 Su elecci\0303\0263" )"
MsgZipStep="$( echo -ne "Compresi\0303\0263n de .ipa (paso" )"
MsgSgnAppl="$( echo -ne "Firma de la aplicaci\0303\0263n" )"
fi
# Language DE1 or DE2. Translation by Ushnak.
if [ $RClang = "DE1" -o $RClang = "DE2" ]; then
MsgAnaAppl="Analyse der App"
MsgAppLoca="Suche"
MsgBrzMode="Berzerker Modus: ALLES wird gecrackt"
MsgCntFind="Nicht aufzufinden:"
MsgCopExec="Kopieren der Executable"
MsgCreDire="Erstellen der Ordner"
MsgDskFull="Kein Speicher mehr"
MsgInsCydi="Installieren mit Cydia"
MsgIpaDone="Fertig"
MsgMnuEmpt="leer"
MsgMarDone="Alle Apps als gecrackt markieren"
MsgSizUnit="B"
MsgWrgChoi="Schlechte Wahl"
MsgWarning="Warnung"
MsgYouChoi="Ihre Wahl"
MsgZipStep="Kompression der .ipa (Schritt"
MsgSgnAppl="Signieren der App"
MsgCopArtw="Kopieren des Artworks"
MsgFakMeta="und der falschen MetaData"
MsgNotMeta="und keine MetaData"
MsgFoundIt="Gefunden"
MsgWasAskd="Angefragt"
MsgErrrors="Fehler"
MsgBrzNoth="Nichts"
fi
# Language DE1 (ascii). Translation by Ushnak.
if [ $RClang = "DE1" ]; then
MsgBadChoi="$( echo -ne "Ung\0374ltige Wahl" )"
MsgBldMenu="$( echo -ne "Aufbau des Men\0374s..." )"
MsgIpaInco="$( echo -ne "Unvollst\0344ndige .ipa" )"
MsgEraMemo="$( echo -ne "L\0366schen des Zwischenspeichers" )"
MsgRemTemp="$( echo -ne "L\0366schen des Speichers" )"
MsgUnaLoca="$( echo -ne "Unm\0366glich zu Finden" )"
MsgWrnMeta="$( echo -ne "Das Format der iTunesMetaData wurde ge\0344ndert" )"
MsgMrkDone="$( echo -ne "Alles als angew\0344hlt " )"
MskZroDone="$( echo -ne "Liste der angew\0344hlten l\0366schen " )"
fi
# Language DE2 (utf8). Translation by Ushnak.
if [ $RClang = "DE2" ]; then
MsgBadChoi="$( echo -ne "Ung\0303\0274ltige Wahl" )"
MsgBldMenu="$( echo -ne "Aufbau des Men\0303\0274s..." )"
MsgIpaInco="$( echo -ne "Unvollst\0303\0244ndige .ipa" )"
MsgEraMemo="$( echo -ne "L\0303\0266schen des Zwischenspeichers" )"
MsgRemTemp="$( echo -ne "L\0303\0266schen des Speichers" )"
MsgUnaLoca="$( echo -ne "Unm\0303\0266glich zu Finden" )"
MsgWrnMeta="$( echo -ne "Das Format der iTunesMetaData wurde ge\0303\0244ndert" )"
MsgMrkDone="$( echo -ne "Alles als angew\0303\0244hlt " )"
MskZroDone="$( echo -ne "Liste der angew\0303\0244hlten l\0303\0266schen " )"
fi
# Language IT1 and IT2. Translation by Wfede21.
if [ $RClang = "IT1" -o $RClang = "IT2" ]; then
MsgAnaAppl="Analisi applicazione"
MsgAppLoca="Localizzo"
MsgBadChoi="Scelta sbagliata"
MsgBldMenu="Costruisco il menu..."
MsgCntFind="Impossibile trovare"
MsgCopExec="e copio l'eseguibile"
MsgCreDire="Creo le cartelle"
MsgIpaInco=".ipa non completa"
MsgDskFull="Memoria piena"
MsgEraMemo="Cancellando file di memoria"
MsgInsCydi="Installa da Cydia"
MsgIpaDone="Fatto come"
MsgMnuEmpt="vuoto"
MsgMarDone="Tutte le app craccate"
MsgRemTemp="Rimozione file temporanei"
MsgSizUnit="B"
MsgUnaLoca="Impossibile trovare"
MsgWrgChoi="Scelta sbagliata"
MsgWarning="Attenzione"
MsgWrnMeta="formato iTunesMetadata cambiato"
MsgYouChoi="La tua scelta"
MsgZipStep="Compressione .ipa (passo"
MsgSgnAppl="Signing the application"
MsgCopArtw="Copia di Artwork"
MsgFakMeta="e falsifico MetaData"
MsgNotMeta="e niente MetaData"
MsgFoundIt="Trovato"
MsgWasAskd="Chiesto"
MsgErrrors="Errore"
MsgBrzNoth="niente"
MsgMrkDone="Segna come tutte craccate "
MskZroDone="Azzera lista app craccate "
fi
# Language IT1 (ascii). Translation by Wfede21.
if [ $RClang = "IT1" ]; then
MsgBrzMode="$( echo -ne "Modalit\0340 Berzerk: crack di tutte le app" )"
fi
# Language IT2 (utf8). Translation by Wfede21.
if [ $RClang = "IT2" ]; then
MsgBrzMode="$( echo -ne "Modalit\0303\0240 Berzerk: crack di tutte le app" )"
fi
# Language VN. Soon. Translation by Lamapple.
if [ $RClang = "VN1" ]; then
MsgAnaAppl="$( echo -ne "\020\01ang Ph\0342n t\0355ch \0350\036ng d\0345\036ng" )"
MsgAppLoca="$( echo -ne "\020\01ang \021\01\0313\036nh v\0313\036" )"
MsgBadChoi="$( echo -ne "L\0361\036a ch\0315\036n t\0307\036" )"
MsgBldMenu="$( echo -ne "\020\01ang t\0241\036o menu..." )"
MsgBrzMode="$( echo -ne "Ch\0277\036 \021\01\0331\036 Berzerk: \020\01ang crack t\0245\036t c\0243\036" )"
MsgBrzNoth="$( echo -ne "Kh\0364ng c\0363 g\0354" )"
MsgCntFind="$( echo -ne "Kh\0364ng t\0354m th\0245\036y" )"
MsgCopArtw="$( echo -ne "\020\01ang sao ch\0351p \0242\036nh minh h\0315\036a" )"
MsgCopExec="$( echo -ne "v\0340 \021\01ang sao ch\0351p th\0361\036c thi" )"
MsgCreDire="$( echo -ne "\020\01ang t\0241\036o th\0260\01 m\0345\036c" )"
MsgDskFull="$( echo -ne "B\0331\036 nh\0333\036 \021\01\0247\036y" )"
MsgEraMemo="$( echo -ne "\020\01ang xo\0341 t\0255\036p tin b\0331\036 nh\0333\036" )"
MsgErrrors="$( echo -ne "L\0327\036i" )"
MsgFakMeta="$( echo -ne "v\0340 \021\01ang gi\0243\036 m\0241\036o MetaData" )"
MsgFoundIt="$( echo -ne "T\0354m th\0245\036y" )"
MsgInsCydi="$( echo -ne "C\0340i\021\01\0267\036t t\0353\036 Cydia" )"
MsgIpaDone="$( echo -ne "Th\0361\036c hi\0307\036n nh\0260\01" )"
MsgIpaInco="$( echo -ne "Ch\0260\01a ho\0340n th\0340nh .ipa" )"
MsgMarDone="$( echo -ne "\020\01\0341nh d\0245\036u t\0245\036t c\0243\036 c\0341c \0351\036ng d\0345\036ng \021\01\0260\01\0343\036c th\0361\036c hi\0307\036n" )"
MsgMnuEmpt="$( echo -ne "Tr\0321\036ng" )"
MsgNotMeta="$( echo -ne "v\0340 kh\0364ng c\0363 MetaData" )"
MsgRemTemp="$( echo -ne "\020\01ang lo\0241\036i b\0317\036 c\0341c t\0255\036p tin t\0241\036m th\0335\036i" )"
MsgSgnAppl="$( echo -ne "\020\01ang Sign c\0341c \0351\036ng d\0345\036ng" )"
MsgSizUnit="B"
MsgUnaLoca="$( echo -ne "Kh\0364ng th\0245\036y \021\01\0260\01\0335\036ng d\0253\036n" )"
MsgWarning="$( echo -ne "C\0243\036nh b\0341o" )"
MsgWasAskd="$( echo -ne "H\0317\036i" )"
MsgWrgChoi="$( echo -ne "L\0361\036a ch\0315\036n sai" )"
MsgWrnMeta="$( echo -ne "\020\01\0313\036nh d\0241\036ng iTunesMetadata \021\01\0343 thay \021\01\0325\036i" )"
MsgYouChoi="$( echo -ne "L\0361\036a ch\0315\036n c\0347\036a b\0241\036n" )"
MsgZipStep="$( echo -ne "\020\01ang n\0351n c\0341c .ipa (b\0260\01\0333\036c" )"
MsgMrkDone="$( echo -ne "\020\01\0341nh d\0245\036u t\0245\036t c\0243\036 \021\01\0260\01\0343\036c th\0361\036c hi\0307\036n " )"
MskZroDone="$( echo -ne "\020\01\0267\036t l\0241\036i danh s\0341ch \021\01\0260\01\0343\036c th\0361\036c hi\0307\036n " )"
fi
if [ $RClang = "VN2" ]; then
MsgAnaAppl="$( echo -ne "\0304\0220ang Ph\0303\0242n t\0303\0255ch \0341\0273\0250ng d\0341\0273\0245ng" )"
MsgAppLoca="$( echo -ne "\0304\0220ang \0304\0221\0341\0273\0213nh v\0341\0273\0213" )"
MsgBadChoi="$( echo -ne "L\0341\0273\0261a ch\0341\0273\0215n t\0341\0273\0207" )"
MsgBldMenu="$( echo -ne "\0304\0220ang t\0341\0272\0241o menu..." )"
MsgBrzMode="$( echo -ne "Ch\0341\0272\0277 \0304\0221\0341\0273\0231 Berzerk: \0304\0220ang crack t\0341\0272\0245t c\0341\0272\0243" )"
MsgBrzNoth="$( echo -ne "Kh\0303\0264ng c\0303\0263 g\0303\0254" )"
MsgCntFind="$( echo -ne "Kh\0303\0264ng t\0303\0254m th\0341\0272\0245y" )"
MsgCopArtw="$( echo -ne "\0304\0220ang sao ch\0303\0251p \0341\0272\0242nh minh h\0341\0273\0215a" )"
MsgCopExec="$( echo -ne "v\0303\0240 \0304\0221ang sao ch\0303\0251p th\0341\0273\0261c thi" )"
MsgCreDire="$( echo -ne "\0304\0220ang t\0341\0272\0241o th\0306\0260 m\0341\0273\0245c" )"
MsgDskFull="$( echo -ne "B\0341\0273\0231 nh\0341\0273\0233 \0304\0221\0341\0272\0247y" )"
MsgEraMemo="$( echo -ne "\0304\0220ang xo\0303\0241 t\0341\0272\0255p tin b\0341\0273\0231 nh\0341\0273\0233" )"
MsgErrrors="$( echo -ne "L\0341\0273\0227i" )"
MsgFakMeta="$( echo -ne "v\0303\0240 \0304\0221ang gi\0341\0272\0243 m\0341\0272\0241o MetaData" )"
MsgFoundIt="$( echo -ne "T\0303\0254m th\0341\0272\0245y" )"
MsgInsCydi="$( echo -ne "C\0303\0240i\0304\0221\0341\0272\0267t t\0341\0273\0253 Cydia" )"
MsgIpaDone="$( echo -ne "Th\0341\0273\0261c hi\0341\0273\0207n nh\0306\0260" )"
MsgIpaInco="$( echo -ne "Ch\0306\0260a ho\0303\0240n th\0303\0240nh .ipa" )"
MsgMarDone="$( echo -ne "\0304\0220\0303\0241nh d\0341\0272\0245u t\0341\0272\0245t c\0341\0272\0243 c\0303\0241c \0341\0273\0251ng d\0341\0273\0245ng \0304\0221\0306\0260\0341\0273\0243c th\0341\0273\0261c hi\0341\0273\0207n" )"
MsgMnuEmpt="$( echo -ne "Tr\0341\0273\0221ng" )"
MsgNotMeta="$( echo -ne "v\0303\0240 kh\0303\0264ng c\0303\0263 MetaData" )"
MsgRemTemp="$( echo -ne "\0304\0220ang lo\0341\0272\0241i b\0341\0273\0217 c\0303\0241c t\0341\0272\0255p tin t\0341\0272\0241m th\0341\0273\0235i" )"
MsgSgnAppl="$( echo -ne "\0304\0220ang Sign c\0303\0241c \0341\0273\0251ng d\0341\0273\0245ng" )"
MsgSizUnit="B"
MsgUnaLoca="$( echo -ne "Kh\0303\0264ng th\0341\0272\0245y \0304\0221\0306\0260\0341\0273\0235ng d\0341\0272\0253n" )"
MsgWarning="$( echo -ne "C\0341\0272\0243nh b\0303\0241o" )"
MsgWasAskd="$( echo -ne "H\0341\0273\0217i" )"
MsgWrgChoi="$( echo -ne "L\0341\0273\0261a ch\0341\0273\0215n sai" )"
MsgWrnMeta="$( echo -ne "\0304\0220\0341\0273\0213nh d\0341\0272\0241ng iTunesMetadata \0304\0221\0303\0243 thay \0304\0221\0341\0273\0225i" )"
MsgYouChoi="$( echo -ne "L\0341\0273\0261a ch\0341\0273\0215n c\0341\0273\0247a b\0341\0272\0241n" )"
MsgZipStep="$( echo -ne "\0304\0220ang n\0303\0251n c\0303\0241c .ipa (b\0306\0260\0341\0273\0233c" )"
MsgMrkDone="$( echo -ne "\0304\0220\0303\0241nh d\0341\0272\0245u t\0341\0272\0245t c\0341\0272\0243 \0304\0221\0306\0260\0341\0273\0243c th\0341\0273\0261c hi\0341\0273\0207n " )"
MskZroDone="$( echo -ne "\0304\0220\0341\0272\0267t l\0341\0272\0241i danh s\0303\0241ch \0304\0221\0306\0260\0341\0273\0243c th\0341\0273\0261c hi\0341\0273\0207n " )"
fi
}
# ======
function UnicodeToHuman
{
# Convert from unicode to human, and remove unwanted chars
human=$(echo -n "$unicode" | sed -e "s: :_:g" | od -c -A n -v --width=999 | sed \
-e 's:+:Plus:g' \
-e 's:302.240:_:g' \
-e 's:302.251:_:g' \
-e 's:302.256:_:g' \
-e 's:302.260:Degree:g' \
-e "s:302.264:':g" \
-e 's:303.201:A:g' \
-e 's:303.207:C:g' \
-e 's:303.211:E:g' \
-e 's:303.216:I:g' \
-e 's:303.224:O:g' \
-e 's:303.234:U:g' \
-e 's:303.237:B:g' \
-e 's:303.240:a:g' \
-e 's:303.241:a:g' \
-e 's:303.242:a:g' \
-e 's:303.245:a:g' \
-e 's:303.247:c:g' \
-e 's:303.250:e:g' \
-e 's:303.251:e:g' \
-e 's:303.252:e:g' \
-e 's:303.253:e:g' \
-e 's:303.255:i:g' \
-e 's:303.256:i:g' \
-e 's:303.257:i:g' \
-e 's:303.263:o:g' \
-e 's:303.264:o:g' \
-e 's:303.266:o:g' \
-e 's:303.270:o:g' \
-e 's:303.271:u:g' \
-e 's:303.273:u:g' \
-e 's:303.274:u:g' \
-e 's:304.237:g:g' \
-e 's:304.261:i:g' \
-e 's:305.215:o:g' \
-e 's:305.223:oe:g' \
-e 's:312.236:k:g' \
-e 's:316.251:Omega:g' \
-e 's:342.200.223:-:g' \
-e 's:342.200.224:-:g' \
-e "s:342.200.230:':g" \
-e "s:342.200.231:':g" \
-e 's:342.200.242:-:g' \
-e 's:342.200.246:...:g' \
-e 's:342.202.254:EUR:g' \
-e 's:342.204.242:_:g' \
-e 's:342.210.236:Infinity:g' \
-e 's:342.213.205:.:g' \
-e 's:342.226.272:_:g' \
-e 's:342.227.217:-:g' \
-e 's:342.230.205:_:g' \
-e 's:342.231.253:_:g' \
-e 's:342.235.222:_:g' \
-e 's:347.246.205:_:g' \
| tr -cd "[:alnum:][_'.][-]" | sed -e "s:_: :g" | sed -e "s: : :g" )
# Todo: future enhancements
# Help wanted for unknown or other unicodes
}
# ======
function DisplayBars
{
ProgressPct=""
if [ $RCbarNum = "YES" ]; then
ProgressXXX=$(( $BarCols * $ProgressDone / $ProgressTarget ))
ProgressSSS=$(( $BarCols - $ProgressXXX ))
ProgressPct=$(( 100 * $ProgressDone / $ProgressTarget ))
echo "[${escGreen}${RCxxx:0:$ProgressXXX}${escBlue}${RCsss:0:$ProgressSSS}${escReset}] $ProgressPct%"
fi
if [ $RCbarSize = "YES" ]; then
ProgressXXX=$(( $BarCols * $ProgressDoneSize / $ProgressTargetSize ))
ProgressSSS=$(( $BarCols - $ProgressXXX ))
ProgressPct=$(( 100 * $ProgressDoneSize / $ProgressTargetSize ))
echo "[${escCyan}${RCxxx:0:$ProgressXXX}${escBlue}${RCsss:0:$ProgressSSS}${escReset}] $ProgressPct%"
fi
if [ ! -z "$ProgressPct" -a $RCspeak = "YES" ]; then
su mobile -c "speak $ProgressPct %" &
fi
}
# ======
# Begin Dyldo Function
#µ#function DyldoFunction
#µ#{
#µ# # String to find: name of the dyld to patch
#µ# DyldoName="$1"
#µ# # Offset, from found string, of value to patch
#µ# DyldoOffset="$2"
#µ# # Offset of current part in the executable
#µ# DyldoCurOff="$3"
#µ#
#µ# # Does this app have this dyld inside its headers?
#µ# if [ ! -z "$(grep "$DyldoName" "$DeepWorkDir/$DeepAppName/Dyldo.Head")" ]; then
#µ# # Locate the position of this dyld
#µ# cat "$DeepWorkDir/$DeepAppName/Dyldo.Head" | tr '\n' ' ' | tr '\0' ' ' | sed -e "s:$DyldoName.*:$DyldoName:g" > "$DeepWorkDir/$DeepAppName/Dyldo.tmp"
#µ# DyldoLong=$(stat -c%s "$DeepWorkDir/$DeepAppName/Dyldo.tmp")
#µ# rm -f "$DeepWorkDir/$DeepAppName/Dyldo.tmp"
#µ# # Which value is there?
#µ# DyldoWeak=$(dd bs=1 count=1 skip=$(($DyldoLong - $DyldoOffset)) if="$DeepWorkDir/$DeepAppName/Dyldo.Head" 2> /dev/null | od -A n -t u -v )
#µ#
#µ# # 12 (LC_LOAD_DYLIB = 0xc) or 24 (LC_LOAD_WEAK_DYLIB = 0x18)
#µ# if [ $DyldoWeak != 24 ]; then
#µ# if [ $DyldoWeak != 12 ]; then
#µ# echo "${Meter36}${escRed}Error:${escReset} dyldo not 12 and not 24! ($DyldoWeak)"
#µ# else
#µ# echo "${Meter36}${escYellow}Note:${escReset} deeply dyldoing!"
#µ# foo=$(echo 24 | awk '{ printf("%c",$0); }' | dd bs=1 seek=$(($DyldoCurOff + $DyldoLong - $DyldoOffset)) conv=notrunc status=noxfer of="$DeepWorkDir/$DeepAppName/$RandRand$DeepAppExec" 2>&1> /dev/null)
#µ# # (LC_REQ_DYLD = 0x80000000)
#µ# foo=$(echo 128 | awk '{ printf("%c",$0); }' | dd bs=1 seek=$(($DyldoCurOff + $DyldoLong - $DyldoOffset + 3)) conv=notrunc status=noxfer of="$DeepWorkDir/$DeepAppName/$RandRand$DeepAppExec" 2>&1> /dev/null)
#µ# ##Fixed=" DYLD"
#µ# fi
#µ# fi
#µ# fi
#µ#}
# ======
# Begin Deep Function
function DeepFunction
{
# Get the parameters
DeepAppPath=$1
DeepAppName=$2
DeepAppExec=$3
DeepWorkDir=$4
# Is it an AppleWatch's plugin?
if [ -d "$DeepAppPath/$DeepAppName/"*".app/_WatchKitStub" ]; then
echo "${escRed}Warning:${escReset} StubWatch from the deep!"
# Is this iDevice unable to run it? (ie: iOS is older than iOS82)
if [ ! -e "/System/Library/Frameworks/WatchKit.framework" ]; then
echo "${escRed}Sorry:${escReset} your iDevice can't handle AppleWatch!"
return 1
fi
fi
if [ "$DebugMode" = "YES" ]; then
echo "DAP:<$DeepAppPath>"
echo "DAN:<$DeepAppName>"
echo "DAE:<$DeepAppExec>"
echo "DWD:<$DeepWorkDir>"
fi
# Copying executable (with attributes) to temporary space
if [ $RCverbose = "YES" ]; then
echo "${Meter15}$MsgCopExec"
fi
foo=$( cp -p "$DeepAppPath/$DeepAppName/$DeepAppExec" "$DeepWorkDir/$DeepAppName/" 2>&1> /dev/null )
if [ ! -e "$DeepWorkDir/$DeepAppName/$DeepAppExec" ]; then
echo "Unable to copy application files"
return 1
else
# Disk full?
if [ $(stat -c%s "$DeepWorkDir/$DeepAppName/$DeepAppExec") != $(stat -c%s "$DeepAppPath/$DeepAppName/$DeepAppExec") ]; then
echo "${escRed}$MsgDskFull ?${escReset}"
return 1
fi
fi
if [ $RCverbose = "YES" ]; then
echo -n "${Meter20}$MsgAnaAppl: "
fi
# Initialize parts index and variables
PartIndex[6]=0
PartIndex[9]=0
PartIndex[11]=0
PartIndex[64]=0
HowManyDone=0
LastDoneType=0
LastNotDonePart=0
# Looking for fat's magic numbers (CafeBabe)
CafeBabeIsFat=$(dd bs=4 count=1 skip=0 if="$DeepWorkDir/$DeepAppName/$DeepAppExec" 2> /dev/null | od -A n -t x1 -v | grep "ca fe ba be")
# Is executable FAT or THIN?
if [ ! "$CafeBabeIsFat" ]; then
# "THIN" will be done like a "FATx1"
if [ $RCverbose = "YES" ]; then
echo "${Meter25}Thin Binary found"
fi
HowManyParts="01"
# Get the thin's headers, then extract the details
ThinBabe=$(dd bs=12 count=1 skip=0 if="$DeepWorkDir/$DeepAppName/$DeepAppExec" 2> /dev/null | od -A n -t x1 -v | tr -d ' ','\n')
# PartType can be 6, 9, 11 or 64
PartType[1]=$(echo "0x${ThinBabe:14:2}" | awk --non-decimal-data '{print ($1)*64 }')
if [ ${PartType[1]} = 0 ]; then
PartType[1]=$(echo "0x${ThinBabe:16:2}" | awk --non-decimal-data '{print ($1)+0 }')
fi
PartData[1]="empty"
PartIndex[${PartType[1]}]=1
PartOffset[1]=1
PartLogicalSize[1]=$(stat -c%s "$DeepWorkDir/$DeepAppName/$DeepAppExec")
PartPhysicalSize[1]=${PartLogicalSize[1]}
else
# This is a FATx2 or FATx3 babe
if [ $RCverbose = "YES" ]; then
echo "${Meter25}Fat Binary found"
fi
# Get the fat's full headers, keep it, then extract the details
foo=$(dd bs=4096 count=1 skip=0 if="$DeepWorkDir/$DeepAppName/$DeepAppExec" of="$DeepWorkDir/$DeepAppName/CafeBabe.is.Fat" 2>&1> /dev/null)
FullCafeBabe=$(cat "$DeepWorkDir/$DeepAppName/CafeBabe.is.Fat" | od -A n -t x1 -v | tr -d ' ','\n')
# PartType can be 6, 9, 11 or 64
PartType[1]=$(echo "0x${FullCafeBabe:16:2}" | awk --non-decimal-data '{print ($1)*64 }')
if [ ${PartType[1]} = 0 ]; then
PartType[1]=$(echo "0x${FullCafeBabe:30:2}" | awk --non-decimal-data '{print ($1)+0 }')
fi
PartData[1]=${FullCafeBabe:32:16}
PartIndex[${PartType[1]}]=1
PartType[2]=$(echo "0x${FullCafeBabe:56:2}" | awk --non-decimal-data '{print ($1)*64 }')
if [ ${PartType[2]} = 0 ]; then
PartType[2]=$(echo "0x${FullCafeBabe:70:2}" | awk --non-decimal-data '{print ($1)+0 }')
fi
PartData[2]=${FullCafeBabe:72:16}
PartIndex[${PartType[2]}]=2
# Part3 is perhaps empty, but we check it also
PartType[3]=$(echo "0x${FullCafeBabe:96:2}" | awk --non-decimal-data '{print ($1)*64 }')
if [ ${PartType[3]} = 0 ]; then
PartType[3]=$(echo "0x${FullCafeBabe:110:2}" | awk --non-decimal-data '{print ($1)+0 }')
fi
PartOffset[1]=$(echo "0x${PartData[1]:0:8}" | awk --non-decimal-data '{print ($1)+1 }')
PartLogicalSize[1]=$(echo "0x${PartData[1]:8:8}" | awk --non-decimal-data '{print ($1)+0 }')
PartOffset[2]=$(echo "0x${PartData[2]:0:8}" | awk --non-decimal-data '{print ($1)+1 }')
PartLogicalSize[2]=$(echo "0x${PartData[2]:8:8}" | awk --non-decimal-data '{print ($1)+0 }')
# How many parts in FAT executable? Two or Three? Or One?
HowManyParts=${FullCafeBabe:14:2}
# Rare "Bad Monsters" exist! When "MonsterX3 and iOStarget<7", they say "MonsterX2" in their header!
if [ $HowManyParts = "02" -a ${PartType[3]} != 0 ]; then
###ExtrasAslr="$ExtrasAslr BAD"
echo "${Meter25}${escRed}Note: Bad Monster found${escReset}"
# Only 64bits iDevices can do this third part
if [ -e "$DeepAppPath/$DeepAppName/SC_Info/$DeepAppExec.supf" -a $CPUType = "64" ]; then
HowManyParts="03"
echo "${Meter25}${escRed}Note: taming Bad Monster${escReset} now"
foo=$(echo -ne "\x03" | dd bs=1 seek=7 conv=notrunc status=noxfer of="$DeepWorkDir/$DeepAppName/$DeepAppExec" 2>&1> /dev/null)
else
echo "${Meter25}${escRed}Note: can't tame this Bad Monster${escReset}"
###foo=$(cat /dev/zero | dd bs=1 seek=48 count=20 conv=notrunc status=noxfer of="$DeepWorkDir/$DeepAppName/CafeBabe.is.Fat" 2>&1> /dev/null)
###foo=$(cat /dev/zero | dd bs=1 seek=48 count=20 conv=notrunc status=noxfer of="$DeepWorkDir/$DeepAppName/$DeepAppExec" 2>&1> /dev/null)
fi
fi
# Rare "Bad Bad Monsters" exist! When "MonsterX2 and iOStarget<7", they say "MonsterX1" in their header!
if [ $HowManyParts = "01" -a ${PartType[2]} != 0 ]; then
###ExtrasAslr="$ExtrasAslr BADBAD"
echo "${Meter25}${escRed}Note: Bad Bad Monster found${escReset}"
# Only 64bits iDevices can do this second part
if [ -e "$DeepAppPath/$DeepAppName/SC_Info/$DeepAppExec.supf" -a $CPUType = "64" ]; then
HowManyParts="02"
echo "${Meter25}${escRed}Note: taming Bad Bad Monster${escReset} now"
foo=$(echo -ne "\x02" | dd bs=1 seek=7 conv=notrunc status=noxfer of="$DeepWorkDir/$DeepAppName/$DeepAppExec" 2>&1> /dev/null)
else
echo "${Meter25}${escRed}Note: can't tame this Bad Bad Monster${escReset}"
###foo=$(cat /dev/zero | dd bs=1 seek=48 count=20 conv=notrunc status=noxfer of="$DeepWorkDir/$DeepAppName/CafeBabe.is.Fat" 2>&1> /dev/null)
###foo=$(cat /dev/zero | dd bs=1 seek=48 count=20 conv=notrunc status=noxfer of="$DeepWorkDir/$DeepAppName/$DeepAppExec" 2>&1> /dev/null)
fi
fi
if [ $HowManyParts != "03" ]; then
# Two (or one) parts only. Forcing part3 to "empty"
PartType[3]=0
PartData[3]="Empty"
PartOffset[3]=$(( 1 + $(stat -c%s "$DeepWorkDir/$DeepAppName/$DeepAppExec") ))
PartLogicalSize[3]=0
if [ $HowManyParts != "02" ]; then
# One part only. Forcing part2 to "empty"
PartType[2]=0
PartData[2]="Empty"
PartOffset[2]=$(( 1 + $(stat -c%s "$DeepWorkDir/$DeepAppName/$DeepAppExec") ))
PartLogicalSize[2]=0
fi
else
# Three parts
PartData[3]=${FullCafeBabe:112:16}
PartOffset[3]=$(echo "0x${PartData[3]:0:8}" | awk --non-decimal-data '{print ($1)+1 }')
PartLogicalSize[3]=$(echo "0x${PartData[3]:8:8}" | awk --non-decimal-data '{print ($1)+0 }')
PartIndex[${PartType[3]}]=3
###ExtrasAslr="$ExtrasAslr MONSTER"
fi
echo "${Meter25}${escBlue}Info: MonsterX$HowManyParts${escReset} (${PartType[1]} - ${PartType[2]} - ${PartType[3]})"
# Computings
PartPhysicalSize[1]=$(( ${PartOffset[2]} - ${PartOffset[1]} ))
PartPhysicalSize[2]=$(( ${PartOffset[3]} - ${PartOffset[2]} ))
PartPhysicalSize[3]=$(( 1 + $(stat -c%s "$DeepWorkDir/$DeepAppName/$DeepAppExec") - ${PartOffset[3]} ))
fi
# Display debug data
if [ "$DebugMode" = "YES" ]; then
echo "Idx: ${PartIndex[6]} ${PartIndex[9]} ${PartIndex[11]} ${PartIndex[64]}"
echo "Off: ${PartOffset[1]} ${PartOffset[2]} ${PartOffset[3]}"
echo "Lsz: ${PartLogicalSize[1]} ${PartLogicalSize[2]} ${PartLogicalSize[3]}"
echo "Psz: ${PartPhysicalSize[1]} ${PartPhysicalSize[2]} ${PartPhysicalSize[3]}"
fi
# Copying some files
mkdir "$DeepWorkDir/$DeepAppName/SC_Info"
chmod 777 "$DeepWorkDir/$DeepAppName/SC_Info"
if [ -e "$DeepAppPath/$DeepAppName/SC_Info/$DeepAppExec.sinf" ]; then
cp -p "$DeepAppPath/$DeepAppName/SC_Info/$DeepAppExec.sinf" "$DeepWorkDir/$DeepAppName/SC_Info/$DeepAppExec.sinf"
else
# The ".sinf" file is not present? (Replication failed because iOS is too old, or because we are RemoteRasticracking)
echo "Note: playing 'silly SINFony' now"
# We copy the one from main executable
cp -p "$AppPath/$AppName/SC_Info/$AppExec.sinf" "$DeepWorkDir/$DeepAppName/SC_Info/$DeepAppExec.sinf"
fi
cp -p "$DeepAppPath/$DeepAppName/SC_Info/$DeepAppExec.supp" "$DeepWorkDir/$DeepAppName/SC_Info/$DeepAppExec.supp"
if [ -e "$DeepAppPath/$DeepAppName/SC_Info/$DeepAppExec.supf" ]; then
cp -p "$DeepAppPath/$DeepAppName/SC_Info/$DeepAppExec.supf" "$DeepWorkDir/$DeepAppName/SC_Info/$DeepAppExec.supf"
fi
if [ -e "$DeepAppPath/$DeepAppName/SC_Info/Manifest.plist" ]; then
cp -p "$DeepAppPath/$DeepAppName/SC_Info/Manifest.plist" "$DeepWorkDir/$DeepAppName/SC_Info/Manifest.plist"
fi
# Parts are done by descending type (because iOS always takes the "highest" first)
for j in 64 11 9 6
do
WhichPart=${PartIndex[$j]}
if [ $WhichPart = 0 ]; then
if [ "$DebugMode" = "YES" ]; then
echo "- No 'type $j' part found"
fi
# If a part of this type exists
else
if [ "$DebugMode" = "YES" ]; then
echo "- The 'type $j' part is number $WhichPart"
fi
# If Cpu is not strong enough for this type of part
if [ $j -gt $CPUType ]; then
if [ "$DebugMode" = "YES" ]; then
echo " Can't do 'type $j' part with 'type $CPUType' cpu"
fi
LastNotDonePart=$WhichPart
# If Cpu is strong enough for this type of part
else
if [ "$DebugMode" = "YES" ]; then
echo " Will do 'type $j' part with 'type $CPUType' cpu"
fi
if [ $RCverbose = "YES" ]; then
echo "${Meter26}Cracking type$j part (#$WhichPart) on type$CPUType cpu"
fi
# iOS can't crack twice the same binary, so we will randomize its name before each call.
RandRand=$RANDOM
mv "$DeepWorkDir/$DeepAppName/$DeepAppExec" "$DeepWorkDir/$DeepAppName/$RandRand$DeepAppExec"
if [ -e "$DeepWorkDir/$DeepAppName/SC_Info/$DeepAppExec.sinf" ]; then
mv "$DeepWorkDir/$DeepAppName/SC_Info/$DeepAppExec.sinf" "$DeepWorkDir/$DeepAppName/SC_Info/$RandRand$DeepAppExec.sinf"
fi
mv "$DeepWorkDir/$DeepAppName/SC_Info/$DeepAppExec.supp" "$DeepWorkDir/$DeepAppName/SC_Info/$RandRand$DeepAppExec.supp"
if [ -e "$DeepWorkDir/$DeepAppName/SC_Info/$DeepAppExec.supf" ]; then
mv "$DeepWorkDir/$DeepAppName/SC_Info/$DeepAppExec.supf" "$DeepWorkDir/$DeepAppName/SC_Info/$RandRand$DeepAppExec.supf"
fi
# Is it an AppleWatch's plugin?
if [ -d "$DeepAppPath/$DeepAppName/"*".app/_WatchKitStub" ]; then
#echo "${escRed}Warning:${escReset} StubWatch from the deep!"
# Is this iDevice unable to run it? (ie: iOS is older than iOS82)
if [ ! -e "/System/Library/Frameworks/WatchKit.framework" ]; then
echo "${escRed}Sorry:${escReset} your iDevice can't handle AppleWatch!"
return 1
#µ# # We need to deeply analyze this part. Extraction
#µ# foo=$( cat "$DeepWorkDir/$DeepAppName/$RandRand$DeepAppExec" | tail --bytes=+${PartOffset[$WhichPart]} | head --bytes=${PartLogicalSize[$WhichPart]} > "$DeepWorkDir/$DeepAppName/Dyldo.Huge" 2> /dev/null )
#µ# if [ $(stat -c%s "$DeepWorkDir/$DeepAppName/Dyldo.Huge") != ${PartLogicalSize[$WhichPart]} ]; then
#µ# echo "${escRed}$MsgDskFull ?${escReset}"
#µ# return 1
#µ# fi
#µ# # We will look only at its headers. How long are they?
#µ# CryptOff=$(otool -l "$DeepWorkDir/$DeepAppName/Dyldo.Huge" | grep cryptoff | awk '{print $2}')
#µ# if [ ! "$CryptOff" ]; then
#µ# echo "${escRed}Unable to find CryptOff${escReset}"
#µ# return 1
#µ# fi
#µ# # Get only the headers to check the DYLDs' list
#µ# foo=$(dd bs=$CryptOff count=1 if="$DeepWorkDir/$DeepAppName/Dyldo.Huge" of="$DeepWorkDir/$DeepAppName/Dyldo.Head" 2>&1> /dev/null)
#µ# rm -f "$WorkDir/$AppName/Dyldo.Huge"
#µ# if [ $(stat -c%s "$DeepWorkDir/$DeepAppName/Dyldo.Head") != $CryptOff ]; then
#µ# echo "${escRed}$MsgDskFull ?${escReset}"
#µ# return 1
#µ# fi
#µ# # /System/Library/Frameworks/WatchKit.framework/WatchKit
#µ# DyldoFunction "WatchKit\.framework/WatchKit" 78 ${PartOffset[$WhichPart]}
#µ# # Dyldo stored back in the drawer
#µ# rm -f "$WorkDir/$AppName/Dyldo.Head"
fi
fi
# RastDecrypted/DumpDecrypted creates its output in "current directory", so we change it before the call
# (Warning: newer iOS tries to block that, because of a sandbox protection)
cd "$DeepWorkDir/$DeepAppName"
if [ -e /usr/bin/logger ]; then
logger -t RCdump "RCbegin {"
fi
# Calling DumpDecrypted and storing its return-code
foo=$(DYLD_INSERT_LIBRARIES=$RastDec "$DeepWorkDir/$DeepAppName/$RandRand$DeepAppExec" mach-o decryption dumper 2>&1)
RetRet=$?
# Returning to initial directory
cd "$PwdPwd" 2>&1> /dev/null
# Testing DumpDecrypted result
if [ $RetRet != 1 ]; then
# 127=exec not found; 137=wrong iOS type or missing scinfo files; 133=dylib not loaded or incompatible executable
echo "${Meter32}${escRed}Error:${escReset} RastDecrypted failed (${j}on$CPUType=$RetRet)"
if [ "$DebugMode" = "YES" ]; then
echo "${Meter32}${escYellow}DUMP ERROR:${escReset} << $foo >>" | tr -d '\n'
echo "${Meter32}."
fi
if [ -e /usr/bin/logger ]; then
echo "$foo" | logger -t RCdump
logger -t RCdump "} RCend"
fi
echo "${Meter32}${escYellow}NOTE:${escReset} iDevice is '$iOSver' and executable is '$(plutil -key MinimumOSVersion "$DeepAppPath/$DeepAppName/Info.plist" 2> /dev/null | tr -d ".")'"
return 1
fi
if [ -e /usr/bin/logger ]; then
logger -t RCdump "} RCend"
fi
# Does we have some output data?
if [ ! -e "$DeepWorkDir/$DeepAppName/$RandRand$DeepAppExec.decrypted" ]; then
echo "${Meter32}${escRed}Error:${escReset} empty RastDecrypted (${j}on$CPUType)"
return 1
fi
# Is the file uncut and complete?
if [ $(stat -c%s "$DeepWorkDir/$DeepAppName/$RandRand$DeepAppExec.decrypted") != $(stat -c%s "$DeepWorkDir/$DeepAppName/$RandRand$DeepAppExec") ]; then
echo "${escRed}$MsgDskFull ?${escReset}"
return 1
fi
# Note that only one part has been decrypted! We extract it and we erase the output temp file
foo=$( cat "$DeepWorkDir/$DeepAppName/$RandRand$DeepAppExec.decrypted" | tail --bytes=+${PartOffset[$WhichPart]} | head --bytes=${PartLogicalSize[$WhichPart]} > "$DeepWorkDir/$DeepAppName/DumpedPart${PartType[$WhichPart]}" 2> /dev/null )
rm "$DeepWorkDir/$DeepAppName/$RandRand$DeepAppExec.decrypted"
# Is the decrypted data complete?
if [ $(stat -c%s "$DeepWorkDir/$DeepAppName/DumpedPart${PartType[$WhichPart]}") != ${PartLogicalSize[$WhichPart]} ]; then
echo "${escRed}$MsgDskFull ?${escReset}"
return 1
fi
# Getting all executable's details
Peter=$(otool -l "$DeepWorkDir/$DeepAppName/DumpedPart${PartType[$WhichPart]}")
# (RIP)
# Check if decrypted part is really decrypted
if [ "$(echo "$Peter" | grep cryptid | awk '{print $2}')" != "0" ]; then
echo "${Meter32}${escRed}Error:${escReset} RastDecrypted still crypted (${j}on$CPUType)"
return 1
fi
# Trying "LamestPatchest" to remove some security checks and some ads and some spies
if [ $RClamestpatchest = "YES" ]; then
if [ $RCverbose = "YES" ]; then
echo -n "${Meter33}Trying LamestPatchest... "
fi
# Finding location of the "cstring" data block to be LamedPatched
LPoff=$(echo "$Peter" | grep cstring -A4 | grep offset | awk '{print $2}')
if [ ! "$LPoff" ]; then
echo "${Meter33}${escYellow}$MsgWarning:${escReset} unable to find LPoff"
return 1
else
LPsize=$(echo "$Peter" | grep cstring -A4 | grep size | awk --non-decimal-data '{print ($2)+0 }')
if [ ! "$LPsize" ]; then
echo "${Meter33}${escYellow}$MsgWarning:${escReset} unable to find LPsize"
return 1
fi
fi
# Dumping the data block to be LamedPatched
foo=$( cat "$DeepWorkDir/$DeepAppName/DumpedPart${PartType[$WhichPart]}" | tail --bytes=+$(($LPoff + 1)) | head --bytes=$LPsize > "$DeepWorkDir/LP.bin" 2> /dev/null )
# Disk full?
if [ $(stat -c%s "$DeepWorkDir/LP.bin") != $LPsize ]; then
echo "${escRed}$MsgDskFull ?${escReset}"
return 1
fi
# LamingPatching!
sed --in-place=.BCK \
-e 's=/Cydia\.app=/Czdjb\.bpp=g' \
-e 's=/cydia=/czdjb=g' \
-e 's=/SBSettings=/SBSfttjngs=g' \
-e 's=/WinterBoard=/WjntfrBpbrd=g' \
-e 's=ppa\.aidyC=ppb\.bjdzC=g' \
-e 's=/private/var/lib/apt=/prjvbtf/vbr/ljb/bpt=g' \
-e 's=/bin/mkdir=/bjn/mkdjr=g' \
-e 's=/bin/bash=/bjn/bbsh=g' \
-e 's=/usr/bin/ssh=/vsr/bjn/ssh=g' \
-e 's=/usr/sbin/ssh=/vsr/sbjn/ssh=g' \
-e 's=/Applicat\d0\d0\d0ions/dele\d0\d0\d0teme\.txt=/Bppljcbt\d0\d0\d0jpns/dflf\d0\d0\d0tfmf\.txt=g' \
-e 's=/Appl\d0\d0\d0ications/C\d0\d0ydi\d0a\.app=/Bppl\d0\d0\d0jcbtjpns/C\d0\d0zdj\d0b\.bpp=g' \
-e 's=ations/Cy\d0\d0\d0/Applic\d0pp\d0\d0dia.a=btjpns/Cz\d0\d0\d0/Bppljc\d0pp\d0\d0djb.b=g' \
-e 's=ate/va\d0\d0/priv\d0\d0\d0pt/\d0b/a\d0r/li=btf/vb\d0\d0/prjv\d0\d0\d0pt/\d0b/b\d0r/lj=g' \
-e 's=pinchmedia\.com=pjnchmfdjb\.cpm=g' \
-e 's=admob\.com=bdmpb\.cpm=g' \
-e 's=doubleclick\.net=dpvblfcljck\.nft=g' \
-e 's=googlesyndication\.com=gppglfszndjcbtjpn\.cpm=g' \
-e 's=flurry\.com=flvrrz\.cpm=g' \
-e 's=qwapi\.com=qwbpj\.cpm=g' \
-e 's=mobclix\.com=mpbcljx\.cpm=g' \
-e 's=http://ad\.=http://bd_=g' \
-e 's=http://ads\.=http://bds_=g' \
-e 's=http://ads2\.=http://bds2_=g' \
-e 's=http://ingameads\.=http://jngbmfbds_=g' \
-e 's=adwhirl\.com=bdwhjrl\.cpm=g' \
-e 's=vdopia\.com=vdppjb\.cpm=g' \
-e 's=tapjoyads\.com=tbpjpzbds\.cpm=g' \
-e 's=/Library/MobileSubstrate=/Ljbrbrz/MpbjlfSvbstrbtf=g' \
"$DeepWorkDir/LP.bin"
# "/Applications/mAdvLock.app"
# "/Applications/Icy\.app"
# "appads\.com"
# /System/Library/LaunchDaemons/com.ikey.bbot.plist
# /System/Library/LaunchDaemons/com.saurik.Cydia.Startup.plist
# /usr/libexec/sftp-server
# /Applications/MxTube.app
# /Applications/IntelliScreen.app
# /Applications/FakeCarrier.app
# /Applications/blackra1n.app
# cydia://
# Disk full?
if [ ! -e "$DeepWorkDir/LP.bin.BCK" ]; then
echo "${escRed}$MsgDskFull ?${escReset}"
return 1
else
if [ $(stat -c%s "$DeepWorkDir/LP.bin.BCK") != $(stat -c%s "$DeepWorkDir/LP.bin") ]; then
echo "${escRed}$MsgDskFull ?${escReset}"
return 1
fi
fi
# Something patched or not?
cmp --silent "$DeepWorkDir/LP.bin.BCK" "$DeepWorkDir/LP.bin"
# Differences --> patched
if [ "$?" != "0" ]; then
if [ $RCverbose = "YES" ]; then
echo "${Meter34}patched things"
fi
Patched=" LP"
foo=$(dd seek=1 count=1 obs=$LPoff ibs=$LPsize conv=notrunc if="$DeepWorkDir/LP.bin" of="$DeepWorkDir/$DeepAppName/DumpedPart${PartType[$WhichPart]}" 2>&1> /dev/null)
else
if [ $RCverbose = "YES" ]; then
echo "${Meter34}found nothing"
fi
fi
rm "$DeepWorkDir/LP.bin.BCK"
rm "$DeepWorkDir/LP.bin"
fi
if [ $CPUType = "64" -a $j = 64 ]; then
# Signing the application with 'ldid' (because 'ldone' can't do 64bits executable)
if [ $RCverbose = "YES" ]; then
echo "${Meter35}$MsgSgnAppl (ldid)"
fi
foo=$(ldid -s "$DeepWorkDir/$DeepAppName/DumpedPart${PartType[$WhichPart]}" 2>&1> /dev/null)
else
# Signing the application with 'ldone' (better than 'ldid')
if [ $RCverbose = "YES" ]; then
echo "${Meter35}$MsgSgnAppl (ldone)"
fi