-
Notifications
You must be signed in to change notification settings - Fork 2
/
toolkit.bat
159 lines (143 loc) · 3.56 KB
/
toolkit.bat
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
@echo off
set adb=bin\adb.exe
set fastboot=bin\fastboot.exe
set supersuver=2.46
set supersuzip=UPDATE-SuperSU-v$supersuver.zip
set twrp=img\twrp-2.8.6.0-titan.img
goto toolkit
goto disclaimer
goto menu
:toolkit
echo Universal Moto G 2014 Toolkit
echo By luca020400
echo Version 2.0
echo.
echo Press Enter to continue
echo Press CTRL+c to abort
pause > nul
echo.
:disclaimer
echo /*
echo * Your warranty is now void. Knox 0x1.
echo *
echo * I am not responsible for bricked devices, dead SD cards,
echo * thermonuclear war, or you getting fired because the alarm app failed.
echo * Please do some research if you have any concerns about this tool !
echo * YOU are choosing to make these modifications, and if
echo * you point the finger at me for messing up your device, I will laugh at you. Hard. A lot.
echo */
echo.
:adb_authorization
echo You have to enable USB Debugging in Developer Settings
echo When done Press Enter
pause > nul
echo Click 'Always allow from this computer'
echo And then OK
echo When done Press Enter
%adb% wait-for-device > nul
pause > nul
echo.
:menu
cls
echo Universal Moto G 2014 Toolkit Menu
echo.
echo [rb] Reboot to Bootloader from Phone/Recovery
echo [rp] Reboot to Phone from Bootloader
echo [rr] Reboot to Recovery from Phone
echo [1] TWRP 2.8.6.0 Flash
echo [2] TWRP 2.8.6.0 Boot
echo [3] Philz Flash
echo [4] Philz Boot
echo [5] Root with SuperSU %supersuver%
echo [6] Logo Without Warning
echo [7] Logo With Warning
echo [8] Busybox Installer
echo [9] Bootloader Unlock
echo [10] Bootloader Relock
echo [q] Exit
echo.
SET /P choice=">
echo.
if %choice%==rb %adb% reboot-bootloader > nul & cls
if %choice%==rp %fastboot% reboot > nul & cls
if %choice%==rr %adb% reboot Recovery > nul & cls
if %choice%==1 goto twrp_flash
if %choice%==2 goto twrp_boot
if %choice%==3 goto philz_flash
if %choice%==4 goto philz_boot
if %choice%==5 goto root
if %choice%==6 goto logo_nowarn
if %choice%==7 goto logo_warn
if %choice%==8 goto busybox
if %choice%==9 goto bootloader_unlock
if %choice%==10 goto bootloader_relock
if %choice%==q echo Exiting ... & exit /b
echo Unknown Command
goto menu
:twrp_flash
%fastboot% flash recovery %twrp%
cls
goto :menu
:twrp_boot
%fastboot% boot %twrp%
cls
goto :menu
:philz_flash
&fastboot% flash recovery img\philz.img
cls
goto :menu
:philz_boot
%fastboot% boot img\philz.img
cls
goto :menu
:root
%fastboot% boot %twrp%
ping 1.1.1.1 -n 1 -w 20000 > nul
%adb% push mods\%supersu% /tmp/.
%adb% shell twrp install /tmp/%supersu%
%adb% reboot-bootloader
cls
goto :menu
:logo_nowarn
%fastboot% flash logo mods/logo-nowarning.bin
cls
goto :menu
:logo_warn
%fastboot% flash logo mods/logo-warning.bin
cls
goto :menu
:busybox
%fastboot% boot %twrp%
ping 1.1.1.1 -n 1 -w 20000 > nul
%adb% push mods\busybox.zip /tmp/.
%adb% shell twrp install /tmp/busybox.zip
%adb% reboot-bootloader
cls
goto :menu
:bootloader_unlock
echo Are you sure ?? Do you know the risks ?? Are you willing to do this ??
echo If so Press Enter
pause > nul
echo Go to http://bit.ly/UpVtsa and read the risks
ping 1.1.1.1 -n 1 -w 3000 > nul
echo When done press Enter
pause > nul
echo Follow the guide inside the site and then
echo Enter this code
%fastboot% oem get_unlock_data
echo As shown in the example
echo Enter the key emailed to you here
SET /P code="> "
%fastboot% oem unlock $code
cls
goto :menu
:bootloader_relock
%fastboot% lock begin
echo Now you have to flash the stock image
echo This is an example http://forum.xda-developers.com/moto-g-2014/general/restore-to-stock-t2873657
echo When done press Enter
pause > nul
%fastboot% oem lock
echo Your bootloader is now locked
cls
goto :menu