diff --git a/daemon/src/main/java/org/lsposed/lspd/service/ConfigFileManager.java b/daemon/src/main/java/org/lsposed/lspd/service/ConfigFileManager.java index 6e72014f3..1f4d08e09 100644 --- a/daemon/src/main/java/org/lsposed/lspd/service/ConfigFileManager.java +++ b/daemon/src/main/java/org/lsposed/lspd/service/ConfigFileManager.java @@ -193,9 +193,18 @@ public FileVisitResult postVisitDirectory(Path dir, IOException e) public static boolean chattr0(Path path) { try { var dir = Os.open(path.toString(), OsConstants.O_RDONLY, 0); + // Clear all special file attributes on the directory HiddenApiBridge.Os_ioctlInt(dir, Process.is64Bit() ? 0x40086602 : 0x40046602, 0); Os.close(dir); return true; + } catch (ErrnoException e) { + // If the operation is not supported (ENOTSUP), it means the filesystem doesn't support attributes. + // We can assume the file is not immutable and proceed. + if (e.errno == OsConstants.ENOTSUP) { + return true; + } + Log.d(TAG, "chattr 0", e); + return false; } catch (Throwable e) { Log.d(TAG, "chattr 0", e); return false;