Android Studio只给我SHA1,我需要SHA256 [英] Android Studio only gives me SHA1, I need SHA256
问题描述
我想使用assetlinks.json
进行appindexing.
我应该使用SHA256 fingerprint
,但是当我在Android Studio中打印出signingReport
时,我只有SHA1.
I want to use assetlinks.json
for appindexing.
I am supposed to use a SHA256 fingerprint
, but when I print out the signingReport
in Android Studio, I only have SHA1.
我可以使用SHA1
吗?如果没有,如何获得SHA256签名的应用程序?
Can I use SHA1
? If not, how can I get a SHA256 signed app?
使用Manish Jain的答案,我设法只列出了调试键,这比我自己能做的更多.
Using Manish Jain's answer, I have managed to list only the debug keys, which is more than I could do by myself.
如果我将实际的密钥库路径和jks文件放在路径中:
If I put my actual keystore path and jks file in the path:
keytool -list -v -keystore "C:\Users\myself\Keystores\android.jks" -alias mykey -storepass 1password -keypass 2password
出现另一组键,我认为这是释放键集.
A different set of keys come up, which I assume would be the release key set.
大问题是为什么当我从Gradle中打印出signingReport
时,Android Studio只列出调试键的原因,为什么它会显示Variant: releaseUnitTest, Config: none
?有什么主意吗?
The BIG QUESTION is why Android Studio only lists the debug keys when I print out the signingReport
from Gradle and why it says Variant: releaseUnitTest, Config: none
? Any idea?
顺便说一句,这个问题与建议的重复项无关.
By the way, this question has nothing to do with the suggested duplicate.
回答jyomin的一个问题2. 我希望它也能帮助其他人.
Replying to a question from jyomin 2. I hope it helps others too.
- 转到:
C:\Program Files\Java\jdk1.7.0_25\bin
(或您的jdk文件所在的位置). - 在Win资源管理器的地址栏中键入
cmd
. - 添加:
keytool -list -v -keystore "C:\Users\yourUserName\Keystores\android.jks" -alias yourAppName -storepass yourPasswordToKeystore -keypass yourPasswordToRequiredAppKey
- Go to:
C:\Program Files\Java\jdk1.7.0_25\bin
(or wherever your jdk file is). - Type
cmd
in address bar in win explorer. - Add:
keytool -list -v -keystore "C:\Users\yourUserName\Keystores\android.jks" -alias yourAppName -storepass yourPasswordToKeystore -keypass yourPasswordToRequiredAppKey
要小心!
如果密钥库中有多个密钥,则可能无法为您提供与给定应用程序正确匹配的密钥!
If you have multiple keys in the keystore, it might not give you the correct matching one to the given app!!!
在开发人员控制台或Firebase上,都可以在某处找到相关的SHA256密钥.我现在找不到了,但是如果您继续寻找,它就在某个地方.
Either on the Developer Console or Firebase, you can find the related SHA256 key somewhere. I couldn't find it now, but if you keep looking, it is there somewhere.
我刚刚在Google Play开发者控制台上找到了它:
I just found it on the Google Play Developer Console:
- 上传应用程序的第一个版本(如果尚未完成的话)
- 在发布管理中转到应用发布
- 点击管理Beta"
- 在APK版本上,点击右侧的"i"信息按钮
它将向您显示SHA键
祝你好运!
推荐答案
您可以通过使用命令提示符(Windows)使用keytool
来获取SHA256
.
You can get SHA256
by using keytool
using command prompt (windows).
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
这篇关于Android Studio只给我SHA1,我需要SHA256的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!