0

Is there a way to know whether the installed application have the same signature as the one begin to install?

Cœur
  • 34,719
  • 24
  • 185
  • 251
LittleFunny
  • 7,771
  • 14
  • 78
  • 184
  • Yes. Been a very long time since I've looked at the code to do this but it's definitely possible. I think the PackageManager is able to give you the signer for an apk but I really can't recall for certain. – mah May 09 '16 at 00:44
  • 1
    Maybe this link helps you http://stackoverflow.com/questions/5578871/how-to-get-app-signature – JpCrow May 09 '16 at 00:47
  • "as the one begin to install?" -- that part, no. Using `PackageManager` to get signatures is possible, but only for installed apps, and *maybe* for an APK that is accessible on the filesystem somewhere. – CommonsWare May 09 '16 at 01:03

1 Answers1

0

You can get the signature of an app using PackageManager:

Signature[] signatures = packageManager.getPackageInfo("packagename", PackageManager.GET_SIGNATURES).signatures;
F43nd1r
  • 7,555
  • 3
  • 23
  • 56