zipalign 화일은 본인의 비지박스 폴더에 755 퍼미션을 주고 투척.
zipalign.sh 는 시스템폴더 등에 777퍼미션으로 투척.
루익으로 비지박스 스크립트 실행.
#!/system/bin/sh
: '
Zipaligns all unaligned apks
============ Copyright (C) 2010 Jared Rummler (JRummy16) ============
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, 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.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
=====================================================================
'
if busybox [ -z "$( busybox which zipalign )" ]; then
echo "Error: zipalign binary missing."
exit 1
fi
START=` busybox date +%s `
CODEPATHS=` pm list packages -f | busybox cut -d ':' -f2 | busybox cut -d '=' -f1 `
TOTAL=` echo $CODEPATHS | busybox wc -w `
CURRENT=0
echo
echo "Zipaligning..."
echo
busybox mount -o remount,rw /system
for codepath in ${CODEPATHS}; do
CURRENT=$(($CURRENT+1))
echo -n "(${CURRENT} of ${TOTAL}) "
if busybox [ -e $codepath ]; then
zipalign -c 4 $codepath
ZIP_CHECK=$?
case $ZIP_CHECK in
1)
if zipalign -f 4 $codepath /data/local/pkg.apk; then
busybox cp -f /data/local/pkg.apk $codepath
busybox rm -f /data/local/pkg.apk
echo "[!] zipaligned ${codepath}"
fi
;;
*)
echo "[X] $codepath was already zipaligned"
;;
esac
fi
done
busybox mount -o remount,ro /system
sync
STOP=` busybox date +%s `
RUNTIME=` busybox expr $STOP - $START`
HOURS=` busybox expr $RUNTIME / 3600`
REMAINDER=` busybox expr $RUNTIME % 3600`
MINS=` busybox expr $REMAINDER / 60`
SECS=` busybox expr $REMAINDER % 60`
RUNTIME=` busybox printf "%02d:%02d:%02dn" "$HOURS" "$MINS" "$SECS" `
echo
echo "Zipalign complete! Runtime: ${RUNTIME}"
echo
zipalign.sh 는 시스템폴더 등에 777퍼미션으로 투척.
루익으로 비지박스 스크립트 실행.
#!/system/bin/sh
: '
Zipaligns all unaligned apks
============ Copyright (C) 2010 Jared Rummler (JRummy16) ============
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, 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.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
=====================================================================
'
if busybox [ -z "$( busybox which zipalign )" ]; then
echo "Error: zipalign binary missing."
exit 1
fi
START=` busybox date +%s `
CODEPATHS=` pm list packages -f | busybox cut -d ':' -f2 | busybox cut -d '=' -f1 `
TOTAL=` echo $CODEPATHS | busybox wc -w `
CURRENT=0
echo
echo "Zipaligning..."
echo
busybox mount -o remount,rw /system
for codepath in ${CODEPATHS}; do
CURRENT=$(($CURRENT+1))
echo -n "(${CURRENT} of ${TOTAL}) "
if busybox [ -e $codepath ]; then
zipalign -c 4 $codepath
ZIP_CHECK=$?
case $ZIP_CHECK in
1)
if zipalign -f 4 $codepath /data/local/pkg.apk; then
busybox cp -f /data/local/pkg.apk $codepath
busybox rm -f /data/local/pkg.apk
echo "[!] zipaligned ${codepath}"
fi
;;
*)
echo "[X] $codepath was already zipaligned"
;;
esac
fi
done
busybox mount -o remount,ro /system
sync
STOP=` busybox date +%s `
RUNTIME=` busybox expr $STOP - $START`
HOURS=` busybox expr $RUNTIME / 3600`
REMAINDER=` busybox expr $RUNTIME % 3600`
MINS=` busybox expr $REMAINDER / 60`
SECS=` busybox expr $REMAINDER % 60`
RUNTIME=` busybox printf "%02d:%02d:%02dn" "$HOURS" "$MINS" "$SECS" `
echo
echo "Zipalign complete! Runtime: ${RUNTIME}"
echo