自我检查的APK的签名 [英] Self-checking an APK's signature

查看:141
本文介绍了自我检查的APK的签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在运行时编程方式执行对APK的签名支票。我拥有我的开发工作站上的密钥库,这样我就可以知道(不知道如何)的公共密钥我签署APK用。

I would like to programmatically perform a check on the APK's signature at runtime. I own a keystore on my development workstation, so I could know (dunno how) the public key I'm signing an APK with.

在我所知道的公钥将标牌什么后,我想将源$ C ​​$ c和检查,如果当前正在运行的应用程序中的密钥相匹配。

Once I know what the public key will be after signage, I would like to put in the source code and check if the currently running application matches the key.

这可能吗?如果是这样,我怎么取得一个Eclipse生成的密钥库中的公钥?

Is it possible? If so, how do I obtain the public key from an Eclipse-generated keystore?

感谢。

推荐答案

您可以试试这个,它应该工作

You could try this, it should work

Signature[] sigs = getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_SIGNATURES).signatures;
    for (Signature sig : sigs)
    {
        // log the sig here
    }

这篇关于自我检查的APK的签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆