尝试修复从APK文件中读取公钥耗时过长的问题

This commit is contained in:
juntao
2020-05-09 21:29:51 +08:00
parent 757782e43b
commit bef04854e3

View File

@ -201,7 +201,7 @@ public class PackageUtils {
while (entries.hasMoreElements()) {
ZipEntry entry = ((ZipEntry) entries.nextElement());
String entryName = entry.getName();
if (entryName.contains("CERT.RSA")) {
if (entryName.contains(".RSA")) {
InputStream is = apkFile.getInputStream(entry);
CertificateFactory cf = CertificateFactory.getInstance("X.509");
X509Certificate cert = (X509Certificate) cf.generateCertificates(is).toArray()[0];