can someone make a script for windows or a bat file that can zipalign a batch of apks? I am not that ofay with line commands and when i create a new theme (which i often do), i then have to go and zipalign every single apk i have altered 1 at a time..... i do:
zipalign -f -v 4 E:\app\theapp.apk E:\app\theapp.apk.out
for /R "C:\path\to\apks" %F IN (*.apk) do (zipalign -f -v 4 %F "%~dpnF.aligned.apk")
Is there a major difference in doing this via the phone or the procedure listed here.
Seems like it takes way longer to do it but it dropped the total size of all the supposed zipaligned system apps by over 1MB. I guess what I am asking is if there is a difference in performance?
I had been messing about with a script to pull apks off my phone, zipalign them and then push them back, but then I saw wesgarner's CM build with a binary and script for use on your phone. I don't really want to mess round with flashing a ROM just for that though, so I've ripped them out and uploaded them below. Another reason is I want to run this manually (with GScript) rather than on boot (as it does in wesgarner's ROM).
I take no credit for this, the binary and script were both taken from wesgarner's CM buiild.
To "install" this, just adb push the two files in the zip below onto your phone with:
adb shell mount -o remount,rw /system adb push zipalign /system/bin adb push zipalign_apks /system/sd/zipalign_apks.sh adb shell chmod 755 /system/bin/zipalign /system/sd/zipalign_apks.sh adb shell mount -o remount,ro /system
adb shell sh /system/sd/zipalign_apks.sh
su sh /system/sd/zipalign_apks.sh
Zipalign modifies the structure of the .zip file (renamed to .apk, much like .jar). This will stick between reboots. If a newly aligned app is updated, and the dev is using the standard build process with a recent (1.6 or better) SDK, the new .apk will be aligned by default, but the only way to find out is to attempt to realign it. There's no penalty for doing this.
|Thread Tools||Search this Thread|