fix decryption support with tama SODP roms

this patch needs to be applied to system/vold manually

the patch disables support for FS_IOC_ADD_ENCRYPTION_KEY ioctl that
twrp probes and uses if available, but if twrp uses this with SODP
kernel 4.14 decryption fails at the end

this workaround makes twrp use the older api => decryption works

this patch is not needed for more common stock kernel based roms,
like the official Lineage OS for Sony Xperia XZ2 / XZ2c / XZ2p / XZ3
This commit is contained in:
j4nn 2025-10-05 23:58:24 +02:00
commit 7a67f17a75

View file

@ -0,0 +1,19 @@
Subject: [PATCH] system/vold: disable support for FS_IOC_ADD_ENCRYPTION_KEY
this workaround is needed to make decryption with SODP kernel 4.14 working in twrp
project system/vold/
diff --git a/system/vold/KeyUtil.cpp b/system/vold/KeyUtil.cpp
index 9273564..28628aa 100644
--- a/system/vold/KeyUtil.cpp
+++ b/system/vold/KeyUtil.cpp
@@ -87,7 +87,8 @@ static bool isFsKeyringSupportedImpl() {
if (errno != EFAULT) {
PLOG(WARNING) << "Unexpected error from FS_IOC_ADD_ENCRYPTION_KEY";
}
- LOG(INFO) << "Detected support for FS_IOC_ADD_ENCRYPTION_KEY";
+ LOG(INFO) << "Detected support for FS_IOC_ADD_ENCRYPTION_KEY, but returning false!";
+ return false;
android::base::SetProperty("ro.crypto.uses_fs_ioc_add_encryption_key", "true");
return true;
}