java - 如何配置构建文件以获取 Android 应用程序的发布 key 和 keystore 文件的密码

标签 java android google-play-services

我想第一次上传 Android 应用程序,因此我正在阅读 Signing Your Applications指南,但有一件事不太清楚,因此,如果有人可以向我解释以下注释,我将不胜感激:

Note: Including the passwords for your release key and keystore inside the build file is not a good security practice. Alternatively, you can configure the build file to obtain these passwords from environment variables or have the build process prompt you for these passwords.

To obtain these passwords from environment variables:

storePassword System.getenv("KSTOREPWD")
keyPassword System.getenv("KEYPWD")

什么是环境变量?我到底需要对这些变量做什么?或者,如果我在 Android Studio 中签署我的应用程序,我不需要关心它们?

最佳答案

你真的不需要关心环境变量。当您从 Android Studio 构建项目时,系统应该提示您输入 keystore 位置和密码。只需选择正确的文件并输入正确的密码即可。

关于java - 如何配置构建文件以获取 Android 应用程序的发布 key 和 keystore 文件的密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32403942/

相关文章:

java - 从 Fragment 中的 Activity 获取 boolean 值

java - Android 设备的每次移动都会调用 onLocationChanged 函数吗?

java - AIDL服务和Android开源

android - android maps api V2 是否需要启用后台数据?

android - google-play-services lib 未使用 stub 未编译

android - 错误 : In project 'app' a resolved Google Play services library dependency

Java JTextField 无法更新

java - 表格在 Jasper Report Java bean 中不可见

java - 更改 List<String> 的自定义适配器

android - ScrollView 内的滚动文本不起作用