googlearchive/android-credentials

app specific hash code generation issue.

Closed this issue · 4 comments

I have used various methods mentioned to generated hash code. I have tried them all. Problem is each method generated different hash.

I have tried them on both the debug.keystore and release keystore.jks

here is stackoverflow question for the same

I have tried following method:
Here are those various methods:

  1. linux command as describe here - help doc
  2. sms_retriever_hash_v9 file present in the sample code
  3. By including AppSignatureHelper from sample app.

Are there multiple signatures returned by AppSignatureHelper.getAppSignatures() or is it just one?

Are the differences between each of the methods or generating different hashes for the same method?

@nikhil-sh Uh yes, thanks for the report--there seem to be a few issues here. The three methods definitely should be generating the same hash.

Re the Linux command, can you check that the keytool component of the command is generating meaningful output? i.e. keytool -alias MyAndroidKey -exportcert -keystore MyProduction.keystore. Unfortunately the command emits errors to stdout, not stderr, so you might in fact be generating the hash of an error message like keytool error: java.lang.Exception: Alias <jjandroiddebugkey> does not exist instead of the actual cert...

The sms_retriever_hash_v9 potentially has a similar issue, plus it seems to fail on Linux. I created a new version. Can you test that to see if it works, and if it produces the same results as the Linux commands?

Hey @nikhil-sh, have you been able to test the new version?

I am closing this issue/PR, as it has been migrated to the new repo linked above in the comments. Thank you!