dev

相關連結


簽署 Release Key

使用以下 2 個指令即可達成

$ keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore
my_application.apk alias_name
  1. 用 keytool 產生 keystore - Obtain a suitable private key
  2. 用 keystore 產生 key hash - Sign your application with your private key
  3. Compile the application in release mode。在 IntelliJ 上有 Generate unsigned APK,所以其實我只有用第一個指令產生過 keystore, 後續都偷懶直接用 IntelliJ 幫我完成簽署的工作。

Note: If you see "CN=Android Debug", this means the APK was signed with the debug key generated by the Android SDK. If you intend to release your application, you must sign it with your private key instead of the debug key.
如果您有在串接 Facebook Android SDK 時,使用 Android SDK 預裝的 debug.keystore 的話,記得在簽署 release 版本時,不能使用這個 debug.keystore,一定要自己創一個 keystore!


類似的教學,可參考 android 簽署 release key

  1. 封裝你的應用程式為APK檔
    專案名稱上按右鍵→Android Tools→Export Unsigned Application Package

  2. 使用JDK的key tool產生key
    keytool -genkey -alias developer.keystore -keyalg RSA -validity 20000 -keystore developer.keystore
    依畫面提示輸入資訊
    如果要做release key 的話請 keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

  3. 簽署
    jarsigner -verbose -keystore developer.keystore -signedjar newgenerated.apk target.apk developer.keystore
    上面指令中newgenerated.apk為新產生的簽署好的apk
    上面指令中target.apk為你要進行簽署的apk
    release 版的話, jarsigner -verbose -keystore my-release-key.keystore FileManager2.apk alias_name

Comments

comments powered by Disqus
Copyright © 2013 Andro Chen
Powered by Logdown and Greyshade
Favicon from The Noun Project