짱구삼촌
13.04.12
조회 수 3015
추천 수 9
댓글 14
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
Extra Form
첨부
zipalign  [File Size:21.7KB/Download:80]
zipalign.sh  [File Size:2.0KB/Download:82]
댓글을 남겨야 다운로드가 가능합니다. 감사의 댓글을 달고 오른쪽 확인버튼을 눌러주세요.
다운로드시 일주일에 한개 이상의 게시물 작성이 필요합니다. 지금 자유게시판에 회원님의 하루를 남겨보세요.
추천♡버튼을 잊지 마세요. 추천인과 회원님 모두 포인트가 적립됩니다.

짱구삼촌 님의 SIGNATURE

profile

그래도 아직은 사랑이, 낡은 외투처럼 너덜너덜해져서 이제는 갖다 버려야 할, 그러나 버리지 못하고...

"신은 그저 질문하는 자일 뿐... 운명은 내가 던지는 질문이다. 답은 그대들이 찾아라."

댓글 14
댓글 쓰기 권한이 없습니다.
정렬 목록 검색 쓰기
등록된 글이 없습니다.
1 - 2