PackageManager.GET_SIGNATURES use real apk signature instead of dummy

WhatsApp needs its own signature to generate a valid authentication token
This commit is contained in:
Julian Winkler
2024-06-24 18:49:58 +02:00
committed by Mis012
parent 051e80ae91
commit a8ba2f797a
3 changed files with 9 additions and 39 deletions

View File

@@ -661,7 +661,7 @@ public class PackageParser {
final String name = je.getName();
if (name.startsWith("META-INF/"))
if (name.startsWith("META-INF/") && !"META-INF/MANIFEST.MF".equals(name)) // MANIFEST.MF is always trusted, get certificate from it
continue;
if (ANDROID_MANIFEST_FILENAME.equals(name)) {
@@ -675,10 +675,10 @@ public class PackageParser {
}
if (localCerts == null) {
Slog.e(TAG, "Package " + pkg.packageName + " has no certificates at entry " + je.getName() + "; ignoring!");
jarFile.close();
mParseError = PackageManager.INSTALL_PARSE_FAILED_NO_CERTIFICATES;
return false;
// Slog.e(TAG, "Package " + pkg.packageName + " has no certificates at entry " + je.getName() + "; ignoring!");
// jarFile.close();
// mParseError = PackageManager.INSTALL_PARSE_FAILED_NO_CERTIFICATES;
// return false;
} else if (certs == null) {
certs = localCerts;
} else {