private final PackageManager packageManager = context.getPackageManager();
private final List<PackageInfo> packageList = packageManager.getInstalledPackages(PackageManager.GET_SIGNATURES);
for (PackageInfo p : packageList) {
for (final Signature sig : p.signatures) {
X509Certificate x509Cert;
try {
x509Cert = (X509Certificate) CertificateFactory.getInstance("X509")
.generateCertificate(new ByteArrayInputStream(sig.toByteArray()));
Log.i("msg","Public Key:"+ x509Cert.getPublicKey().toString());
}
catch (CertificateException e) {
e.printStackTrace();
}
}
}
如果此篇對您有幫助,您可以點選廣告給予最大的動力,感謝您的收看。
如果此篇對您有幫助,您可以點選廣告給予最大的動力,感謝您的收看。
沒有留言:
張貼留言