forked from DevShaft/Backup-TA
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Backup-TA.bat
104 lines (95 loc) · 2.6 KB
/
Backup-TA.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
@echo off
setlocal EnableDelayedExpansion
set VERSION=9.11
REM #####################
REM ## CHOICE CHECK
REM #####################
choice /T 0 /D Y /C Y /M test > nul 2>&1
if "!errorlevel!" == "1" (
set CHOICE=choice
set CHOICE_TEXT_PARAM=/M
) else (
choice /T 0 /D Y /C Y test > nul 2>&1
if "!errorlevel!" == "1" (
set CHOICE=choice
set CHOICE_TEXT_PARAM=
) else (
tools\choice32.exe /TY,1 /CY > nul 2>&1
if "!errorlevel!" == "1" (
set CHOICE=tools\choice32.exe
) else (
tools\choice32_alt.exe /T 0 /D Y /C Y /M test > nul 2>&1
if "!errorlevel!" == "1" (
set CHOICE=tools\choice32_alt.exe
set CHOICE_TEXT_PARAM=/M
) else (
tools\choice64.exe /T 0 /D Y /C Y /M test > nul 2>&1
if "!errorlevel!" == "1" (
set CHOICE=tools\choice64.exe
set CHOICE_TEXT_PARAM=/M
)
)
)
)
)
cd %~dp0
if NOT exist tmpbak mkdir tmpbak > nul 2>&1
call scripts\license.bat showLicense
call:initialize
call scripts\adb.bat wakeDevice
call scripts\busybox.bat pushBusyBox
call scripts\root.bat check hasRoot
if NOT "!hasRoot!" == "1" goto quit
call scripts\menu.bat showMenu
goto quit
REM #####################
REM ## INITIALIZE
REM #####################
:initialize
cls
echo.
echo [ ------------------------------------------------------------ ]
echo [ Backup TA v%VERSION% for Sony Xperia ]
echo [ ------------------------------------------------------------ ]
echo [ Initialization ]
echo [ ]
echo [ Make sure that you have USB Debugging enabled, you do ]
echo [ allow your computer ADB access by accepting its RSA key ]
echo [ (only needed for Android 4.2.2 or higher) and grant this ]
echo [ ADB process root permissions through superuser. ]
echo [ ------------------------------------------------------------ ]
echo.
set PARTITION_BY_NAME=/dev/block/platform/msm_sdcc.1/by-name/TA
goto:eof
REM #####################
REM ## DISPOSE
REM #####################
:dispose
echo.
echo =======================================
echo CLEAN UP
echo =======================================
set partition=
set choiceTextParam=
set choice=
call scripts\menu.bat dispose
call scripts\backup.bat dispose
call scripts\restore.bat dispose
call scripts\convert.bat dispose
if exist tmpbak (
del /q /s tmpbak\*.*
rmdir tmpbak
)
call scripts\busybox.bat dispose
set /p "=Killing ADB Daemon..." < nul
tools\adb kill-server > nul 2>&1
echo OK
goto:eof
REM #####################
REM ## QUIT
REM #####################
:quit
call:dispose
echo.
pause
goto:eof