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

Commit 47bbdaf2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Replace incomplete path-based check with statx" am: 0791285a am:...

Merge "Replace incomplete path-based check with statx" am: 0791285a am: 7d47c82b am: 0edf2cdb am: bfaca30a

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



Change-Id: Ib412f2b4a373ddf7188427309653fa5d5ece621c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents cd50aa6c bfaca30a
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -40,8 +40,6 @@ import android.content.pm.SigningDetails.SignatureSchemeVersion;
import android.content.pm.parsing.ApkLiteParseUtils;
import android.content.pm.parsing.result.ParseResult;
import android.content.pm.parsing.result.ParseTypeImpl;
import android.os.Environment;
import android.os.FileUtils;
import android.os.Handler;
import android.os.RemoteException;
import android.os.SystemClock;
@@ -637,18 +635,9 @@ public class ApkChecksums {
        return null;
    }

    private static boolean containsFile(File dir, String filePath) {
        if (dir == null) {
            return false;
        }
        return FileUtils.contains(dir.getAbsolutePath(), filePath);
    }

    private static ApkChecksum extractHashFromFS(String split, String filePath) {
        // verity first
        // Skip /product folder.
        // TODO(b/231354111): remove this hack once we are allowed to change SELinux rules.
        if (!containsFile(Environment.getProductDirectory(), filePath)) {
        if (VerityUtils.hasFsverity(filePath)) {
            byte[] verityHash = VerityUtils.getFsverityDigest(filePath);
            if (verityHash != null) {
                return new ApkChecksum(split, TYPE_WHOLE_MERKLE_ROOT_4K_SHA256, verityHash);