Apparently, some packages from Play Store are unsigned? Doubtful.

This commit is contained in:
Sergey Eremin
2017-02-28 20:11:16 +03:00
parent 53f843c946
commit 47452db7b5

View File

@@ -53,6 +53,9 @@ class ApkSignatureVerifier {
private byte[] getApkSignature(File apkFile) {
final String pkgPath = apkFile.getAbsolutePath();
PackageInfo pkgInfo = pm.getPackageArchiveInfo(pkgPath, PackageManager.GET_SIGNATURES);
if (null == pkgInfo || null == pkgInfo.signatures) {
return new byte[] {};
}
return signatureToBytes(pkgInfo.signatures);
}