如何获得应用程序的签名?如何获得、应用程序

由网友(怕你远走)分享简介:有什么办法如何从APK检索应用程序签名?我用我的钥匙从密钥库签署,是有办法,如何编程找回?Is there any way how to retrieve app signature from APK? I signed it with my key from keystore and is there way, h...

有什么办法如何从APK检索应用程序签名?我用我的钥匙从密钥库签署,是有办法,如何编程找回?

Is there any way how to retrieve app signature from APK? I signed it with my key from keystore and is there way, how to retrieve it programatically?

推荐答案

您可以访问APK的签名签署这样的使用PackageManager类 http://developer.android.com/reference/android/content/pm/PackageManager.html

You can access the APK's signing signature like this using the PackageManager class http://developer.android.com/reference/android/content/pm/PackageManager.html

Signature[] sigs = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_SIGNATURES).signatures;
for (Signature sig : sigs)
{
    Trace.i("MyApp", "Signature hashcode : " + sig.hashCode());
}

我用这个用散列code为我调试键进行比较,以此来确定APK是否是调试APK或释放APK。

I've used this to compare with the hashcode for my debug key, as a way to identify whether the APK is a debug APK or a release APK.

阅读全文

相关推荐

最新文章