Skip to content

Commit

Permalink
Update apktool.bat (#2930)
Browse files Browse the repository at this point in the history
Added missing quotes required for the file to work in Windows
  • Loading branch information
Build-0-Matic authored Nov 12, 2022
1 parent 07d15e8 commit e46f779
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/windows/apktool.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ chcp 65001 2>nul >nul
set java_exe=java.exe

if defined JAVA_HOME (
set "java_exe=%JAVA_HOME%\bin\java.exe"
set "java_exe"="%JAVA_HOME%\bin\java.exe"
)

rem Find the highest version .jar available in the same directory as the script
Expand Down

3 comments on commit e46f779

@pashamcr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not right.
Run cmd and enter your command, check the result:

set "java_exe"="%JAVA_HOME%\bin\java.exe"
echo %java_exe%
%java_exe%

previously it was correct:

set "java_exe=%JAVA_HOME%\bin\java.exe"
echo %java_exe%
C:\Program Files\Java\jdk-11.0.16.1\bin\java.exe

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/set_1

@iBotPeaches
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted.

@pashamcr
Copy link
Contributor

@pashamcr pashamcr commented on e46f779 Nov 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iBotPeaches
Earlier it was like this:

set java_exe="%JAVA_HOME%\bin\java.exe"
echo %java_exe%
"C:\Program Files\Java\jdk-11.0.16.1\bin\java.exe"

also works without quotes at all (https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/set_1):

set java_exe=%JAVA_HOME%\bin\java.exe
echo %java_exe%
C:\Program Files\Java\jdk-11.0.16.1\bin\java.exe

example:
https://android.googlesource.com/platform/tools/apksig/+/refs/heads/master/etc/apksigner.bat#41

Please sign in to comment.