-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtractor.bat
More file actions
83 lines (72 loc) · 1.96 KB
/
Extractor.bat
File metadata and controls
83 lines (72 loc) · 1.96 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
@echo off
chcp 65001
title Extrator de Arquivos
setlocal enabledelayedexpansion
color 0E
:: Verifica se o launcher "py" está instalado; caso não esteja, tenta o "python"
where py >nul 2>&1
if errorlevel 1 (
where python >nul 2>&1
if errorlevel 1 (
echo Python não encontrado! Instale primeiro:
echo https://www.python.org/downloads/
timeout 10
exit /b 1
) else (
set "python_cmd=python"
)
) else (
set "python_cmd=py"
)
set "python_script=extrator.py"
:: Mensagens
set "msg_no_python=Python não encontrado! Instale primeiro:"
set "msg_invalid_folder=Pasta inválida: "
set "msg_no_folder=Nenhuma pasta selecionada!"
set "msg_decompile_prompt=Deseja decompilar arquivos .jar? (S/N): "
set "msg_processing=Processando... Aguarde."
:inicio
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo ARRASTE UMA PASTA PARA INICIAR A EXTRAÇÃO
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo.
:: Solicita a pasta ao usuário
set "pasta="
set /p "pasta=Arraste a pasta para esta janela e pressione Enter: "
:: Remove aspas e valida
set "pasta=%pasta:"=%"
if "%pasta%"=="" (
echo %msg_no_folder%
timeout 2
goto inicio
)
if not exist "%pasta%" (
echo %msg_invalid_folder% "%pasta%"
timeout 3
goto inicio
)
:: Verifica se há arquivos .jar na pasta
set "has_jar=0"
dir /s /b "%pasta%\*.jar" >nul 2>&1 && set "has_jar=1"
:: Pergunta sobre decompilação apenas se houver .jar
set "args="
if %has_jar% equ 1 (
echo.
:pergunta_decompile
set "opcao="
set /p "opcao=%msg_decompile_prompt%"
if /i "%opcao%"=="S" (
set "args=--decompile"
) else if /i "%opcao%"=="N" (
set "args="
) else (
echo Digite S ou N.
goto pergunta_decompile
)
)
:: Executa o script Python
echo %msg_processing%
%python_cmd% "%python_script%" "%pasta%" %args%
:: Mantém a janela aberta
pause