Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c36fd5f authored by Michael Groover's avatar Michael Groover
Browse files

[DO NOT MERGE]Revert "Relax minimum signature scheme version for apps on system partition"

This reverts commit b71e3989.

Revert reason: System apps should now have uncompressed dex / library
files in their APKs and should be able to satisfy the minimum V2
signature requirement when targeting API level 30+.

Fixes: 215046612
Test: Manually verified V1 only signed APK targeting API level 30
      on the system image failed to verify.
Change-Id: Ic53d2a3614e7dff4e4bfe18561d3dfbb665bbcb2
parent 0a771d17
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1401,11 +1401,9 @@ public class PackageParser {
        }
        SigningDetails verified;
        if (skipVerify) {
            // 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.
            // systemDir APKs are already trusted, save time by not verifying
            verified = ApkSignatureVerifier.unsafeGetCertsWithoutVerification(
                        apkPath, SigningDetails.SignatureSchemeVersion.JAR);
                        apkPath, minSignatureScheme);
        } else {
            verified = ApkSignatureVerifier.verify(apkPath, minSignatureScheme);
        }
+2 −4
Original line number Diff line number Diff line
@@ -3038,11 +3038,9 @@ public class ParsingPackageUtils {
        SigningDetails verified;
        try {
            if (skipVerify) {
                // 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.
                // systemDir APKs are already trusted, save time by not verifying
                verified = ApkSignatureVerifier.unsafeGetCertsWithoutVerification(
                        baseCodePath, SigningDetails.SignatureSchemeVersion.JAR);
                        baseCodePath, minSignatureScheme);
            } else {
                verified = ApkSignatureVerifier.verify(baseCodePath, minSignatureScheme);
            }
+9 −11
Original line number Diff line number Diff line
@@ -15193,9 +15193,8 @@ public class PackageManagerService extends IPackageManager.Stub
                }
            }
            // If the package is not on a system partition ensure it is signed with at least the
            // minimum signature scheme version required for its target SDK.
            if ((parseFlags & ParsingPackageUtils.PARSE_IS_SYSTEM_DIR) == 0) {
            // Ensure the package is signed with at least the minimum signature scheme version
            // required for its target SDK.
            int minSignatureSchemeVersion =
                    ApkSignatureVerifier.getMinimumSignatureSchemeVersionForTargetSdk(
                            pkg.getTargetSdkVersion());
@@ -15206,7 +15205,6 @@ public class PackageManagerService extends IPackageManager.Stub
            }
        }
    }
    }
    @GuardedBy("mLock")
    private boolean addBuiltInSharedLibraryLocked(SystemConfig.SharedLibraryEntry entry) {