如何签约的Andr​​oid APK [英] How to signing Android APK

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

问题描述

我已创建与使用NetBeans平台科尔多瓦的Andr​​oid应用程序。结果
该应用程序在Android模拟器运行。结果

I have create an Android application with Cordova platform using Netbeans.
The application runs on Android emulator.

要构建这个应用程序,我想补充的<应用机器人:可调试=假[...] /> 在AndroidManifest.xml中。我上传到谷歌玩,我发现没有像上传APK在调试模式下签署,您所需要的。在释放模式签署APK。结果

To build this application, I add <application android:debuggable="false" [...] /> in AndroidManifest.xml. I uploaded into google play and I found failed message like "Upload APK signed in debug mode. You need to signing the APK in release mode."

和我在谷歌播放面板发现这个RSA公钥太;

And I found this RSA public key too in my google play panel;

YOUR LICENSE KEY FOR THIS APPLICATION Base64-encoded RSA public key to include in your binary. Please remove any spaces.
MIIBIjANBgasdfasdfdaskqhkiG9w0BAQEadfadfasdFAAOCAQ8AMIIBCgKCAQEAuacIf........

请你告诉我如何使用RSA密钥?并请告诉我(没有使用Eclipse),因为我是新Android开发的简单方法。如果你这样做不是我的,请告诉我一步一步来签署,因为我已经尝试解决这个问题一天:(

Would you please tell me how to use the RSA key? And please, tell me the easy way (not using eclipse) because I am new to Android development. If you don't mine, please tell me step by step to signing it because I have try to solve this problem for a day :(

推荐答案

我不知道怎么的NetBeans安装科尔多瓦,但你应该有访问CLI(命令行界面)。

I'm not sure how netbeans installs cordova, but you should have access to the cli (command line interface).

通过这里的CLI是怎么签的应用程序:

With the cli here is how to sign the app :

首先修改AndroidManifest.xml中到Android设置:可调试的假像你这样,改变的android:版本code,如果你已经发布了一个版本的应用程序

First modify AndroidManifest.xml to set android:debuggable to false like you did and also change android:versionCode if you already released a version of your app.

然后运行科尔多瓦构建Android --release 来生成应用的一个无符号的发行版。这将创建一个文件名为yourappname释放-unsigned.apk在您的项目(之前科尔多瓦3.4 ... ... /箱)的平台/安卓/ ANT-build文件夹中。

then run cordova build android --release to generate an unsigned release version of the app. It will create a file named yourappname-release-unsigned.apk in the platforms/android/ant-build folder of your project (..../bin before cordova 3.4).

现在注册您的应用程序,你需要已经创建密钥库:

Now sign your app, you need to have already created a keystore :

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore yourkeystore.keystore yourappname-release-unsigned.apk youraliasforthekeystore

最后,你对齐应用:

And finally, you align the app :

zipalign -v 4 yourappname-release-unsigned.apk yourappname-release-signed.apk

现在,你应该能够提交yourappname释放-signed.apk到谷歌播放

Now you should be able to submit yourappname-release-signed.apk to google play

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

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