Tuesday, 15 May 2012

Getting two different hash key, While debugging the android program -


I am using this code to get keyships.

  PackageInfo info = getPackageManager () GetPackageInfo (getPackageName (), PackageManager.GET_SIGNATURES); (Signature sign: info.signatures) {MessageDigest md = MessageDigest.getInstance ("SHA1"); Md.update (signature.toByteArray ()); Log D. ("Keyhash", base 64.extodostring (MD.degist (), base64.default)); }  

When I debug this code, select "Base64.encodeToString (md.digest (), Base64.DEFAULT)" and press Shift + ctrl + I, it returns the keyhash Again press Shift + ctrl + I, it returns the different keyships.

  Log D ("keyhash", base64.extodestring (md.digest (), base 64.default));  

Please tell me, what's the problem?

You have the place to replace your method -

 < Code> MessageDigest md = MessageDigest.getInstance ("SHA1"); Instead of  

-

  Message digest md = MessageDigest.getInstance ("SHA");  

This will help you.


No comments:

Post a Comment