Android Studio only gives me SHA1, I need SHA256

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-09 05:57:53

问题


I want to use assetlinks.json for appindexing. I am supposed to use an SHA256 fingerprint, but when I print out the signingReport in Android Studio, I only have SHA1. Can I use SHA1, if not, how can I get an SHA256 signed app?

Using Manish Jain's answer I have managed to list only the debug keys, which is more than I could do by myself, but 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.

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.

EDIT: Replying to a question from jyomin 2. I hope it helps others too.

***** For Release: 1, go to: C:\Program Files\Java\jdk1.7.0_25\bin (or wherever your jdk file is) 2, type "cmd" in address bar in win explorer 3, add: keytool -list -v -keystore "C:\Users\yourUserName\Keystores\android.jks" -alias yourAppName -storepass yourPasswordToKeystore -keypass yourPasswordToRequiredAppKey

Be careful!!! If you have multiple keys in the keystore, it might not give you the correct matching one to the given app!!!

Another way of getting the SHA256 for your app: 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.

I just found it on Google Play Developer Console:

  • Upload the first version of your app (if you haven't done it yet)
  • Go to App Releases in Release Management
  • Click Manage Beta
  • At the APK version click the "i" info button on the right

It will show you the SHA keys

Good luck!


回答1:


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




回答2:


You can get it from the Google Play Console (https://play.google.com) go to Release Management -> App Signing -> App signing certificate



来源:https://stackoverflow.com/questions/42290681/android-studio-only-gives-me-sha1-i-need-sha256

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!