Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- working=$PWD
- classpath=$working/framework
- bootclasspath=":core.jar:core-junit.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:apache-xml.jar"
- apps=$working/app
- cd $classpath
- for odexFile in `ls -m1 *.odex`
- do
- tempdir=`basename $odexFile .odex`
- jarname=`basename $odexFile .odex`.jar
- mkdir $tempdir
- echo `baksmali -c $bootclasspath -d $classpath -o $tempdir -x $odexFile`
- echo "$odexFile has been baksmalied"
- cd $tempdir
- find ./ -type f -exec sed -i 's/return-void-barrier/return-void/g' {} \;
- echo "$odexFile has been patched"
- echo `smali -o classes.dex $classpath/$tempdir`
- if [ -e classes.dex ]
- then
- echo "$odexFile has been deodexed"
- cd $classpath
- cp $classpath/$tempdir/classes.dex $classpath
- zip $jarname classes.dex
- rm -f classes.dex
- rm -rf $tempdir
- rm -f $odexFile
- fi
- cd $classpath
- done
- echo "Framework done!"
- cd $apps
- for odexFile in `ls -m1 *.odex`
- do
- tempdir=`basename $odexFile .odex`
- jarname=`basename $odexFile .odex`.apk
- mkdir $tempdir
- echo `baksmali -c $bootclasspath -d $classpath -o $tempdir -x $odexFile`
- echo "$odexFile has been baksmalied"
- cd $tempdir
- find ./ -type f -exec sed -i 's/return-void-barrier/return-void/g' {} \;
- echo "$odexFile has been patched"
- echo `smali -o classes.dex $apps/$tempdir`
- if [ -e classes.dex ]
- then
- echo "$odexFile has been deodexed"
- cd $apps
- cp $apps/$tempdir/classes.dex $apps
- zip $jarname classes.dex
- rm -f classes.dex
- rm -rf $tempdir
- rm -f $odexFile
- fi
- cd $apps
- done
- echo "Apps done!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement