メイン スクリプトにスクリプトがありますが、このセクションが正しく機能しません
私が取り組んでいる変更を含む完全なものをここからダウンロードできますが、理論的には機能する必要があるときに機能しないようです
http://apkmultitool.com/downloads/APK-Multi-Tool-Test-Build.zip
CLS
ECHO Weclome to the Batch Optimization Menu
ECHO You have one of three options
ECHO 1 Batch Zipalign
ECHO 2 Batch Optomize PNG Files
ECHO 3 Batch Optomize PNG Files as well as ZIPALIGN APK files afterword.
set /P INPUT=Type input 1 - 3: %=%
if (%INPUT%)==1 GOTO zipo
if (%INPUT%)==2 GOTO ponly
if (%INPUT%)==3 GOTO zipb
:zipo
FOR %%F IN (place-apk-here-to-batch-optimize\*.apk) DO (call :zipoa "%%F")
:zipoa
IF %1 == () goto zipob
cd other
Start "Starting Batch Zipalign of APK Files" batchzip01
goto restart
:zipob
ECHO Folder is empty please place files inside and try again
PAUSE
goto restart
:ponly
FOR %%F IN (place-apk-here-to-batch-optimize\*.apk) DO (call :ponlya "%%F")
:ponlya
IF %1 == () goto ponlyb
cd other
Start "Starting Batch Optomize of PNG Files" batchopt01
goto restart
:ponlyb
ECHO Folder is empty please place files inside and try again
PAUSE
goto restart
:zipb
FOR %%F IN (place-apk-here-to-batch-optimize\*.apk) DO (call :zipba "%%F")
:zipba
IF %1 == () goto zipbb
cd other
Start "Starting Batch Optomize of PNG Files as well as Zipalign of APK Files " batchopt02
goto restart
:zipbb
ECHO Folder is empty please place files inside and try again
PAUSE
goto restart
しかし、3 つのオプションのいずれかを実行しようとすると、ハングします。
batchopt01.bat
@echo off
cd ../place-apk-here-to-batch-optimize
FOR %%F IN (*.apk) DO (call :optipng "%%F")
:optipng
IF %1 == () goto end
:: makes working folders
md "..\optimized"
md "%~dp0untouched"
md "%~dp0apkopt_temp_%~n1"
:: uncompressing contents of apks
"%~dp07za.exe" x -o"%~dp0apkopt_temp_%~n1" %1
:: moves 9.png files to a seperate folder before optomizing normale png files
mkdir "%~dp0temp"
xcopy "apkopt_temp_%~n1\res\*.9.png" "%~dp0temp" /S /Y
:: -o* (0-99) specifies how much the image is optimized
"%~dp0roptipng.exe" -o99 "%~dp0apkopt_temp_%~n1\**\*.png"
xcopy "%~dp0temp" "%~dp0apkopt_temp_%~n1\res" /S /Y
rmdir "%~dp0temp" /S /Q
copy /b %1 "..\untouched"
del /q %1
:: -mx%usrc% (0-9) indicates the compression level used for all working apks
"%~dp07za.exe" a -tzip "..\optimized\%~n1.apk" "%~dp0apkopt_temp_%~n1\*" -mx%usrc% -mmt
rd /s /q "%~dp0apkopt_temp_%~n1"
:end
ECHO Batch Optomize of PNG Files Completed.
PAUSED
exit
batchopt02.bat
@echo off
cd ../place-apk-here-to-batch-optimize
FOR %%F IN (*.apk) DO (call :optipng "%%F")
:optipng
IF %1 == () goto end
:: makes working folders
md "..\optimized"
md "%~dp0untouched"
md "%~dp0apkopt_temp_%~n1"
:: uncompressing contents of apks
"%~dp07za.exe" x -o"%~dp0apkopt_temp_%~n1" %1
:: moves 9.png files to a seperate folder before optomizing normale png files
mkdir "%~dp0temp"
xcopy "%~dp0apkopt_temp_%~n1\res\*.9.png" "%~dp0temp" /S /Y
:: -o* (0-99) specifies how much the image is optimized
"%~dp0roptipng.exe" -o99 "%~dp0apkopt_temp_%~n1\**\*.png"
xcopy "%~dp0temp" "%~dp0apkopt_temp_%~n1\res" /S /Y
rmdir "temp" /S /Q
copy /b %1 "%~dp0untouched"
del /q %1
:: -mx%usrc% (0-9) indicates the compression level used for all working apks
%~dp07za.exe" a -tzip "..\optimized\%~n1.apk" "%~dp0apkopt_temp_%~n1\*" -mx%usrc% -mmt
rd /s /q "%~dp0apkopt_temp_%~n1"
:end
ECHO Batch Optomize of PNG Files Completed Now Beginig Zipalign functions.
cd "%~dp0"
Start "Starting Batch Zipalign of APK Files" batchzip02
exit
batchzip01.bat
@echo off
cd ../place-apk-here-to-batch-optimize
FOR %%F IN ("*.apk) DO (call :zipalign "%%F")
:zipalign
IF %1 == () goto end
:: makes working folder
md "../zipaligned"
:: -zipalign -v * (4) indicates the amount of bytes used to optimize apks
"%~dp0zipalign.exe" -v 4 "%~n1.apk" "../zipaligned\%~n1.apk"
del /q %1
:end
exit
batchzip02.bat
@echo off
cd ../optimized
FOR %%F IN ("*.apk) DO (call :zipalign "%%F")
:zipalign
IF %1 == () goto end
:: makes working folder
md "..\zipaligned"
:: -zipalign -v * (4) indicates the amount of bytes used to optimize apks
"%~dp0zipalign.exe" -v 4 "%~n1.apk" "..\zipaligned\%~n1.apk"
del /q %1
:end
exit