31 lines
747 B
Batchfile
31 lines
747 B
Batchfile
@echo off
|
|
rem Decompile all .jar files in this folder using jd-cli
|
|
rem For each jar, creates a folder named <jarname>_src unless it already exists
|
|
|
|
setlocal enabledelayedexpansion
|
|
pushd "%~dp0"
|
|
|
|
echo Searching for .jar files in %cd%
|
|
|
|
for %%F in (*.jar) do (
|
|
if exist "%~dp0%%~nF_src\" (
|
|
echo Skipping %%~nxF - output folder "%~dp0%%~nF_src" already exists
|
|
) else (
|
|
echo Creating directory "%~dp0%%~nF_src"
|
|
mkdir "%~dp0%%~nF_src" 2>nul
|
|
if exist "%~dp0%%~nF_src\" (
|
|
echo Decompiling %%~nxF to "%~dp0%%~nF_src"
|
|
jd-cli -od "%~dp0%%~nF_src" "%%~fF"
|
|
if errorlevel 1 (
|
|
echo jd-cli returned an error for %%~nxF
|
|
)
|
|
) else (
|
|
echo Failed to create directory "%~dp0%%~nF_src" - skipping %%~nxF
|
|
)
|
|
)
|
|
)
|
|
|
|
popd
|
|
endlocal
|
|
exit /b 0
|
|
|