Guest User

Untitled

a guest
Feb 19th, 2016
78
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. BASEDIR=`dirname ${0}`
  3. # old - begin
  4. VENDORDIR=vendor/qcom/proprietary/target/product/FP2/
  5. APKS=`find ${BASEDIR}/${VENDORDIR} -iname "*.apk"`
  6. # old - end
  7. FILELIST=resign-files.txt
  8. OUTDIR=${HOME}/Downloads/fp2/
  9. CWD=`pwd`
  10.  
  11. if [ ! -d ${OUTDIR} ];
  12. then
  13.     mkdir -p ${OUTDIR}
  14. fi
  15.  
  16. cd ${BASEDIR}
  17. #for apk in ${APKS}
  18. while read file
  19. do
  20.     FILENAME_REL=${file#$BASEDIR/$VENDORDIR}
  21.     DIR_REL=`dirname ${FILENAME_REL}`
  22.     echo -n "Processing \"${FILENAME_REL}\"..."
  23.     if [ ! -d ${OUTDIR}/${DIR_REL} ];
  24.     then
  25.         mkdir -p ${OUTDIR}/${DIR_REL}
  26.     fi
  27.     java -jar ${BASEDIR}/out/host/linux-x86/framework/signapk.jar ${BASEDIR}/build/target/product/security/platform.x509.pem ${BASEDIR}/build/target/product/security/platform.pk8 ${VENDORDIR}/${file} ${OUTDIR}/${FILENAME_REL}
  28.     if [ ${?} -ne 0 ];
  29.     then
  30.         echo "Error while processing ${FILENAME_REL}."
  31.         exit 1
  32.     fi
  33.     echo "done."
  34. #   ${BASEDIR}/signapk.sh ${apk} ${BASEDIR}/tools/build/tests/basic/debug.keystore
  35. #   mv ${BASEDIR}/signed_${FILENAME} ${apk}
  36. done < ${BASEDIR}/${FILELIST}
  37. cd ${CWD}
RAW Paste Data