[英]How do I generate a .jpk signature file for keystore signing for Android Studio in Windows Command Line?
我正在嘗試在 Android Studio 中生成密鑰庫路徑,如何找到 java.io 文件? 我閱讀並實施了一個解決方案: 如何創建密鑰庫? 在 Windows 命令行中。 然后我在執行解決方案后收到一個錯誤。 我以管理員身份運行操作系統。
我了解到 java.io 是通用的。 我在我的電腦上搜索了 java.io 文件,但沒有找到。 我了解到,通過切換到 Linux 操作系統,可以避免許多這些問題。
預期的結果是一個.jpk 密鑰庫簽名文件。 實際結果是 java.io.FileNotFoundException: my-release-key.keystore (Access is denied) 錯誤。
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>
要從命令行生成密鑰庫文件,您必須以管理員身份運行命令行。 這是通過在搜索欄中鍵入 cmd 來實現的,然后右鍵單擊命令提示符應用程序,然后選擇以管理員身份運行。 https://www.howtogeek.com/howto/windows-vista/enable-the-hidden-administrator-account-on-windows-vista/按照如何創建密鑰庫?
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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.