bigrushdog

deodex script

Jun 8th, 2011
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.83 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. working=/home/bigrushdog/Desktop/system_dump
  4. #classpath=$working"/framework"
  5. classpath=":com.android.location.provider.jar:javax.obex.jar:core.jar:apache-xml.jar:bouncycastle.jar"
  6. apps=$working"/app"
  7. app_done=$working"/app_done"
  8. outdir=temp1
  9.  
  10. cd $apps
  11.  
  12. for odexFile in `ls -m1 *.odex`
  13. do
  14. echo `baksmali -c $classpath -o $outdir  -x $odexFile`
  15. if [ -d $outdir ]
  16. then
  17.     echo "$odexFile has been baksmalied"
  18.     cd $outdir
  19.     find ./ -type f -exec sed -i 's/return-void-barrier/return-void/g' {} \;
  20.     echo "$odexFile has been patched"
  21.     cd $apps
  22.     echo `smali -o classes.dex $outdir`
  23.     if [ -e classes.dex ]
  24.     then
  25.         echo "$odexFile has been deodexed"
  26.         apkname=`basename $odexFile .odex`.apk
  27.         zip -r -q $apkname classes.dex
  28.         cp $apkname $app_done
  29.         rm -rf $outdir
  30.         rm -f $odexFile
  31.         rm -f classes.dex
  32.     fi
  33. fi
  34. done
  35. echo "System Apps done!"
  36.  
  37. ****************************************************************************************
  38.  
  39. #!/bin/sh
  40.  
  41. working=/home/bigrushdog/Desktop/system_dump
  42. #classpath=$working"/framework"
  43. classpath=":com.android.location.provider.jar:javax.obex.jar:core.jar:apache-xml.jar:bouncycastle.jar"
  44. apps=$working"/app"
  45. fw_done=$working"/fw_done"
  46. app_done=$working"/app_done"
  47. fw_working=$working"/fw_working"
  48. outdir=temp1
  49.  
  50. cd $fw_working
  51.  
  52. for odexFile in `ls -m1 *.odex`
  53. do
  54. echo `baksmali -c $classpath -o $outdir  -x $odexFile`
  55. echo "$odexFile has been baksmalied"
  56. cd $outdir
  57. find ./ -type f -exec sed -i 's/return-void-barrier/return-void/g' {} \;
  58. echo "$odexFile has been patched"
  59. cd $fw_working
  60. echo `smali -o classes.dex $outdir`
  61. if [ -e classes.dex ]
  62. then
  63. echo "$odexFile has been deodexed"
  64. jarname=`basename $odexFile .odex`.jar
  65. zip -r -q $jarname classes.dex
  66. mv $jarname $fw_done
  67. rm -rf $outdir
  68. rm -f $odexFile
  69. rm -f classes.dex
  70. rm -f $jarname
  71. fi
  72. done
  73. echo "Framework done!"
Advertisement
Add Comment
Please, Sign In to add comment