-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgsi-tool-windows.bat
More file actions
90 lines (79 loc) · 2.12 KB
/
Copy pathgsi-tool-windows.bat
File metadata and controls
90 lines (79 loc) · 2.12 KB
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
@echo off
where adb >nul 2>&1
if %errorlevel% neq 0 goto missing_tools
where fastboot >nul 2>&1
if %errorlevel% neq 0 goto missing_tools
:start
cls
echo Welcome to GSI Flash Tool by FeDeveloper95 - https://github.com/FeDeveloper95
echo.
echo Choose the current state of the device:
echo 1. Booted in Android
echo 2. Recovery
echo 3. Bootloader
echo 4. Fastboot
echo 5. Quit
set /p "choice_state=Input: "
if "%choice_state%"=="5" exit /b 0
if "%choice_state%"=="4" goto action_menu
if "%choice_state%"=="3" goto bootloader
if "%choice_state%"=="2" goto booted
if "%choice_state%"=="1" goto booted
goto start
:booted
adb reboot fastboot
goto action_menu
:bootloader
fastboot reboot fastboot
goto action_menu
:action_menu
echo.
echo Choose the action to perform:
echo 1. Update System
echo 2. Reset and Flash
echo 3. Back to Start
set /p "choice_action=Input: "
if "%choice_action%"=="3" goto start
if "%choice_action%"=="2" goto reset_system
if "%choice_action%"=="1" goto update_system
goto action_menu
:missing_file
echo.
echo Error: Missing vbmeta.img, system.img, or recovery.img!
pause
goto action_menu
:update_system
if not exist vbmeta.img goto missing_file
if not exist system.img goto missing_file
if not exist recovery.img goto missing_file
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot flash vbmeta vbmeta.img
fastboot flash system system.img
fastboot flash recovery recovery.img
fastboot reboot
echo Flashed!
pause
exit /b 0
:reset_system
if not exist vbmeta.img goto missing_file
if not exist system.img goto missing_file
if not exist recovery.img goto missing_file
fastboot erase userdata
fastboot erase metadata
fastboot delete-logical-partition product_b
fastboot delete-logical-partition product
fastboot delete-logical-partition product_a
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot flash vbmeta vbmeta.img
fastboot flash system system.img
fastboot flash recovery recovery.img
fastboot erase userdata
fastboot erase metadata
fastboot reboot
echo Flashed!
pause
exit /b 0
:missing_tools
echo Error: ADB or Fastboot not found in PATH!
pause
exit /b 1