Http://www.cnblogs.com/findyou/p/3801273.html
Echo RePack $1.apk
# re-sign product to ensure that it uses a signature that matches the signature of the test case
# The first step is to delete the signature already in the product
Unzip-o $1.apk-d Product
CD product
# Remove an existing signature from the app
Rm-r-F meta-inf/
# repackage files in your app
Zip-r product.apk *
MV product.apk.
Cd..
# Delete the original folder to delete the key--wrap up work
Rm-f-R Product
# re-signing with a signature using debugging
#jarsigner-keystore ~/.android/debug.keystore-storepass android-keypass android product.apk Androiddebugkey
#jdk 1.7 Jarsigner need to add two parameters-digestalg Sha1-sigalg Md5withrsa
Jarsigner-keystore ~/.android/debug.keystore-storepass android-keypass android product.apk Androiddebugkey- Digestalg Sha1-sigalg Md5withrsa
Zipalign 4 product.apk $1-resigned.apk
Android Anti-compilation (iii) re-signing