forked from esc0rtd3w/firestick-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-mantis-full.cmd
1155 lines (943 loc) · 32.8 KB
/
setup-mantis-full.cmd
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
@echo off
title Full Setup Script For Mantis
set debug=0
set fireOsVersion=0.0.0.0
set fireOsDevice=none
set downgrade=0
set magiskZip=Magisk.zip
set adb="%~dp0bin\adb.exe"
set adbKill=%adb% kill-server
set adbStart=%adb% start-server
set adbWait=%adb% wait-for-device
set sleep="%~dp0bin\wait.exe"
set extractRAR="%~dp0bin\rar.exe" -y x
set cocolor="%~dp0bin\cocolor.exe"
set msgbox="%~dp0bin\msgbox.exe"
set install=%adb% install
set uninstall=%adb% uninstall
set push=%adb% push
set pull=%adb% pull
set shell=%adb% shell
set twrp=%shell% twrp
:: Used for 6.2.5.8 when no downgrade will be done
set nodg=0
if not exist "%temp%\firestick-loader" md "%temp%\firestick-loader"
:start
color 0e
:: Kill any adb instances before starting
%adbKill%
:: Set Flags For ADB Service and Unknown Sources
set adb_success=0
set unk_sources_success=0
:: TWRP Requirement
set twrp_available=0
cls
echo Looking For TWRP Recovery...
echo.
%pull% /twres/twrp "%temp%\firestick-loader"
%sleep% 2
if exist "%temp%\firestick-loader\twrp" set twrp_available=1
if %twrp_available%==1 goto intro
if %twrp_available%==0 goto twrpfail
:twrpfail
%cocolor% 0c
cls
echo TWRP Not Found!
echo.
echo Trying To Force Boot Into Recovery...
echo.
%sleep% 3
%adb% reboot recovery
%sleep% 15
goto start
:intro
:: Remind user to have already setup his device
%msgbox% "You must have already completed the initial OOBE setup on device to continue!" "Mantis Full Setup Script"
:: Reset TWRP Flags
if %twrp_available%==1 del /f /q "%temp%\firestick-loader\twrp"
if %twrp_available%==1 set twrp_available=0
color 0e
set rwcheck=0
cls
echo.
echo Mounting System To Check Device Settings...
echo.
%shell% "mount -o rw /system"
echo.
echo.
echo Press 1 if there is an error, otherwise just press ENTER
echo.
set /p rwcheck=
if %rwcheck%==1 echo.
if %rwcheck%==1 echo Waiting on Reboot...
if %rwcheck%==1 echo.
if %rwcheck%==1 %adb% reboot recovery
if %rwcheck%==1 %sleep% 15
if %rwcheck%==1 goto intro
:: Get FireOS Info
%shell% "cat /system/build.prop | grep ro.build.version.name>/sdcard/fireos-version.txt"
%pull% /sdcard/fireos-version.txt "%temp%"
%shell% "cat /system/build.prop | grep ro.product.device=>/sdcard/fireos-device.txt"
%pull% /sdcard/fireos-device.txt "%temp%"
for /f "tokens=3 delims= " %%f in ('type "%temp%\fireos-version.txt"') do set fireOsVersion=%%f
for /f "tokens=2 delims==" %%f in ('type "%temp%\fireos-device.txt"') do set fireOsDevice=%%f
%sleep% 1
%shell% "rm /sdcard/fireos-version.txt"
%shell% "rm /sdcard/fireos-device.txt"
if not %fireOsDevice%==mantis goto nomantis
:dgask
color 0c
set noway=0
set dgchoice=n
if %fireOsVersion%==6.2.5.8 (
set downgrade=1
set nodg=1
goto is6258
)
cls
%cocolor% 0a
echo TWRP Found!
echo.
%cocolor% 0b
echo Device: %fireOsDevice% / Firmware Version: %fireOsVersion%
echo.
echo.
%cocolor% 0e
echo Do you want to downgrade to 6.2.5.8 [Y/N]?
echo.
echo.
set /p dgchoice=
echo.
if %dgchoice%==n set downgrade=0
if %dgchoice%==N set downgrade=0
if %dgchoice%==y set downgrade=1
if %dgchoice%==Y set downgrade=1
if %downgrade%==0 goto is6271
if %downgrade%==1 goto dg6258
goto dgask
:is6258
cls
%cocolor% 0a
echo TWRP Found!
echo.
%cocolor% 0b
echo Device: %fireOsDevice% / Firmware Version: %fireOsVersion%
echo.
echo.
%cocolor% 0e
echo The device will have the following done to it:
echo.
echo - Amazon Bloat Removed
echo - Custom Home Menu and Data Installed To System
echo - TitaniumBackup Installed To System. Use To Restore All Apps and Data
echo - SH Script Runner Installed To System. Use For Shortcuts On Home Menu
echo - Restore Directory and All APKs and TitaniumBackup Files To /system/
echo - Scripts Directory and All Home Scripts To Launch Amazon Settings To /system/
echo - Magisk Installed For SuperUser and ADB Service
echo.
echo - The Cache and Dalvik Cache Will Be Formatted During Setup
echo.
echo.
echo.
echo Press 1 to EXIT, B to create BACKUP, or just press ENTER to continue...
echo.
set /p noway=
if %noway%==1 goto end
if %noway%==b %twrp% backup /system,data,cache,dalvik
if %noway%==b %adb% reboot recovery
if %noway%==b %sleep% 15
if %noway%==b goto start
if %noway%==B %twrp% backup /system,data,cache,dalvik
if %noway%==B %adb% reboot recovery
if %noway%==B %sleep% 15
if %noway%==B goto start
goto stage1
:dg6258
cls
%cocolor% 0a
echo TWRP Found!
echo.
%cocolor% 0b
echo Device: %fireOsDevice% / Firmware Version: %fireOsVersion%
echo.
echo.
%cocolor% 0e
echo The device will have the following done to it:
echo.
echo - Downgrade To Stock Amazon FireOS 6.2.5.8
echo - Amazon Bloat Removed
echo - Custom Home Menu and Data Installed To System
echo - TitaniumBackup Installed To System. Use To Restore All Apps and Data
echo - SH Script Runner Installed To System. Use For Shortcuts On Home Menu
echo - Restore Directory and All APKs and TitaniumBackup Files To /system/
echo - Scripts Directory and All Home Scripts To Launch Amazon Settings To /system/
echo - Magisk Installed For SuperUser and ADB Service
echo.
echo - The System, Data, Cache, and Dalvik Cache Will Be Formatted During Setup
echo.
echo.
echo Press 1 to EXIT, B to create BACKUP, or just press ENTER to continue...
echo.
set /p noway=
if %noway%==1 goto end
if %noway%==b %twrp% backup /system,data,cache,dalvik
if %noway%==b %adb% reboot recovery
if %noway%==b %sleep% 15
if %noway%==b goto start
if %noway%==B %twrp% backup /system,data,cache,dalvik
if %noway%==B %adb% reboot recovery
if %noway%==B %sleep% 15
if %noway%==B goto start
goto stage1
:is6271
cls
%cocolor% 0a
echo TWRP Found!
echo.
%cocolor% 0b
echo Device: %fireOsDevice% / Firmware Version: %fireOsVersion%
echo.
echo.
%cocolor% 0e
echo The device will have the following done to it:
echo.
echo - Amazon Bloat Removed
echo - Custom Home Menu and Data Installed To System
echo - TitaniumBackup Installed To System. Use To Restore All Apps and Data
echo - SH Script Runner Installed To System. Use For Shortcuts On Home Menu
echo - Restore Directory and All APKs and TitaniumBackup Files To /system/
echo - Scripts Directory and All Home Scripts To Launch Amazon Settings To /system/
echo - Magisk Installed For SuperUser and ADB Service
echo.
echo - The Cache and Dalvik Cache Will Be Formatted During Setup
echo.
echo.
echo Press 1 to EXIT, B to create BACKUP, or just press ENTER to continue...
echo.
set /p noway=
if %noway%==1 goto end
if %noway%==b %twrp% backup /system,data,cache,dalvik
if %noway%==b %adb% reboot recovery
if %noway%==b %sleep% 15
if %noway%==b goto start
if %noway%==B %twrp% backup /system,data,cache,dalvik
if %noway%==B %adb% reboot recovery
if %noway%==B %sleep% 15
if %noway%==B goto start
goto stage1
:nomantis
%cocolor% 0c
cls
echo Supports Mantis Only!
echo.
echo This device is %fireOsDevice% and CANNOT continue!
echo.
pause
goto end
:stage1
if %downgrade%==1 (
set accessibility="scripts\settings\mantis\system\scripts\6258\accessibility.sh"
set applications="scripts\settings\mantis\system\scripts\6258\applications.sh"
set btcontroller="scripts\settings\mantis\system\scripts\6258\btcontroller.sh"
set device="scripts\settings\mantis\system\scripts\6258\device.sh"
set displaysounds="scripts\settings\mantis\system\scripts\6258\display-sounds.sh"
set help="scripts\settings\mantis\system\scripts\6258\help.sh"
set myaccount="scripts\settings\mantis\system\scripts\6258\my-account.sh"
set network="scripts\settings\mantis\system\scripts\6258\network.sh"
set notifications="scripts\settings\mantis\system\scripts\6258\notifications.sh"
set preferences="scripts\settings\mantis\system\scripts\6258\preferences.sh"
)
if %downgrade%==0 (
set accessibility="scripts\settings\mantis\system\scripts\6271\accessibility.sh"
set alexa="scripts\settings\mantis\system\scripts\6271\alexa.sh"
set applications="scripts\settings\mantis\system\scripts\6271\applications.sh"
set btcontroller="scripts\settings\mantis\system\scripts\6271\btcontroller.sh"
set device="scripts\settings\mantis\system\scripts\6271\device.sh"
set displaysounds="scripts\settings\mantis\system\scripts\6271\display-sounds.sh"
set equipment="scripts\settings\mantis\system\scripts\6271\equipment.sh"
set help="scripts\settings\mantis\system\scripts\6271\help.sh"
set myaccount="scripts\settings\mantis\system\scripts\6271\my-account.sh"
set network="scripts\settings\mantis\system\scripts\6271\network.sh"
set notifications="scripts\settings\mantis\system\scripts\6271\notifications.sh"
set preferences="scripts\settings\mantis\system\scripts\6271\preferences.sh"
)
color 0e
set rwcheck=0
cls
echo Forcing Reboot Back To Recovery...
echo.
%adb% reboot recovery
%sleep% 15
if %downgrade%==0 goto stage2
:: If version is 6.2.5.8 then do not downgrade
if %nodg%==1 goto stage2
cls
echo.
echo Mounting System as RW for System Install...
echo.
%twrp% remountrw /system
echo.
echo Check For RW Mount Status
echo.
echo.
echo Press 1 if there is an error, otherwise just press ENTER
echo.
set /p rwcheck=
if %rwcheck%==1 echo.
if %rwcheck%==1 echo Waiting on Reboot...
if %rwcheck%==1 echo.
if %rwcheck%==1 %adb% reboot recovery
if %rwcheck%==1 %sleep% 15
if %rwcheck%==1 goto stage1
echo STOP [THIS IS NOT FINISHED YET!]
echo.
pause
goto end
cls
echo Preparing Stock FireOS 6.2.5.8 Downgrade Files
echo.
if not exist "%temp%\firestick-loader\downgrade\stick3\6.2.5.8" md "%temp%\firestick-loader\downgrade\stick3\6.2.5.8"
%extractRAR% "downgrade\stick3\6.2.5.8\firmware-mantis-6.2.5.8.split" "%temp%\firestick-loader\downgrade\stick3"
cls
echo Pushing Downgrade Bin to /sdcard/...
echo.
%push% "%temp%\firestick-loader\downgrade\stick3\update-kindle-full_mantisXXXXXXXXXXXXXXXXX_6.2.5.8.bin" /sdcard/
%sleep% 2
cls
echo Wiping System...
echo.
%twrp% wipe /system
%sleep% 5
cls
echo Installing Stock FireOS 6.2.5.8...
echo.
%twrp% install /sdcard/update-kindle-full_mantisXXXXXXXXXXXXXXXXX_6.2.5.8.bin
%sleep% 5
cls
echo Cleaning Up Files...
echo.
rd /s /q "%temp%\firestick-loader\downgrade\stick3"
%shell% "rm /sdcard/update-kindle-full_mantisXXXXXXXXXXXXXXXXX_6.2.5.8.bin"
%sleep% 2
cls
echo Preparing Reboot...
echo.
%sleep% 5
cls
echo Rebooting Back Into Recovery...
echo.
%adb% reboot recovery
%sleep% 15
:stage2
color 0e
set rwcheck=0
cls
echo.
echo Mounting System as RW...
echo.
%shell% "mount -o rw /system"
echo.
echo Check For RW Mount Status
echo.
echo Press 1 if there is an error, otherwise just press ENTER
echo.
set /p rwcheck=
if %rwcheck%==1 echo.
if %rwcheck%==1 echo Waiting on Reboot...
if %rwcheck%==1 echo.
if %rwcheck%==1 %adb% reboot recovery
if %rwcheck%==1 %sleep% 15
if %rwcheck%==1 goto stage2
cls
echo Debloating Amazon Apps...
echo.
%sleep% 3
:: 20200524 - More debloating can probably be achieved
:: In the current state there are no errors in logcat, no CPU spikes, and settings all work
::%shell% "rm -r /system/priv-app/amazon.jackson-19/"
%shell% "rm -r /system/priv-app/AmazonKKWebViewLib/"
%shell% "rm -r /system/priv-app/BackupRestoreConfirmation/"
%shell% "rm -r /system/priv-app/com.amazon.ags.app/"
%shell% "rm -r /system/priv-app/com.amazon.avod/"
%shell% "rm -r /system/priv-app/com.amazon.bueller.music/"
%shell% "rm -r /system/priv-app/com.amazon.device.sync/"
%shell% "rm -r /system/priv-app/com.amazon.device.sync.sdk.internal/"
%shell% "rm -r /system/priv-app/com.amazon.kindle.devicecontrols/"
%shell% "rm -r /system/priv-app/com.amazon.kso.blackbird/"
%shell% "rm -r /system/priv-app/com.amazon.ods.kindleconnect/"
%shell% "rm -r /system/priv-app/com.amazon.securitysyncclient/"
%shell% "rm -r /system/priv-app/com.amazon.sharingservice.android.client.proxy.release/"
%shell% "rm -r /system/priv-app/com.amazon.shoptv.client/"
%shell% "rm -r /system/priv-app/com.amazon.tv.aiv.support/"
%shell% "rm -r /system/priv-app/com.amazon.tv.parentalcontrols/"
:: Amazon App Store
:: Do not remove to preserve app store version apps such as Netflix
::%shell% "rm -r /system/priv-app/com.amazon.venezia/"
:: Used for downloading from Amazon app store
::%shell% "rm -r /system/priv-app/com.amazon.kindle.cms-service/"
::%shell% "rm -r /system/priv-app/com.amazon.visualonawv/"
%shell% "rm -r /system/priv-app/ContentSupportProvider/"
%shell% "rm -r /system/priv-app/CrashManager/"
::%shell% "rm -r /system/priv-app/ConnectivityDiag/"
::%shell% "rm -r /system/priv-app/DeviceClientPlatformContractsFramework/"
::%shell% "rm -r /system/priv-app/DeviceMessagingAndroid/"
::%shell% "rm -r /system/priv-app/DeviceMessagingAndroidInternalSDK/"
::%shell% "rm -r /system/priv-app/DeviceMessagingAndroidSDK/"
:: Needed For Mouse Toggle and Maybe Others Using ADB Confirmation
::%shell% "rm -r /system/priv-app/FireApplicationCompatibilityEnforcer/"
::%shell% "rm -r /system/priv-app/FireApplicationCompatibilityEnforcerSDK/"
%shell% "rm -r /system/priv-app/FireRecessProxy/"
::%shell% "rm -r /system/priv-app/FireTVDefaultMediaReceiver/"
::%shell% "rm -r /system/priv-app/FireTvNotificationService/"
:: Do not remove on 6.2.7.1 (Breaks ADB Fingerprint Dialog)
::%shell% "rm -r /system/priv-app/FireTVSystemUI/"
%shell% "rm -r /system/priv-app/FusedLocation/"
%shell% "rm -r /system/priv-app/ManagedProvisioning/"
%shell% "rm -r /system/priv-app/marketplace_service_receiver/"
%shell% "rm -r /system/priv-app/UnifiedShareActivityChooser/"
%shell% "rm -r /system/priv-app/WallpaperCropper/"
:: Launcher
%shell% "rm -r /system/priv-app/com.amazon.tv.launcher/"
:: com.amazon.firehomestarter (Native Home Controller for Amazon)
%shell% "rm -r /system/priv-app/com.amazon.firehomestarter/"
:: OTA Updates
%shell% "rm -r /system/priv-app/DeviceSoftwareOTA/"
%shell% "rm -r /system/priv-app/DeviceSoftwareOTAIdleOverride/"
:: Help
%shell% "rm -r /system/priv-app/com.amazon.tv.csapp/"
:: Remote Update Service
::%shell% "rm -r /system/priv-app/com.amazon.device.bluetoothdfu/"
:: Fitbit Support?
%shell% "rm -r /system/priv-app/com.amazon.h2clientservice/"
:: Amazon Voice Support
::%shell% "rm -r /system/priv-app/com.amazon.vizzini/"
:: VoiceView
::%shell% "rm -r /system/priv-app/logan/"
:: USB Tuner
::%shell% "rm -r /system/priv-app/com.amazon.malcolm/"
:: FireOS 5.2.1.1
%shell% "rm -r /system/priv-app/com.amazon.tv.nimh/"
%shell% "rm -r /system/priv-app/FireTvSaleService/"
%shell% "rm -r /system/priv-app/IvonaTTS/"
%shell% "rm -r /system/priv-app/IvonaTtsOrchestrator/"
%shell% "rm -r /system/priv-app/TvProvider/"
:: FireOS 5.2.6.2
%shell% "rm -r /system/priv-app/com.amazon.tv.livetv/"
:: FireOS 6.2.5.8
%shell% "rm -r /system/priv-app/TIFObserverService/"
:: WiFi Locker
%shell% "rm -r /system/priv-app/CredentialLockerAndroid-tablet-release/"
:: OttSsoLib
::%shell% "rm -r /system/priv-app/com.amazon.tv.ottssolib/"
:: OttSsoCompanionApp
::%shell% "rm -r /system/priv-app/com.amazon.tv.ottssocompanionapp/"
:: Log Manager
%shell% "rm -r /system/priv-app/LogManager-logd/"
:: Amazon Echo?
%shell% "rm -r /system/priv-app/SsdpService/"
:: Settings Notification Center (Do Not Remove on 6.2.7.1)
::%shell% "rm -r /system/priv-app/com.amazon.tv.notificationcenter/"
:: Amazon Photos (Do Not Remove on 6.2.5.8)
%shell% "rm -r /system/priv-app/com.amazon.bueller.photos/"
:: DIAL (Discovery-and-Launch) protocol (allow apps to access via second screen)
%shell% "rm -r /system/priv-app/DialService/"
:: CustomMediaController
%shell% "rm -r /system/priv-app/com.amazon.cardinal/"
:: Under /system/app/
%shell% "rm -r /system/app/fdrw/"
%shell% "rm -r /system/app/PicoTts/"
%shell% "rm -r /system/app/WhiteListedUrlProvider/"
:: FrameworksMetrics
::%shell% "rm -r /system/app/FrameworksMetrics/"
:: Mantis 6.2.7.1
::%shell% "rm -r /system/app/AmazonWirelessMetricsService/"
::%shell% "rm -r /system/app/BasicDreams"
::%shell% "rm -r /system/app/BluetoothMidiService"
::%shell% "rm -r /system/app/CtsShimPrebuilt"
::%shell% "rm -r /system/app/ExtShared"
::%shell% "rm -r /system/app/GlobalKeyInterceptor"
::%shell% "rm -r /system/app/PrintSpooler"
::%shell% "rm -r /system/app/WallpaperBackup"
::%shell% "rm -r /system/app/whad_app"
:: BuellerDeviceService
%shell% "rm -r /system/priv-app/AmazonNetworkMonitor/"
:: %shell% "rm -r /system/app/CredentialStorage/"
:: %shell% "rm -r /system/app/FireOsMiddlewareDebugApp/"
:: %shell% "rm -r /system/app/sync-provider_ipc-tv-release/"
:: %shell% "rm -r /system/app/sync-service-fireos-tv-release/"
:: FireOS 5.2.6.7
:: ACAFireTVAndroidClient
%shell% "rm -r /system/priv-app/com.amazon.aca/"
:: Aria AriaRuntime
%shell% "rm -r /system/priv-app/com.amazon.aria/"
:: Fire TV Recast --
%shell% "rm -r /system/priv-app/com.amazon.franktvinput/"
:: News
%shell% "rm -r /system/priv-app/com.amazon.hedwig/"
:: Naatyam (Unknown)
%shell% "rm -r /system/priv-app/com.amazon.naatyam/"
:: KFTV Legal Notices
%shell% "rm -r /system/priv-app/com.amazon.tv.legal.notices/"
:: SmartConnectService (Unknown)
:: %shell% "rm -r /system/priv-app/com.amazon.net.smartconnect/"
:: FireOS 6.2.7.1
:: com.amazon.device.bluetoothkeymaplib (Unknown)
:: %shell% "rm -r /system/priv-app/BluetoothKeyMapLib/"
:: ALE (Unknown)
%shell% "rm -r /system/priv-app/com.amazon.ale/"
:: My Application 2.0 (WTF! LMAO)
%shell% "rm -r /system/priv-app/com.amazon.appaccesskeyprovider/"
:: Ceviche (Unknown)
%shell% "rm -r /system/priv-app/com.amazon.ceviche/"
:: Unknown
%shell% "rm -r /system/priv-app/com.amazon.dpcclient/"
:: Prime Video PVFTV
%shell% "rm -r /system/priv-app/com.amazon.firebat/"
:: FireRESTAPIFramework
%shell% "rm -r /system/priv-app/com.amazon.firerestapiframework/"
:: Gloria
%shell% "rm -r /system/priv-app/com.amazon.ftv.glorialist/"
:: Screensaver (REMOVAL CAN BREAK AMAZON UI)
:: %shell% "rm -r /system/priv-app/com.amazon.ftv.screensaver/"
:: com.amazon.ftv.xpicker stub-apk
%shell% "rm -r /system/priv-app/com.amazon.ftv.xpicker/"
:: Katoch (Unknown)
%shell% "rm -r /system/priv-app/com.amazon.katoch/"
:: %shell% "rm -r /system/priv-app/com.amazon.providers.tv/"
:: Equipment Control (REMOVAL CAN BREAK AMAZON UI)
::%shell% "rm -r /system/priv-app/com.amazon.tv.devicecontrol/"
::%shell% "rm -r /system/priv-app/com.amazon.tv.devicecontrolsettings/"
:: Forced App Updater
%shell% "rm -r /system/priv-app/com.amazon.tv.forcedotaupdater.v2/"
:: ReleaseNotes
%shell% "rm -r /system/priv-app/com.amazon.tv.releasenotes/"
:: FTV Routing
%shell% "rm -r /system/priv-app/com.amazon.tv.routing/"
:: Amazon Settings Core (REMOVAL CAN BREAK AMAZON UI)
:: %shell% "rm -r /system/priv-app/com.amazon.tv.settings.core/"
:: Amazon Settings v2 (REMOVAL CAN BREAK AMAZON UI)
:: %shell% "rm -r /system/priv-app/com.amazon.tv.settings.v2/"
:: Amazon FreeTime
%shell% "rm -r /system/priv-app/com.amazon.tahoe/"
:: Whisper Join FFS Middleware
%shell% "rm -r /system/priv-app/com.amazon.whisperjoin.middleware.np/"
:: com.amznfuse.operatorredirection (Unknown)
%shell% "rm -r /system/priv-app/com.amznfuse.operatorredirection/"
:: com.amazon.sync.provider.ipc
%shell% "rm -r /system/priv-app/sync-provider_ipc-tv-release/"
:: Mantis 6.2.7.1
::%shell% "rm -r /system/priv-app/ArcusListener"
::%shell% "rm -r /system/priv-app/AutoPairService"
::%shell% "rm -r /system/priv-app/CalendarProvider"
::%shell% "rm -r /system/priv-app/CarrierConfig"
::%shell% "rm -r /system/priv-app/com.amazon.assetsync.service"
::%shell% "rm -r /system/priv-app/com.amazon.avls.experience"
::%shell% "rm -r /system/priv-app/com.amazon.csm.htmlruntime-stub"
::%shell% "rm -r /system/priv-app/com.amazon.device.details"
::%shell% "rm -r /system/priv-app/com.amazon.gloria.smarthome"
::%shell% "rm -r /system/priv-app/com.amazon.imdb.tv.android.app"
::%shell% "rm -r /system/priv-app/com.amazon.mvpdauth"
::%shell% "rm -r /system/priv-app/com.amazon.whasettings"
::%shell% "rm -r /system/priv-app/com.amazon.whisperjoin.wss.wifiprovisioner"
::%shell% "rm -r /system/priv-app/ConnectivityControllerService"
::%shell% "rm -r /system/priv-app/ContactsProvider"
::%shell% "rm -r /system/priv-app/CtsShimPrivPrebuilt"
::%shell% "rm -r /system/priv-app/DeviceBackupAndRestore-release"
::%shell% "rm -r /system/priv-app/DeviceBackupAndRestoreInternalSDK-release"
::%shell% "rm -r /system/priv-app/DisplayMirroring"
::%shell% "rm -r /system/priv-app/DocumentsUI"
::%shell% "rm -r /system/priv-app/ExtServices"
::%shell% "rm -r /system/priv-app/FireOSDownloadProvider"
::%shell% "rm -r /system/priv-app/FireOSDownloadProviderUi"
::%shell% "rm -r /system/priv-app/RdmApplication"
::%shell% "rm -r /system/priv-app/SmartKeyManager"
::%shell% "rm -r /system/priv-app/StatementService"
::%shell% "rm -r /system/priv-app/UXControllerService"
::%shell% "rm -r /system/priv-app/UXNotificationService"
:: ------------------------------------------------------------------
:: Alexa Related
:: Alexa Shopping
%shell% "rm -r /system/priv-app/com.amazon.alexashopping/"
:: Alexa Voice Layer
::%shell% "rm -r /system/priv-app/com.amazon.avl.firetv/"
:: Fire TV Alexa Alerts
::%shell% "rm -r /system/priv-app/com.amazon.tv.alexaalerts/"
:: Alexa Notifications
::%shell% "rm -r /system/priv-app/com.amazon.tv.alexanotifications"
:: Alexa Updates on User Data
::%shell% "rm -r /data/app/com.amazon.alexashopping-1/"
::%shell% "rm -r /data/app/com.amazon.alexashopping-2/"
:: ------------------------------------------------------------------
%sleep% 5
cls
echo Removing any added System Components from Amazon App Updates...
echo.
:: Keep the settings one (possibly breaks Mouse Toggle app)
::%shell% "rm -r /data/app/com.amazon.tv.settings.v2-1/"
:: Save the screensaver update
::%shell% "rm -r /data/app/com.amazon.ftv.screensaver-1/"
:: Used For Equipment Control
::%shell% "rm -r /data/app/com.amazon.tv.devicecontrol-1/"
::%shell% "rm -r /data/app/com.amazon.tv.devicecontrolsettings-1/"
:: Amazon App Store
:: Do not remove to preserve app store version apps such as Netflix
::%shell% "rm -r /data/app/com.amazon.venezia-1/"
%shell% "rm -r /data/app/com.amazon.aca-1/"
%shell% "rm -r /data/app/com.amazon.ags.app-1/"
%shell% "rm -r /data/app/com.amazon.amazonvideo.livingroom.firetv-1/"
%shell% "rm -r /data/app/com.amazon.appaccesskeyprovider-1/"
%shell% "rm -r /data/app/com.amazon.aria-1/"
::%shell% "rm -r /data/app/com.amazon.avl.ftv-1/"
%shell% "rm -r /data/app/com.amazon.avod-1/"
%shell% "rm -r /data/app/com.amazon.bueller.music-1/"
%shell% "rm -r /data/app/com.amazon.cardinal-1/"
%shell% "rm -r /data/app/com.amazon.firebat-1/"
%shell% "rm -r /data/app/com.amazon.ftv.glorialist-1/"
%shell% "rm -r /data/app/com.amazon.hedwig-1/"
%shell% "rm -r /data/app/com.amazon.katoch-1/"
%shell% "rm -r /data/app/com.amazon.kso.blackbird-1/"
%shell% "rm -r /data/app/com.amazon.shoptv.client-1/"
%shell% "rm -r /data/app/com.amazon.tahoe-1/"
%shell% "rm -r /data/app/com.amazon.tv.launcher-1/"
%shell% "rm -r /data/app/com.amazon.tv.livetv-1/"
%shell% "rm -r /data/app/com.amazon.tv.ottssocompanionapp-1/"
%shell% "rm -r /data/app/com.amazon.tv.releasenotes-1/"
%shell% "rm -r /data/app/com.amazon.aca-2/"
%shell% "rm -r /data/app/com.amazon.ags.app-2/"
%shell% "rm -r /data/app/com.amazon.amazonvideo.livingroom.firetv-2/"
%shell% "rm -r /data/app/com.amazon.appaccesskeyprovider-2/"
%shell% "rm -r /data/app/com.amazon.aria-2/"
::%shell% "rm -r /data/app/com.amazon.avl.ftv-2/"
%shell% "rm -r /data/app/com.amazon.avod-2/"
%shell% "rm -r /data/app/com.amazon.bueller.music-2/"
%shell% "rm -r /data/app/com.amazon.cardinal-2/"
%shell% "rm -r /data/app/com.amazon.firebat-2/"
%shell% "rm -r /data/app/com.amazon.ftv.glorialist-2/"
%shell% "rm -r /data/app/com.amazon.hedwig-2/"
%shell% "rm -r /data/app/com.amazon.katoch-2/"
%shell% "rm -r /data/app/com.amazon.kso.blackbird-2/"
%shell% "rm -r /data/app/com.amazon.shoptv.client-2/"
%shell% "rm -r /data/app/com.amazon.tahoe-2/"
%shell% "rm -r /data/app/com.amazon.tv.launcher-2/"
%shell% "rm -r /data/app/com.amazon.tv.livetv-2/"
%shell% "rm -r /data/app/com.amazon.tv.ottssocompanionapp-2/"
%shell% "rm -r /data/app/com.amazon.tv.releasenotes-2/"
%sleep% 5
cls
echo Setting Up Directories For Restore...
echo.
%shell% "rm -r /sdcard/restore/"
%shell% "mkdir /sdcard/restore/"
%shell% "rm -r /sdcard/TitaniumBackup/"
%shell% "mkdir /sdcard/restore/apk/"
%shell% "mkdir /sdcard/restore/apk/system/"
%sleep% 2
cls
echo Pushing Restore Data to /sdcard/...
echo.
%push% "data\mantis\post-debloated\all\restore" /sdcard/restore/
if %downgrade%==1 %push% "data\mantis\post-debloated\6258\restore" /sdcard/restore/
if %downgrade%==0 %push% "data\mantis\post-debloated\6271\restore" /sdcard/restore/
%sleep% 2
cls
echo Copying TitaniumBackup Data For Restore...
echo.
%shell% "cp -r /sdcard/restore/TitaniumBackup/ /sdcard/"
%sleep% 2
cls
echo Creating System Restore Directories and Setting Permissions...
echo.
%shell% "rm -r /system/restore/"
%shell% "mkdir /system/restore/"
%shell% "mkdir /system/restore/apk/"
%shell% "mkdir /system/restore/apk/system/"
%shell% "chmod 0777 /system/restore/"
%shell% "chown root:root /system/restore/"
%shell% "chmod 0777 /system/restore/apk/"
%shell% "chown root:root /system/restore/apk/"
%shell% "chmod 0777 /system/restore/apk/system/"
%shell% "chown root:root /system/restore/apk/system/"
cls
echo Copying Data from /sdcard to /system...
echo.
%shell% "cp -r /sdcard/restore/ /system/"
%sleep% 2
if %downgrade%==1 (
cls
echo Settings Permissions...
echo.
:: such empty
%sleep% 2
cls
echo Removing Unused Images and Sounds...
echo.
:: such empty
%sleep% 2
cls
echo Installing Magisk for SU and ADB Access on Stock Rom...
echo.
%push% "rooting\%magiskZip%" /data/local/tmp/
%twrp% install /data/local/tmp/%magiskZip%
%sleep% 3
cls
if %downgrade%==0 echo Wiping Cache and Dalvik...
if %downgrade%==1 echo Wiping Data, Cache, and Dalvik...
echo.
if %downgrade%==0 %twrp% wipe cache
if %downgrade%==1 %twrp% wipe data
%twrp% wipe dalvik
%sleep% 5
cls
echo Waiting For Cache Rebuild and ADB Service...
echo.
echo This may take up to 5 minutes or more and Remote Find screen will be loaded
echo.
echo Do not interact with the device yet!
echo.
%adb% reboot
%adbWait%
)
:: Skip Downgrade for now
goto skipmnt
::if %downgrade%==0 goto skipmnt
cls
echo Rebooting Back To Recovery To Continue...
echo.
%adb% reboot recovery
%sleep% 15
:stage3
set rwcheck=0
cls
echo Mounting System as RW...
echo.
%shell% "mount -o rw /system"
echo.
echo Check For RW Mount Status
echo.
echo.
echo Press 1 if there is an error, otherwise just press ENTER
echo.
set /p rwcheck=
if %rwcheck%==1 echo.
if %rwcheck%==1 echo Waiting on Reboot...
if %rwcheck%==1 echo.
if %rwcheck%==1 %adb% reboot recovery
if %rwcheck%==1 %sleep% 15
if %rwcheck%==1 goto stage3
%sleep% 3
:skipmnt
:: TODO add Controllers script
cls
echo Pushing Settings Scripts to Temp...
echo.
%push% %accessibility% /data/local/tmp/
%push% %alexa% /data/local/tmp/
%push% %applications% /data/local/tmp/
%push% %btcontroller% /data/local/tmp/
%push% %equipment% /data/local/tmp/
%push% %device% /data/local/tmp/
%push% %displaysounds% /data/local/tmp/
%push% %help% /data/local/tmp/
%push% %myaccount% /data/local/tmp/
%push% %network% /data/local/tmp/
%push% %notifications% /data/local/tmp/
%push% %preferences% /data/local/tmp/
%sleep% 2
cls
echo Pushing Restore Home Script to Temp...
echo.
%push% "scripts\clean-sdcard-lite.sh" /data/local/tmp/
%push% "scripts\restore-home.sh" /data/local/tmp/
%sleep% 2
cls
echo Making Directories and Setting Permissions for Settings Scripts...
echo.
%shell% "rm -r /system/scripts/"
%shell% "mkdir /system/scripts/"
%shell% "chmod 0777 /system/scripts/"
%sleep% 2
cls
echo Copying Settings Scripts From Temp to /system...
echo.
%shell% "cp /data/local/tmp/accessibility.sh /system/scripts/accessibility.sh"
%shell% "cp /data/local/tmp/alexa.sh /system/scripts/alexa.sh"
%shell% "cp /data/local/tmp/applications.sh /system/scripts/applications.sh"
%shell% "cp /data/local/tmp/btcontroller.sh /system/scripts/btcontroller.sh"
%shell% "cp /data/local/tmp/device.sh /system/scripts/device.sh"
%shell% "cp /data/local/tmp/display-sounds.sh /system/scripts/display-sounds.sh"
%shell% "cp /data/local/tmp/equipment.sh /system/scripts/equipment.sh"
%shell% "cp /data/local/tmp/help.sh /system/scripts/help.sh"
%shell% "cp /data/local/tmp/my-account.sh /system/scripts/my-account.sh"
%shell% "cp /data/local/tmp/network.sh /system/scripts/network.sh"
%shell% "cp /data/local/tmp/notifications.sh /system/scripts/notifications.sh"
%shell% "cp /data/local/tmp/preferences.sh /system/scripts/preferences.sh"
%sleep% 2
cls
echo Copying Restore Home Script From Temp to /system...
echo.
%shell% "cp /data/local/tmp/clean-sdcard-lite.sh /system/scripts/clean-sdcard-lite.sh"
%shell% "cp /data/local/tmp/restore-home.sh /system/scripts/restore-home.sh"
%sleep% 2
cls
echo Setting Permissions...
echo.
%shell% "chmod 0777 /system/scripts/*.sh"
%shell% "chown root:root /system/scripts/*.sh"
%sleep% 2
cls
echo Copying Apps to /system/app/...
echo.
%shell% "rm -r /system/app/Launcher/"
%shell% "mkdir /system/app/Launcher/"
%shell% "chmod 0775 /system/app/Launcher/"
%shell% "chown root:root /system/app/Launcher/"
%shell% "cp /system/restore/apk/system/Launcher.apk /system/app/Launcher/Launcher.apk"
%shell% "rm -r /system/app/ScriptRunner/"
%shell% "mkdir /system/app/ScriptRunner/"
%shell% "chmod 0775 /system/app/ScriptRunner/"
%shell% "chown root:root /system/app/ScriptRunner/"
%shell% "cp /system/restore/apk/system/ScriptRunner.apk /system/app/ScriptRunner/ScriptRunner.apk"
%shell% "rm -r /system/app/TitaniumBackup/"
%shell% "mkdir /system/app/TitaniumBackup/"
%shell% "chmod 0775 /system/app/TitaniumBackup/"
%shell% "chown root:root /system/app/TitaniumBackup/"
%shell% "cp /system/restore/apk/system/TitaniumBackup.apk /system/app/TitaniumBackup/TitaniumBackup.apk"
%shell% "rm -r /system/app/TitaniumBackupAddon/"
%shell% "mkdir /system/app/TitaniumBackupAddon/"
%shell% "chmod 0775 /system/app/TitaniumBackupAddon/"
%shell% "chown root:root /system/app/TitaniumBackupAddon/"
%shell% "cp /system/restore/apk/system/TitaniumBackupAddon.apk /system/app/TitaniumBackupAddon/TitaniumBackupAddon.apk"
%sleep% 2
cls
echo Setting Permissions For System Apps...
echo.
%shell% "chmod 0644 /system/app/Launcher/Launcher.apk"
%shell% "chown root:root /system/app/Launcher/Launcher.apk"
%shell% "chmod 0644 /system/app/ScriptRunner/ScriptRunner.apk"
%shell% "chown root:root /system/app/ScriptRunner/ScriptRunner.apk"