为android创建密钥存储库的步骤是什么?
我需要在我的应用程序中使用谷歌地图,我不知道我错过了什么步骤。 请提供给我具体的详细步骤(我看指南没看懂)
为android创建密钥存储库的步骤是什么?
我需要在我的应用程序中使用谷歌地图,我不知道我错过了什么步骤。 请提供给我具体的详细步骤(我看指南没看懂)
当前回答
首先要知道你是在调试模式还是发布模式。有两种构建模式:调试模式和发布模式。在开发和测试应用程序时使用调试模式。当你想要构建一个可以直接发布给用户或在谷歌Play等应用市场上发布的应用版本时,你可以使用发布模式。”
如果您处于调试模式,请执行以下操作… A.打开终端和类型:
keytool -exportcert -alias androiddebugkey -keystore path_to_debug_or_production_keystore -list -v
注意:对于Eclipse,调试密钥库通常位于~/.android/debug.keystore…
B.当提示输入密码时,只需输入“android”…
C.如果您处于释放模式,请按照…
http://developer.android.com/tools/publishing/app-signing.html <——这个链接几乎解释了你需要知道的一切。
其他回答
基于@EliuX的回答,最新的工具与应用程序包兼容
echo y | keytool -genkey -keystore ./android.jks -dname "n=Mark Jones, ou=JavaSoft, o=Sun, c=US" -alias android -keypass android -storepass android -keyalg RSA -keysize 2048 -validity 2000
为了你的build.gradle
signingConfigs {
debug {
storeFile file('android.jks')
keyAlias 'android'
keyPassword 'android'
storePassword 'android'
}
}
在Android Studio中签名应用
要在Android Studio的发布模式下签署应用,请遵循以下步骤:
1-在菜单栏上,单击“Build > Generate Signed APK”。
2-在Generate Signed APK Wizard窗口中,单击Create new创建一个新的密钥库。 如果您已经有一个密钥存储库,请转到步骤4。
3-在“New Key Store”窗口中,提供如图所示的所需信息 你的密钥应该至少有效25年,所以你可以在应用的生命周期内使用相同的密钥签署应用更新。
4—在“Generate Signed APK Wizard”窗口中,选择密钥库和私钥,并输入两者的密码。然后单击“下一步”。 5-在下一个窗口中,为签名的APK选择一个目的地,然后单击Finish。
参考
http://developer.android.com/tools/publishing/app-signing.html
本教程:
“sign-your-android-applications-for.html”
存档: https://web.archive.org/web/20181002011446/http://techdroid.kbeanie.com/2010/02/sign-your-android-applications-for.html
在我第一次创建密钥存储库时非常有用。这很简单,但developer.android.com上的说明有点太简短了。
我不确定的部分是保存在哪里以及给keystore文件起什么名字。
我认为把它放在哪里并不重要,只要确保它的安全,并保留一些备份。 我只是把它放到我的应用程序目录里
将文件命名为“something”。密钥存储库”,其中的东西可以是您想要的任何东西。我使用了app_name。Keystore,其中app_name是应用程序的名称。
下一个问题是如何命名别名。这似乎无关紧要,所以我再次使用app_name。请保持与以前相同的密码。填写剩下的字段就完成了。
如果你不想或不能使用Android Studio,你可以使用create-android-keystore NPM工具:
$ create-android-keystore quick
这会在当前目录中生成一个新生成的密钥存储库。
更多信息:https://www.npmjs.com/package/create-android-keystore
我疯狂地寻找如何在shell中使用单行命令生成.keystore,以便从另一个应用程序运行它。是这样的:
echo y | keytool -genkeypair -dname "cn=Mark Jones, ou=JavaSoft, o=Sun, c=US" -alias business -keypass kpi135 -keystore /working/android.keystore -storepass ab987c -validity 20000
dname is a unique identifier for the application in the .keystore cn the full name of the person or organization that generates the .keystore ou Organizational Unit that creates the project, its a subdivision of the Organization that creates it. Ex. android.google.com o Organization owner of the whole project. Its a higher scope than ou. Ex.: google.com c The country short code. Ex: For United States is "US" alias Identifier of the app as an single entity inside the .keystore (it can have many) keypass Password for protecting that specific alias. keystore Path where the .keystore file shall be created (the standard extension is actually .ks) storepass Password for protecting the whole .keystore content. validity Amout of days the app will be valid with this .keystore
它对我来说工作得很好,它不要求控制台中的任何其他东西,只是创建文件。有关更多信息,请参阅keytool -密钥和证书管理工具。