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

Commit 83950247 authored by Satoshi Sanno's avatar Satoshi Sanno Committed by android-build-merger
Browse files

Merge "Fix that the update to v1 signed version fails if apk verity is...

Merge "Fix that the update to v1 signed version fails if apk verity is enabled" am: 0b3fe647 am: b6fd88c4
am: 6f113ece

Change-Id: Iaf80875375068f17fe12f8846fae8c5afc2cbc2f
parents 0c5a824b 6f113ece
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -393,15 +393,18 @@ public class ApkSignatureVerifier {
    /**
     * @return the verity root hash in the Signing Block.
     */
    public static byte[] getVerityRootHash(String apkPath)
            throws IOException, SignatureNotFoundException, SecurityException {
    public static byte[] getVerityRootHash(String apkPath) throws IOException, SecurityException {
        // first try v3
        try {
            return ApkSignatureSchemeV3Verifier.getVerityRootHash(apkPath);
        } catch (SignatureNotFoundException e) {
            // try older version
        }
        try {
            return ApkSignatureSchemeV2Verifier.getVerityRootHash(apkPath);
        } catch (SignatureNotFoundException e) {
            return null;
        }
    }

    /**