apk簽名

參考:http://stackoverflow.com/questions/13578134/how-to-automate-keystore-generation-using-the-java-keystore-tool-w-o-user-interhtml

          http://developer.android.com/tools/publishing/app-signing.htmljava

安裝APK時出現:install_parse_failed_no_certificatesandroid

I)Create keystoreapp

keystore=<projectname.keystore> //例如 keystore=helloworld.keystore,亦可不是工程名

keystore_alias_name=${keystore} //設置成同樣

storepass=sxxxxxw //設置密碼

keypass=${storepass} //習慣性設置成同樣的

signaturename="CN=www.cnblogs.com_openix OU=SEU O=SEU L=NanJin ST=JiangSu C=NJ"

keytool
-genkey -v -keystore ${keystore} -alias ${keystore_alias_name} -storepass ${storepass} -keypass ${keypass} -keyalg RSA -validity 20000 -dname "${signaturename}"

 

II)Create signed release APKspa

jarsigner -verbose -keystore ${keystore} -storepass ${storepass} -keypass ${keypass} -sigalg SHA1withRSA -digestalg SHA1  -signedjar bin/apk_name.apk_signed bin/apk_name.apk  ${keystore_alias_name}

zipalign
-v 4 bin/apk_name.apk_signed bin/apk_name.apk_release
rm bin/apk_name.apk_signed
相關文章
相關標籤/搜索