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

Commit e1396848 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Move fs-verity check into DexMetadataHelper" into sc-dev

parents 4a3c5047 c3dac2ed
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,