I don't know how many other people work in Windows frequently, but I do, and I wanted to zip align files in a ROM before packaging it for release. I couldn't find an easy method to do this posted anywhere else, so I created one. Here is a batch file that you can place in a folder, and it will go through the directory and sub-directories and zip align all apk files that are found. It's fairly simple, and I haven't seen any issues with it in my limited testing, but anything could happen, so you may want to keep a backup just in case. I posted it on Github, but will post the code here as well for anyone that may want it. Just copy and paste the below into a file with the extension of *.bat. Also, zipalign will need to be in your Windows $PATH for this to work properly. Hopefully, if you're using this, you can figure out how to do that, if not, you should before you use it.
@echo off<br /> REM Batch file to recursively zip align *.apk files in a directory<br /> REM and its sub-directories. This is significantly easier and faster<br /> REM than manually zip aligning them.<br /> @echo Zip aligning now...<br /> for /R %%X in (*.apk) do zipalign 4 "%%X" "%%~dpX%%~nX.new"<br /> @echo Replacing non-aligned files with zip aligned files...<br /> for /R %%X in (*.new) do move /Y "%%X" "%%~dpX%%~nX.apk"<br /> @echo Zip aligning done, press any key to exit<br /> pause