Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ ${#} -lt 1 ];
- then
- echo "Need a directory!" >&2
- exit 1
- fi
- INDIR=${1}
- TEMP_INDIR=fp2-blobs
- if [ ! -d ${INDIR} ];
- then
- scp -r ${INDIR} ${TEMP_INDIR}
- INDIR=${TEMP_INDIR}
- fi
- echo -n "Restarting adb as root..."
- OUTPUT=`adb root 2>&1`
- if [ ${?} -ne 0 ];
- then
- echo "failed."
- echo "Output:"${OUTPUT}
- exit 1
- fi
- echo "done."
- echo -n "Remounting /system as rw ..."
- OUTPUT=`adb remount`
- if [ ${?} -ne 0 ];
- then
- echo "failed."
- echo "Output:"${OUTPUT}
- exit 1
- fi
- echo "done."
- FILES=`find ${INDIR} -iname "*.apk"`
- for file in ${FILES};
- do
- echo adb push ${file} /${file#$INDIR}
- done;
- echo -n "Restarting adb as non-root..."
- OUTPUT=`adb unroot 2>&1`
- if [ ${?} -ne 0 ];
- then
- echo "failed."
- echo "Output:"${OUTPUT}
- exit 1
- fi
- echo "done."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement