密钥库管理器是一个用于创建、配置或加载 Android 密钥库和密钥的窗口。有关更多信息,请参阅 Android 的 Keys, Certificates and Keystores(密钥、证书和密钥库)文档。
要打开密钥库管理器,请打开Android Publishing 窗口并选择 Keystore Manager 按钮。
属性 | 描述 |
---|---|
Keystore 下拉菜单 | 使用 Keystore 下拉菜单创建一个新的密钥库或选择一个现有的密钥库。 选择 Create New 以创建新的密钥库。选择 Anywhere 将密钥库文件保存在您的项目文件夹中,或选择 In Dedicated Location 以创建并将其保存到不同的目录。 选择 Select Existing > Browse 选择您已有的密钥库。 有关更多细节,请参阅选择您的密钥库位置。 |
Password | 输入您的密钥库密码。如果您要创建新的密钥库,请使用此字段创建密码。 |
Confirm Password(仅在创建新密钥库时需要) | 用于确认新密钥库的密码。 |
Existing keys | 当您将现有密钥库加载到项目中时,Keystore Manager 窗口会自动填充 Existing Keys 字段。 |
New Key Values | 如果您创建了新密钥,则需要填写这些字段。如果您已加载现有密钥,则无需填写这些字段。 New Key Values 字段要求的信息与您生成密钥或密钥库时 Android Studio 要求的信息相同。 此信息不会显示在您的应用中,但作为 Android 包 (APK) 的一部分包含在您的证书中。 有关更多信息,请参阅 Android 的 Generate an upload key and keystore(生成上传密钥和密钥库)文档。 Unity 不会验证此信息。如果您将这些字段留空,Unity 将使用空值。这可能会影响您的密钥的有效性。 |
Alias | 为您的密钥输入一个标识名称。 |
Password | 为您的密钥选择并输入密码。 |
Confirm password | 再次输入密钥的密码。 |
Validity(年) | 输入您的密钥有效期(以年为单位)。有效期应该超过您期望管理应用程序的时间,以便您可以使用相同的密钥对应用程序更新进行注册。 默认有效期为 25 年。 |
First and Last Name | 输入您的姓名。 |
Organizational Unit | 输入您的组织单位。组织单位是组织内的不同部门。例如:Android 开发团队。 |
Organization | 输入管理您的应用程序的组织。例如:您的公司名称。 |
City or Locality | 输入您的城市或地区。 |
State or Province | 输入您的州或省。 |
Country Code | 输入您的国家/地区代码。 |
注意:一旦您注册了 Android 应用,将无法更改此密钥库、密钥或证书信息。
使用 Keystore 下拉菜单以创建新的密钥库。
创建新密钥库会自动创建一个新密钥。在密钥库管理器中填写新密钥字段。
创建新密钥库时,您选择的存储位置会更改 Unity 打开文件资源管理器以保存文件的默认位置。在文件资源管理器打开后,您仍然可以更改此设置。
- 选择 Anywhere 打开文件资源管理器。默认情况下,Unity 将您的密钥库存储在您的项目文件夹中。但是,您可以将其存储在机器上的任何位置。如果您将密钥库存储在项目文件夹之外,Unity 会保存一个绝对路径。
- 选择 In Dedicated Location 在自定义默认位置打开文件资源管理器。默认情况下,在 MacOS 上,此路径指向 $HOME/
,在 Windows 上指向 %USER_HOME%\
。
要定义新的项目范围的专用位置,请转到 Unity > Preferences > External Tools > Android > Keystores Dedicated Location,然后单击 Browse 在文本框中选择位置或输入路径。
如果您将密钥库存储到专用位置,Unity 会保存一个相对路径。此相对路径等于其他机器上的专用位置路径。因此,文件夹不需要在两台机器上位于同一位置。
请注意,如果您将新密钥库保存在项目文件夹或共享目录之外,则项目的协作者可能无法访问它。
使用 Keystore 下拉菜单加载现有的密钥库。
如果您的密钥库中有多个密钥,请在 Android Publishing Settings 的 Project Key 字段为您的项目选择一个密钥。
注意:您也可以直接从 Android Publishing Settings 中选择现有的密钥库,而无需使用 Keystore Manager 窗口。
使用以下步骤将多个密钥存储在密钥库中。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.