Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/system/bin/sh
- ## This program is free software; you can redistribute it and/or modify it
- # under the terms of the GNU Library General Public License as published
- # by the Free Software Foundation; either version 2, or (at your option)
- # any later version.
- ## This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- ## License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
- ##
- ## Automatic ZipAlign by Wes Garner
- # ZipAlign files in /data not previously ZipAligned (using md5sum)
- # Thanks to oknowton for the changes
- # Changelog:
- # 1.1 (12/1/09) Switched to zipalign -c 4 to check the apk instead of MD5 (oknowton)
- # 1.0 (11/30/09) Original
- ZA='logwrapper zipalign'
- log -p i -t init:zipalign "INIT.zipalign BEGIN:automatic ZipAlign"
- for apk in /data/app/*.apk ; do
- $ZA -c 4 $apk
- ZIPCHECK=$?
- if [ $ZIPCHECK -eq 1 ]; then
- log -p i -t init:zipalign "INIT.zipalign INFO:ZipAligning $(basename $apk)"
- $ZA -f 4 $apk /cache/$(basename $apk);
- if [ -e /cache/$(basename $apk) ]; then
- logwrapper cp -f -p /cache/$(basename $apk) $apk
- rm /cache/$(basename $apk);
- else
- log -p e -t init:zipalign "INIT.zipalign ERROR:ZipAligning $(basename $apk) failed"
- fi;
- else
- log -p d -t init:zipalign "INIT.zipalign DEBUG:ZipAlign already completed on $apk"
- fi;
- done;
- log -p i -t init:zipalign "INIT.zipalign END:automatic ZipAlign finished"
Advertisement
Add Comment
Please, Sign In to add comment