Merge "Revert "Merge "Restore V2+ signature requirement for system apps" into tm-dev am: a347b6c2e6 am: 8aa6d20125"" into tm-d1-dev am: 570156dd3c am: e5f67572e5 am: 9b6ded80b2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18141981

Change-Id: I7a9f97126884dcfe4cc40938f32db83fe90035a2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Zac Iqbal
2022-05-04 03:09:07 +00:00
committed by Automerger Merge Worker
4 changed files with 20 additions and 14 deletions

View File

@@ -1414,9 +1414,11 @@ public class PackageParser {
final ParseTypeImpl input = ParseTypeImpl.forDefaultParsing();
final ParseResult<android.content.pm.SigningDetails> result;
if (skipVerify) {
// systemDir APKs are already trusted, save time by not verifying
// systemDir APKs are already trusted, save time by not verifying; since the signature
// is not verified and some system apps can have their V2+ signatures stripped allow
// pulling the certs from the jar signature.
result = ApkSignatureVerifier.unsafeGetCertsWithoutVerification(
input, apkPath, minSignatureScheme);
input, apkPath, SigningDetails.SignatureSchemeVersion.JAR);
} else {
result = ApkSignatureVerifier.verify(input, apkPath, minSignatureScheme);
}