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

Commit 3a290c6b authored by Mohammad Islam's avatar Mohammad Islam Committed by Gerrit Code Review
Browse files

Merge "Allow key downgrade during staged install of apex packages"

parents 6bb11e48 16618cd8
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -151,6 +151,14 @@ public class StagingManager {
            return;
        }

        // Verify signing details for downgrade
        // Allow downgrading from B to A iff it is possible to upgrade from A to B
        if (existingApexPkg.getLongVersionCode() > newApexPkg.getLongVersionCode()
                && existingSigningDetails.checkCapability(signingDetails,
                        PackageParser.SigningDetails.CertCapabilities.INSTALLED_DATA)) {
            return;
        }

        throw new PackageManagerException(SessionInfo.STAGED_SESSION_VERIFICATION_FAILED,
                "APK-container signature of APEX package " + packageName + " with version "
                        + newApexPkg.versionCodeMajor + " and path " + apexPath + " is not"