gpt4 book ai didi

java - 如何在 Windows 命令行中为 Android Studio 生成 keystore 签名的 .jpk 签名文件?

转载 作者:太空宇宙 更新时间:2023-11-04 09:17:35 28 4
gpt4 key购买 nike

我正在尝试在 Android Studio 中生成 keystore 路径,如何找到 java.io 文件?我阅读并实现了一个解决方案:How can I create a keystore?在 Windows 命令行中。然后,我在执行解决方案后收到错误。我以管理员身份运行操作系统。

我了解到 java.io 是通用的。我在我的电脑上搜索了 java.io 文件,但没有找到。我了解到,通过切换到 Linux 操作系统可以避免其中许多问题。

预期结果是 .jpk keystore 签名文件。实际结果是 java.io.FileNotFoundException: my-release-key.keystore (Access is returned) 错误。

Microsoft Windows [Version 10.0.18362.418]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\ronal>cd/Program Files/Java/jdk-13.0.1/bin

C:\Program Files\Java\jdk-13.0.1\bin>keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]: Ronald Sheaks
What is the name of your organizational unit?
[Unknown]: Imperative GIS Consulting
What is the name of your organization?
[Unknown]: Imperative GIS Consulting
What is the name of your City or Locality?
[Unknown]: Kirtland
What is the name of your State or Province?
[Unknown]: Ohio
What is the two-letter country code for this unit?
[Unknown]: US
Is CN=Ronald Sheaks, OU=Imperative GIS Consulting, O=Imperative GIS Consulting, L=Kirtland, ST=Ohio, C=US correct?
[no]: Yes

Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 10,000 days
for: CN=Ronald Sheaks, OU=Imperative GIS Consulting, O=Imperative GIS Consulting, L=Kirtland, ST=Ohio, C=US
[Storing my-release-key.keystore]
keytool error: java.io.FileNotFoundException: my-release-key.keystore (Access is denied)
java.io.FileNotFoundException: my-release-key.keystore (Access is denied)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:292)
at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:235)
at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:124)
at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:1346)
at java.base/sun.security.tools.keytool.Main.run(Main.java:416)
at java.base/sun.security.tools.keytool.Main.main(Main.java:409)

C:\Program Files\Java\jdk-13.0.1\bin>

最佳答案

要从命令行生成 keystore 文件,您必须以管理员身份运行命令行。这是通过在搜索栏中键入 cmd,然后右键单击命令提示符应用程序,然后选择以管理员身份运行来实现的。 https://www.howtogeek.com/howto/windows-vista/enable-the-hidden-administrator-account-on-windows-vista/按照 How can I create a keystore? 中概述的说明进行操作

Microsoft Windows [Version 10.0.18362.418]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
'keytool' is not recognized as an internal or external command,
operable program or batch file.

C:\WINDOWS\system32>
C:\WINDOWS\system32>cd/Program Files/Java/jdk-13.0.1/bin

C:\Program Files\Java\jdk-13.0.1\bin>keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]: Ronald Sheaks
What is the name of your organizational unit?
[Unknown]: Imperative GIS Consulting
What is the name of your organization?
[Unknown]: Imperative GIS Consulting
What is the name of your City or Locality?
[Unknown]: Kirtland
What is the name of your State or Province?
[Unknown]: Ohio
What is the two-letter country code for this unit?
[Unknown]: US
Is CN=Ronald Sheaks, OU=Imperative GIS Consulting, O=Imperative GIS Consulting, L=Kirtland, ST=Ohio, C=US correct?
[no]: Yes

Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 10,000 days
for: CN=Ronald Sheaks, OU=Imperative GIS Consulting, O=Imperative GIS Consulting, L=Kirtland, ST=Ohio, C=US
[Storing my-release-key.keystore]

C:\Program Files\Java\jdk-13.0.1\bin>

关于java - 如何在 Windows 命令行中为 Android Studio 生成 keystore 签名的 .jpk 签名文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58781484/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com