forked from woheller69/FreeDroidWarn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAPK_Installer.bat
More file actions
82 lines (72 loc) · 1.63 KB
/
APK_Installer.bat
File metadata and controls
82 lines (72 loc) · 1.63 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
@echo off
setlocal enabledelayedexpansion
:: Set ADB path (assuming it's in Downloads)
set "adb_path=%USERPROFILE%\Downloads\adb.exe"
:: Check if adb exists
if not exist "%adb_path%" (
echo Error: adb.exe not found in %USERPROFILE%\Downloads
echo Please place adb.exe in your Downloads folder and try again.
pause
exit /b 1
)
:: Check if any APK files exist
set "apk_count=0"
for %%f in ("%USERPROFILE%\Downloads\*.apk") do (
set /a apk_count+=1
)
if %apk_count% equ 0 (
echo No APK files found in Downloads folder.
pause
exit /b 1
)
echo Available APK files:
echo ====================
set "counter=1"
for %%f in ("%USERPROFILE%\Downloads\*.apk") do (
echo !counter!. %%~nxf
set "apk_!counter!=%%f"
set /a counter+=1
)
echo.
echo 0. Exit
:menu
echo.
set /p choice="Select APK to install (0-%apk_count%): "
if "%choice%" equ "0" (
echo Goodbye!
exit /b 0
)
:: Validate selection
set "valid=false"
for /l %%i in (1,1,%apk_count%) do (
if "%choice%" equ "%%i" set "valid=true"
)
if "%valid%" equ "false" (
echo Invalid selection. Please try again.
goto menu
)
:: Install selected APK
echo Installing APK...
set "selected_apk="
for /l %%i in (1,1,%apk_count%) do (
if "%choice%" equ "%%i" (
set "selected_apk=!apk_%%i!"
goto install_apk
)
)
:install_apk
if defined selected_apk (
echo Installing: %selected_apk%
"%adb_path%" install "%selected_apk%"
if %errorlevel% equ 0 (
echo.
echo Successfully installed!
) else (
echo.
echo Installation failed!
)
) else (
echo Error: Could not find selected APK file
)
pause
goto menu