Apktool/scripts/windows/apktool.bat
Goooler 7bb6956304
Update github actions & Update gradle (#2628)
* Bump setup-java actions to v2

* Make test action on all branches

* Add dependabot.yml for updating github actions

* Update gradle 7.2

* Revert "Make test action on all branches"

This reverts commit 52758ea249d969f3b94f3ae5d4b5b980103a5cfa.

* Correct jdk

* Revert "Add dependabot.yml for updating github actions"

This reverts commit 7381e8f71c656499e7d0cc70e854b5e4978722d0.

* Run CI after workflows configs changed
2021-08-24 07:59:22 -04:00

43 lines
1.0 KiB
Batchfile
Executable File

@echo off
setlocal
set BASENAME=apktool_
chcp 65001 2>nul >nul
set java_exe=java.exe
if defined JAVA_HOME (
set java_exe="%JAVA_HOME%\bin\java.exe"
)
rem Find the highest version .jar available in the same directory as the script
setlocal EnableDelayedExpansion
pushd "%~dp0"
if exist apktool.jar (
set BASENAME=apktool
goto skipversioned
)
set max=0
for /f "tokens=1* delims=-_.0" %%A in ('dir /b /a-d %BASENAME%*.jar') do if %%~B gtr !max! set max=%%~nB
:skipversioned
popd
setlocal DisableDelayedExpansion
rem Find out if the commandline is a parameterless .jar or directory, for fast unpack/repack
if "%~1"=="" goto load
if not "%~2"=="" goto load
set ATTR=%~a1
if "%ATTR:~0,1%"=="d" (
rem Directory, rebuild
set fastCommand=b
)
if "%ATTR:~0,1%"=="-" if "%~x1"==".apk" (
rem APK file, unpack
set fastCommand=d
)
:load
%java_exe% -jar -Duser.language=en -Dfile.encoding=UTF8 "%~dp0%BASENAME%%max%.jar" %fastCommand% %*
rem Pause when ran non interactively
for /f "tokens=2" %%# in ("%cmdcmdline%") do if /i "%%#" equ "/c" pause