hsiafan / apk-parser

Apk parser for java
BSD 2-Clause "Simplified" License
1.21k stars 360 forks source link

fail to parse certification #63

Open tastypear opened 6 years ago

tastypear commented 6 years ago

I recently meet a strange apk.

APK: APK file standalone RSA: RSA file

It can be installed correctly but apk-parser cannot parse the cert. This .RSA file is obviously smaller than other APKs.

btw, keytool on windows, debian, osx, centos can't dump info, but it works on ubuntu jdk 1.8. screenshot

hsiafan commented 6 years ago

Does ubuntu has different jdk version with other OSes? keytool also failed to parse the rsa file for me, but openssl works well. It seems like a jdk issue

hsiafan commented 6 years ago

The lasteat version 2.3.0 uses bouncycastle to deal with certificates, now the apk can be handled correctly.

tastypear commented 6 years ago

All OSes have jdk1.8 ( JDK9 does not work either ). I have tried apk-parser 2.3.0 and it shows MD5=D7:F3:B1:BB:08:FB:ED:19:8C:3E:4B:79:4D:28:16:32 . It's the same value as openssl pkcs7 -in CERT.RSA -inform DER -print_certs | openssl x509 -noout -fingerprint -md5. I don't think this value is correct because context.getPackageManager().getPackageInfo() shows MD5=5E:9C:01:85:BC:53:B0:97:15:DE:F9:A2:32:A7:DA:EA. It's the same as the value in the screenshot.

hsiafan commented 6 years ago

have no idea for this...