how to access android app's certificate from inside the app?
- by Yan
Hi All,
Im trying to access the certificate/signature from inside an android app, so that I can do something with the certificate.
I googled a bit and found the code below:
Class c = getClass();
ProtectionDomain pd = c.getProtectionDomain();
CodeSource cs = pd.getCodeSource();
Certificate[] signingCertificates = cs.getCertificates();
String st = signingCertificates[0].toString();
but c.getProtectionDomain() returns null.
anyone can help? many thanks.