From 6a575f6eb292482158d1d9222af9a61913a876cb Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 17 Nov 2022 09:00:19 +0100 Subject: [PATCH] Align enforced supported version with DeviceOptions.Version field --- .../frontend/dokany/internal/structure/DeviceOptions.java | 5 ++++- .../frontend/dokany/mount/DokanyMountProvider.java | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/cryptomator/frontend/dokany/internal/structure/DeviceOptions.java b/src/main/java/org/cryptomator/frontend/dokany/internal/structure/DeviceOptions.java index 8813053..9486b63 100644 --- a/src/main/java/org/cryptomator/frontend/dokany/internal/structure/DeviceOptions.java +++ b/src/main/java/org/cryptomator/frontend/dokany/internal/structure/DeviceOptions.java @@ -12,10 +12,13 @@ * Dokany mount options used to describe Dokany device behavior. This is the same structure as PDOKAN_OPTIONS (dokan.h) in the C++ version of Dokany. */ public class DeviceOptions extends Structure implements Structure.ByReference { + + public static short DOKANY_FEATURE_VERSION = 150; + /** * Version of the Dokany features requested (version "123" is equal to Dokany version 1.2.3). */ - public short Version = 150; + public short Version = DOKANY_FEATURE_VERSION; /** * Number of threads to be used internally by Dokany library. More thread will handle more event at the same time. */ diff --git a/src/main/java/org/cryptomator/frontend/dokany/mount/DokanyMountProvider.java b/src/main/java/org/cryptomator/frontend/dokany/mount/DokanyMountProvider.java index 3434058..a5b4df9 100644 --- a/src/main/java/org/cryptomator/frontend/dokany/mount/DokanyMountProvider.java +++ b/src/main/java/org/cryptomator/frontend/dokany/mount/DokanyMountProvider.java @@ -39,7 +39,6 @@ public class DokanyMountProvider implements MountService { private static final Logger LOG = LoggerFactory.getLogger(DokanyMountProvider.class); - private static final int SUPPORTED_API_VERSION = 150; private static final int SUPPORTED_DRIVER_VERSION = 400; private static final EnumIntegerSet DEFAULT_FS_FEATURES = new EnumIntegerSet(CASE_PRESERVED_NAMES, CASE_SENSITIVE_SEARCH, UNICODE_ON_DISK); @@ -52,7 +51,7 @@ public String displayName() { @Override public boolean isSupported() { return Dokany.isInstalled() // - && Dokany.apiVersion() >= SUPPORTED_API_VERSION // + && Dokany.apiVersion() >= DeviceOptions.DOKANY_FEATURE_VERSION // && Dokany.driverVersion() >= SUPPORTED_DRIVER_VERSION; }