Guest User

Untitled

a guest
Feb 19th, 2016
89
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. if [ ${#} -lt 1 ];
  3. then
  4.     echo "Need a directory!" >&2
  5.     exit 1
  6. fi
  7. INDIR=${1}
  8. TEMP_INDIR=fp2-blobs
  9.  
  10. if [ ! -d ${INDIR} ];
  11. then
  12.     scp -r ${INDIR} ${TEMP_INDIR}
  13.     INDIR=${TEMP_INDIR}
  14. fi
  15.  
  16. echo -n "Restarting adb as root..."
  17. OUTPUT=`adb root 2>&1`
  18. if [ ${?} -ne 0 ];
  19. then
  20.     echo "failed."
  21.     echo "Output:"${OUTPUT}
  22.     exit 1
  23. fi
  24. echo "done."
  25.  
  26. echo -n "Remounting /system as rw ..."
  27. OUTPUT=`adb remount`
  28. if [ ${?} -ne 0 ];
  29. then
  30.     echo "failed."
  31.     echo "Output:"${OUTPUT}
  32.     exit 1
  33. fi
  34. echo "done."
  35.  
  36. FILES=`find ${INDIR} -iname "*.apk"`
  37. for file in ${FILES};
  38. do
  39.     echo adb push ${file} /${file#$INDIR}
  40. done;
  41.  
  42. echo -n "Restarting adb as non-root..."
  43. OUTPUT=`adb unroot 2>&1`
  44. if [ ${?} -ne 0 ];
  45. then
  46.     echo "failed."
  47.     echo "Output:"${OUTPUT}
  48.     exit 1
  49. fi
  50. echo "done."
RAW Paste Data