use Android dexopt optimize all apks

the full script would be:

 

 

mount -o remount,rw /system for i in /system/app/*.apk do odex=`echo $i | sed -e 's/.apk/.odex/g'` i_time=`stat -t $i | cut -d' ' -f14` o_time=0 if [ -f $odex ] ; then o_time=`stat -t $odex | cut -d' ' -f14` fi if [ $i_time -gt $o_time ] ; then if [ -f $odex ] ; then rm $odex fi echo "dexopt-wrapper $i $odex" dexopt-wrapper $i $odex fi done for i in /system/app/*.odex do apk=`echo $i | sed -e 's/.odex/.apk/g'` if [ ! -f $apk ] ; then rm $i fi done echo "----------- System Apps DONE -----------" for i in /data/app/*.apk do odex=`echo $i | sed -e 's/.apk/.odex/g'` i_time=`stat -t $i | cut -d' ' -f14` o_time=0 if [ -f $odex ] ; then o_time=`stat -t $odex | cut -d' ' -f14` fi if [ $i_time -gt $o_time ] ; then rm $odex echo "dexopt-wrapper $i $odex" dexopt-wrapper $i $odex fi done for i in /data/app/*.odex do apk=`echo $i | sed -e 's/.odex/.apk/g'` if [ ! -f $apk ] ; then rm $i fi done echo "----------- Market Apps DONE -----------"

 

It creates new odex files for any apks that don't have an odex or have an older odex and it removes odex files for any removed apk, first it does this for system files then it does this for data files (market apps).

 

你可能感兴趣的:(use Android dexopt optimize all apks)