Android的签约问题 [英] Android signing problem

查看:303
本文介绍了Android的签约问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过签署一个如下的apk <一个href=\"http://www.anddev.org/advanced-tutorials-f21/signing-your-apk-application-for-release-keytool-jarsigner-t3069.html\"相对=nofollow>这个指南。

i am trying to sign an apk by following this guide.


  1. 我用C创建了一个文件夹keytools:\\用户\\家庭\\工作区\\和键在新创建的keytools文件夹文件夹。所以现在我有C:\\用户\\家庭\\工作区\\ keytools和C:\\用户\\家庭\\工作区\\ keytools \\项的文件夹

  1. I created a keytools folder in C:\Users\Family\workspace\ and a keys folder in the newly created keytools folder. So now i have C:\Users\Family\workspace\keytools and C:\Users\Family\workspace\keytools\keys folders.

我复制了debug.keystore到键文件夹,复制keytool.exe的和jli.dll到keytools文件夹中。

I copied the debug.keystore into the keys folder and copied the keytool.exe and jli.dll into the keytools folder.

我跑了CMD.EXE并导航到C:\\用户\\家庭\\工作区\\ keytools就跑的keytool -genkey -alias anddev.keystore -keyalg RSA -validity 20000 -keystore键/ anddev.keystore

I ran cmd.exe and navigated to C:\Users\Family\workspace\keytools and ran keytool -genkey -alias anddev.keystore -keyalg RSA -validity 20000 -keystore keys/anddev.keystore

该anddev.keystore文件中的键文件夹中创建。

The anddev.keystore file is created in the keys folder.

我复制的apk进行签名到keytools文件夹中。我也复制jarsigner.exe到keytools文件夹中。

I copied the apk to be signed into the keytools folder. I also copied jarsigner.exe into the keytools folder.

在cmd.exe的我在C:\\用户\\家庭\\工作区\\ keytools并尝试运行:的jarsigner -verbose -keystore C:\\用户\\家庭\\工作区\\ keytools \\键\\ anddev.keystore -signedjar sampleapp_signed.apk sampleapp.apk anddev.keystore 。它给了我这个错误:

我也试着运行:

In cmd.exe I am at C:\Users\Family\workspace\keytools and trying to run: jarsigner -verbose -keystore C:\Users\Family\workspace\keytools\keys\anddev.keystore -signedjar sampleapp_signed.apk sampleapp.apk anddev.keystore. It gives me this error: I also tried to run:

的jarsigner -verbose -keystore C:\\用户\\家庭\\工作区\\ keytools \\键\\ anddev.keystore -signedjar sampleapp_signed.apk sampleapp.apk C:\\用户\\家庭\\工作区\\ keytools \\键\\ anddev.keystore

jarsigner -verbose -keystore C:\Users\Family\workspace\keytools\keys\anddev.keystore -signedjar sampleapp_signed.apk sampleapp.apk C:\Users\Family\workspace\keytools\keys\anddev.keystore

我也想跑:

的jarsigner -verbose -keystore C:\\用户\\家庭\\工作区\\ keytools \\键\\ anddev.keystore -signedjar C:\\用户\\家庭\\工作区\\ keytools \\ sampleapp_signed.apk C:\\用户\\家庭\\工作区\\ keytools \\ sampleapp.apk C:\\用户\\家庭\\工作区\\ keytools \\键\\ anddev.keystore

当我浏览到C:\\ Program Files文件\\的Java \\ jdk1.6.0_23 \\ bin并运行code,它要求密钥库的密码,当我写密钥库通(123456),它给了我一个错误

When i navigate to c:\program files\java\jdk1.6.0_23\bin and run that code it asks for the keystore password and when I write the keystore pass (123456), it gives me an error:

的jarsigner:找不到证书链:C:\\用户\\家庭\\工作区\\ keytools \\键\\ anddev.keystore。 C:\\用户\\家庭\\工作区\\ keytools \\键\\ anddev.keystore必须引用包含私钥和相应的密钥证书链有效的密钥存储密钥输入

当我写anddev.keystore通(= asdfgh,keytool将在过程结束时问第二遍)我得到这个错误:
的jarsigner错误:了java.lang.RuntimeException:密钥存储负载:密钥库被篡改,或密码不正确的(不过,我是pretty确定这是合法的错误,导致该通行证是不是这个,但123456)。

When i write anddev.keystore pass (=asdfgh, the second pass that keytool asked for at the end of the process) i get this error: jarsigner error: java.lang.RuntimeException: keystore load: Keystore was tampered with, or password was incorrect. (However, i am pretty sure this is rightful error, cause the pass is not this, but the 123456).

我是pretty肯定,我感到越来越近,并且证书链误差的问题。对?我失去了一步还是什么?

I am pretty sure i am getting closer and that certificate chain error is the problem. Right? Am i missing a step or what?

一另一件事:在命令行中,当密钥工具要求的游标不动任何密码。我写的密码,但我没有看到任何数字或明星,或将光标移动。然后,它要求再输入密码,同样的事情发生。我想这是确定的,和命令行的一个特点,我只是写这是肯定的。

One another thing: in the command line when keytool asked for any password the cursor was not moving. I wrote the password but i didn't see any numbers or stars, or the cursor moving. It then asked for a reenter password, same happened. I guess this is ok, and a feature of the command line, i am just writing this to be sure.

编辑:
基于哈迪斯和Saasha的帮助下,这是非常容易签署的apk。对于任何有兴趣在这里是我的步骤:
为了这个,我创建了一个文件夹MyKeys到C:\\用户\\家庭\\工作区。该过程结束后,sample.keystore和samplesigned.apk似乎文件夹中。

Based on the help of Hades and Saasha, it was extremely easy to sign the apk. For anyone interested here are my steps: For this i created a MyKeys folder into C:\Users\Family\workspace. After the process the sample.keystore and the samplesigned.apk appeared in that folder.

推荐答案

你好

如果你使用Eclipse,你可以试试:

If you using Eclipse you can try:

如果您使用的是Eclipse的ADT插件,您可以使用导出向导来导出一个签名的apk(甚至创建一个新的密钥库,如果需要的话)。导出向导执行所有用keytool和的jarsigner对你来说,它允许您使用GUI,而不是执行程序手动编译,签名和对齐,如上所述签署一揽子的相互作用。一旦向导编制并签署你的软件包,它也将与perfom包的zipalign对齐。由于导出向导同时使用使用Keytool和的jarsigner,你应该确保他们是在您的计算机上访问,如上面签名的基本设置说明。

If you are using Eclipse with the ADT plugin, you can use the Export Wizard to export a signed .apk (and even create a new keystore, if necessary). The Export Wizard performs all the interaction with the Keytool and Jarsigner for you, which allows you to sign the package using a GUI instead of performing the manual procedures to compile, sign, and align, as discussed above. Once the wizard has compiled and signed your package, it will also perfom package alignment with zipalign. Because the Export Wizard uses both Keytool and Jarsigner, you should ensure that they are accessible on your computer, as described above in the Basic Setup for Signing.

要在Eclipse中创建一个签署并对齐.apk文件:

To create a signed and aligned .apk in Eclipse:


  1. 选择在Package Explorer,然后选择文件>导出项目。

  2. 打开Android文件夹,选择Export Android应用程序,然后单击下一步。导出的Andr​​oid应用程序向导从现在开始,这将引导您完成签署您的应用程序,包括选择与签署.apk文件私钥(或创建一个新的密钥库和私钥)步骤的过程。

  3. 完成导出向导和你的申请将被编译,签署,对齐,并准备发行。

这篇关于Android的签约问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆