From 2ee62d082afb8522b75e76431407b8140a8e9a6e Mon Sep 17 00:00:00 2001 From: Victor Hsieh Date: Mon, 28 Nov 2022 14:06:10 -0800 Subject: [PATCH] Restore the check of fs-verity status IncFs v1 does not support fs-verity. The original condition before ag/20327155 allowed a split to be installed without .fsv_sig, but ag/ ag/20327155 changes the expectation. To maintain the behavior, still check the fs-verity-ness in addition. Bug: 257775576 Test: abtd Change-Id: If0a87b2ef4ad2e4c4920dbd17d1591b021f470d1 --- .../core/java/com/android/server/pm/PackageInstallerSession.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/core/java/com/android/server/pm/PackageInstallerSession.java b/services/core/java/com/android/server/pm/PackageInstallerSession.java index 2ee12bf978234..028bb24be864d 100644 --- a/services/core/java/com/android/server/pm/PackageInstallerSession.java +++ b/services/core/java/com/android/server/pm/PackageInstallerSession.java @@ -2782,6 +2782,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { // Default to require only if existing base apk has fs-verity signature. mVerityFoundForApks = PackageManagerServiceUtils.isApkVerityEnabled() && params.mode == SessionParams.MODE_INHERIT_EXISTING + && VerityUtils.hasFsverity(pkgInfo.applicationInfo.getBaseCodePath()) && (new File(VerityUtils.getFsveritySignatureFilePath( pkgInfo.applicationInfo.getBaseCodePath()))).exists();