Nitin4Android
Nitin4Android

Reputation: 864

How to find if two apks are signed with same keys?

I want to know how two different apk files are signed with same key in Android.

Upvotes: 5

Views: 1485

Answers (2)

derFunk
derFunk

Reputation: 1630

Unpack both APKs, and run

keytool -printcert -file META-INF/yourfile.RSA

Then, compare the fingerprints, if they are the same, the keys were the same.

Upvotes: 4

zmarties
zmarties

Reputation: 4869

Use PackageManager.getPackageInfo() passing GET_SIGNATURES as the flags for each of the applications.

The PachageInfo.signatures arrays can then be deep compared for equality - that is to say call equals() on each of the corresponding items in the two arrays.

Upvotes: 0

Related Questions