android apk 程式簽名

來源:互聯網
上載者:User

Java開發環境中的Keytool 和 Jarsigner,注意配置好環境路徑,輸入命令後有如下提示資訊:

C:Documents and SettingsF1034740案頭部落格文章>Keytool
keytool 用法:
-certreq     [-v] [-protected]
             [-alias <?e名>] [-sigalg <?章演算法>]
             [-file <?{??章要求?n案>] [-keypass <主密?>]
             [-keystore <金??Υ??gt;] [-storepass <?Υ?烀艽a>]
        [-storetype <?Υ?祛?型>] [-providername <名?>]
        [-providerclass <提供者??e名?> [-providerarg <引??gt;]] ...
        [-providerpath <路?角??gt;]
。。。。。。
C:Documents and SettingsF1034740案頭部落格文章>Jarsigner
Usage: jarsigner [options] jar-file alias
       jarsigner -verify [options] jar-file
[-keystore <url>]           keystore location
[-storepass <password>]     password for keystore integrity
[-storetype <type>]         keystore type
[-keypass <password>]       password for private key (if different)
[-sigfile <file>]           name of .SF/.DSA file
。。。。。。
[簽名檔案的製作]
下面我們來製作一個名稱為carey.keystore(產生並儲存在當前操作目錄下),密碼為password(密碼在輸入的過程中不回顯)的keystore簽名檔案,接下來就會用它來給我們自己的apk簽名
C:Documents and SettingsF1034740案頭部落格文章>keytool -genkey -alias carey.k
ystore -keyalg RSA -validity 20000 -keystore carey.keystore
?入 keystore 密?:<password>
重新?入新密?: <password>
您的名字?姓氏?楹危?br />[Unknown]: carey zhou
您的?制?撾幻?Q?楹危?br />[Unknown]: foxconn
您的??名??楹危?br />[Unknown]: it
您所在的城市或地?^名??楹危?br />[Unknown]: shenzhen
您所在的州及省份名??楹危?br />[Unknown]: guangdong
??撾壞畝???a?楹?br />[Unknown]: cn
CN=carey zhou, OU=foxconn, O=it, L=shenzhen, ST=guangdong, C=cn 正??幔?br />[否]: Y
?入 <carey.keystore> 的主密? 
        (RETURN 如果和 keystore 密?相同):<password>
重新?入新密?: <password>
[簽名過程]
下面我們來給一個未簽名的apk(HomeIP2-unsigned.apk)進行簽名,產生新的apk(HomeIP2-signed.apk)
C:Documents and SettingsF1034740案頭部落格文章>jarsigner -verbose -keystore carey.keystore -signedjar HomeIP2-signed.apk HomeIP2-unsigned.apk carey.keystore
Enter Passphrase for keystore: <password>
   adding: META-INF/MANIFEST.MF
   adding: META-INF/CAREY_KE.SF
   adding: META-INF/CAREY_KE.RSA
signing: res/anim/fade_in.xml
signing: res/anim/fade_out.xml
signing: res/anim/fadeout.xml
signing: res/anim/grid_entry.xml
signing: res/anim/grid_exit.xml
signing: res/anim/hide_applications.xml
signing: res/anim/noneshow.xml
signing: res/anim/show.xml
signing: res/anim/show_applications.xml
signing: res/color/bright_text_dark_focused.xml
signing: res/color/listtextcolor.xml
signing: res/drawable/apparrow.xml
signing: res/drawable/application_background.9.png
signing: res/drawable/button.xml
。。。。。。
[總結]
以上就是製作簽名檔案和給apk簽名的過程,詳細的情況請參考android官方開發文檔 http://developer.android.com/guide/publishing/app-signing.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.