Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Posted by Droidzone
- #
- # system/app odex-er by Paul O'Brien @ www.MoDaCo.com
- # Create Odex file from deodexed apks
- #
- #
- # experimental - nandroid backup before you run this script!
- #
- #
- #
- # version 0.1, 29th January 2010
- #
- #
- # set permissions
- #
- chmod 4755 /data/odex/dexopt-wrapper
- #
- chmod 4755 /data/odex/zip
- #
- chmod 4755 /data/odex/zipalign
- #
- #
- # mount system as rw
- #
- mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
- #
- #
- # change to system/app and process each apk!
- #
- cd /system/app
- #
- #
- for filename in `find . -name '*.apk'`
- #
- do
- #
- #
- # step 1 - odex the apk
- #
- /data/odex/dexopt-wrapper $filename `echo $filename | sed 's/\(.*\.\)apk/\1odex/'`
- #
- #
- # step 2 - did we succesfully odex?
- #
- if [ -f `echo $filename | sed 's/\(.*\.\)apk/\1odex/'` ]
- #
- then
- #
- # step 3 - remove the classes.dex from the apk
- #
- /data/odex/zip -d $filename classes.dex
- #
- #
- # step 4 - zipalign, just in case
- #
- /data/odex/zipalign -f -v 4 $filename $filename.new
- #
- mv $filename.new $filename
- #
- fi
- #
- #
- done;
- #
- #
- # clear dalvik cache
- #
- rm -r /data/dalvik-cache/*
- #
- #
- # reboot
- #
- reboot
Advertisement
Add Comment
Please, Sign In to add comment