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

Commit 376fe2d7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Move fs-verity check into DexMetadataHelper" into sc-dev am: e1396848

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If2b87039d9604e245cfa203f1370d293e3539b9f
parents 36c5e3d5 e1396848
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.util.Log;
import android.util.jar.StrictJarFile;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.security.VerityUtils;

import java.io.File;
import java.io.IOException;
@@ -76,7 +77,8 @@ public class DexMetadataHelper {
     * Returns whether fs-verity is required to install a dex metadata
     */
    public static boolean isFsVerityRequired() {
        return SystemProperties.getBoolean(PROPERTY_DM_FSVERITY_REQUIRED, false);
        return VerityUtils.isFsVeritySupported()
                && SystemProperties.getBoolean(PROPERTY_DM_FSVERITY_REQUIRED, false);
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -3060,7 +3060,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
        // Also stage .dm.fsv_sig. .dm may be required to install with fs-verity signature on
        // supported on older devices.
        maybeStageFsveritySignatureLocked(dexMetadataFile, targetDexMetadataFile,
                VerityUtils.isFsVeritySupported() && DexMetadataHelper.isFsVerityRequired());
                DexMetadataHelper.isFsVerityRequired());
    }

    private void storeBytesToInstallationFile(final String localPath, final String absolutePath,