android / identity-samples

Multiple samples showing the best practices in identity on Android.
Apache License 2.0
323 stars 198 forks source link

app specific hash code generation issue. #3

Open codingjeremy opened 4 years ago

codingjeremy commented 4 years ago

Issue by nikhil-sh Monday Jul 10, 2017 at 08:26 GMT Originally opened as https://github.com/googlesamples/android-credentials/issues/14


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.
codingjeremy commented 4 years ago

Comment by paul-matthews Monday Jul 10, 2017 at 18:46 GMT


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?

codingjeremy commented 4 years ago

Comment by ithinkihaveacat Friday Jul 14, 2017 at 16:12 GMT


@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?

codingjeremy commented 4 years ago

Comment by ithinkihaveacat Wednesday Aug 09, 2017 at 15:51 GMT


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