Re: [android-developers] Program to generate MD5 hash for apk
On Wed, Jul 13, 2011 at 9:49 PM, rashmi <rashmi.ttr@gmail.com> wrote:
> Hi,
> Please let me know how to create a MD5 hash for an apk
> programmatically. I want to compare the MD5 hash in the certificate
> and the generated MD5 hash. There are some commands which can be
> executed from command prompt to generate MD5 hash for an apk. But how
> do I will generate it through program. Any example will be helpful.
>
The hash of the apk and the hash of the certificate used to sign it
are two different things. To calculate the hash of the certificate, you
get the certificate as a byte array, then use the MessageDigest class
to calculate the hash. There is at least one thread about this, search
the archives. To calculate the hash of the APK, you need to find the
apk file and feed it to MessageDigest.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home