Advertisement
bigrushdog

Untitled

Apr 24th, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.51 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. working=$PWD
  4. classpath=$working/framework
  5. bootclasspath=":core.jar:core-junit.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:apache-xml.jar"
  6. apps=$working/app
  7.  
  8. cd $classpath
  9.  
  10. for odexFile in `ls -m1 *.odex`
  11. do
  12. tempdir=`basename $odexFile .odex`
  13. jarname=`basename $odexFile .odex`.jar
  14. mkdir $tempdir
  15. echo `baksmali -c $bootclasspath -d $classpath -o $tempdir -x $odexFile`
  16. echo "$odexFile has been baksmalied"
  17. cd $tempdir
  18. find ./ -type f -exec sed -i 's/return-void-barrier/return-void/g' {} \;
  19. echo "$odexFile has been patched"
  20. echo `smali -o classes.dex $classpath/$tempdir`
  21. if [ -e classes.dex ]
  22. then
  23. echo "$odexFile has been deodexed"
  24. cd $classpath
  25. cp $classpath/$tempdir/classes.dex $classpath
  26. zip $jarname classes.dex
  27. rm -f classes.dex
  28. rm -rf $tempdir
  29. rm -f $odexFile
  30. fi
  31. cd $classpath
  32. done
  33. echo "Framework done!"
  34.  
  35. cd $apps
  36.  
  37. for odexFile in `ls -m1 *.odex`
  38. do
  39. tempdir=`basename $odexFile .odex`
  40. jarname=`basename $odexFile .odex`.apk
  41. mkdir $tempdir
  42. echo `baksmali -c $bootclasspath -d $classpath -o $tempdir -x $odexFile`
  43. echo "$odexFile has been baksmalied"
  44. cd $tempdir
  45. find ./ -type f -exec sed -i 's/return-void-barrier/return-void/g' {} \;
  46. echo "$odexFile has been patched"
  47. echo `smali -o classes.dex $apps/$tempdir`
  48. if [ -e classes.dex ]
  49. then
  50. echo "$odexFile has been deodexed"
  51. cd $apps
  52. cp $apps/$tempdir/classes.dex $apps
  53. zip $jarname classes.dex
  54. rm -f classes.dex
  55. rm -rf $tempdir
  56. rm -f $odexFile
  57. fi
  58. cd $apps
  59. done
  60. echo "Apps done!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement