From eb4d39e8b481a5c16996b3002d318b1bb42f9f8d Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 12 Sep 2023 13:34:55 +0200 Subject: [PATCH 01/23] introduce 'errorCode' parameter in request --- src/main/java/org/cryptomator/ui/error/ErrorController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/error/ErrorController.java b/src/main/java/org/cryptomator/ui/error/ErrorController.java index 3feb3ff44..deb114116 100644 --- a/src/main/java/org/cryptomator/ui/error/ErrorController.java +++ b/src/main/java/org/cryptomator/ui/error/ErrorController.java @@ -42,7 +42,7 @@ public class ErrorController implements FxController { private static final ObjectMapper JSON = new ObjectMapper(); private static final Logger LOG = LoggerFactory.getLogger(ErrorController.class); - private static final String ERROR_CODES_URL = "https://api.cryptomator.org/desktop/error-codes.json"; + private static final String ERROR_CODES_URL = "https://api.cryptomator.org/desktop/error-codes.json?error-code=%s"; private static final String SEARCH_URL_FORMAT = "https://github.com/cryptomator/cryptomator/discussions/categories/errors?discussions_q=category:Errors+%s"; private static final String REPORT_URL_FORMAT = "https://github.com/cryptomator/cryptomator/discussions/new?category=Errors&title=Error+%s&body=%s"; private static final String SEARCH_ERRORCODE_DELIM = " OR "; @@ -146,7 +146,7 @@ public class ErrorController implements FxController { askedForLookupDatabasePermission.set(true); HttpClient httpClient = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build(); HttpRequest httpRequest = HttpRequest.newBuilder()// - .uri(URI.create(ERROR_CODES_URL))// + .uri(URI.create(ERROR_CODES_URL.formatted(errorCode.toString())))// .build(); httpClient.sendAsync(httpRequest, HttpResponse.BodyHandlers.ofInputStream())// .thenAcceptAsync(this::loadHttpResponse, executorService)// From 666cd4a4f05367a4a5723d1fcec9b3517bd6c451 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 12 Sep 2023 17:14:45 +0200 Subject: [PATCH 02/23] enhanced request URI with URLEncoder for errorCode --- src/main/java/org/cryptomator/ui/error/ErrorController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/cryptomator/ui/error/ErrorController.java b/src/main/java/org/cryptomator/ui/error/ErrorController.java index deb114116..686d219e1 100644 --- a/src/main/java/org/cryptomator/ui/error/ErrorController.java +++ b/src/main/java/org/cryptomator/ui/error/ErrorController.java @@ -146,7 +146,7 @@ public class ErrorController implements FxController { askedForLookupDatabasePermission.set(true); HttpClient httpClient = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build(); HttpRequest httpRequest = HttpRequest.newBuilder()// - .uri(URI.create(ERROR_CODES_URL.formatted(errorCode.toString())))// + .uri(URI.create(ERROR_CODES_URL.formatted(URLEncoder.encode(errorCode.toString(),StandardCharsets.UTF_8))))// .build(); httpClient.sendAsync(httpRequest, HttpResponse.BodyHandlers.ofInputStream())// .thenAcceptAsync(this::loadHttpResponse, executorService)// From 5d7906972b0c59d877c391573d44ed8b9c64e1f4 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 12 Sep 2023 17:59:08 +0200 Subject: [PATCH 03/23] added user-agent header with / to HttpRequest --- .../org/cryptomator/ui/error/ErrorController.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/error/ErrorController.java b/src/main/java/org/cryptomator/ui/error/ErrorController.java index 686d219e1..856d8599f 100644 --- a/src/main/java/org/cryptomator/ui/error/ErrorController.java +++ b/src/main/java/org/cryptomator/ui/error/ErrorController.java @@ -6,6 +6,7 @@ import org.cryptomator.common.Environment; import org.cryptomator.common.ErrorCode; import org.cryptomator.common.Nullable; import org.cryptomator.ui.common.FxController; +import org.cryptomator.ui.fxapp.UpdateChecker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -42,7 +43,8 @@ public class ErrorController implements FxController { private static final ObjectMapper JSON = new ObjectMapper(); private static final Logger LOG = LoggerFactory.getLogger(ErrorController.class); - private static final String ERROR_CODES_URL = "https://api.cryptomator.org/desktop/error-codes.json?error-code=%s"; + private static final String USER_AGENT_VERSION_FORMAT = "Cryptomator/%s"; + private static final String ERROR_CODES_URL_FORMAT = "https://api.cryptomator.org/desktop/error-codes.json?error-code=%s"; private static final String SEARCH_URL_FORMAT = "https://github.com/cryptomator/cryptomator/discussions/categories/errors?discussions_q=category:Errors+%s"; private static final String REPORT_URL_FORMAT = "https://github.com/cryptomator/cryptomator/discussions/new?category=Errors&title=Error+%s&body=%s"; private static final String SEARCH_ERRORCODE_DELIM = " OR "; @@ -67,6 +69,7 @@ public class ErrorController implements FxController { private final Stage window; private final Environment environment; private final ExecutorService executorService; + private final UpdateChecker updateChecker; private final BooleanProperty copiedDetails = new SimpleBooleanProperty(); private final ObjectProperty matchingErrorDiscussion = new SimpleObjectProperty<>(); @@ -75,7 +78,7 @@ public class ErrorController implements FxController { private final BooleanProperty askedForLookupDatabasePermission = new SimpleBooleanProperty(); @Inject - ErrorController(Application application, @Named("stackTrace") String stackTrace, ErrorCode errorCode, @Nullable Scene previousScene, Stage window, Environment environment, ExecutorService executorService) { + ErrorController(Application application, @Named("stackTrace") String stackTrace, ErrorCode errorCode, @Nullable Scene previousScene, Stage window, Environment environment, ExecutorService executorService, UpdateChecker updateChecker) { this.application = application; this.stackTrace = stackTrace; this.errorCode = errorCode; @@ -83,6 +86,7 @@ public class ErrorController implements FxController { this.window = window; this.environment = environment; this.executorService = executorService; + this.updateChecker = updateChecker; } @FXML @@ -146,7 +150,8 @@ public class ErrorController implements FxController { askedForLookupDatabasePermission.set(true); HttpClient httpClient = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build(); HttpRequest httpRequest = HttpRequest.newBuilder()// - .uri(URI.create(ERROR_CODES_URL.formatted(URLEncoder.encode(errorCode.toString(),StandardCharsets.UTF_8))))// + .header("User-Agent", USER_AGENT_VERSION_FORMAT.formatted(updateChecker.getCurrentVersion())) + .uri(URI.create(ERROR_CODES_URL_FORMAT.formatted(URLEncoder.encode(errorCode.toString(),StandardCharsets.UTF_8))))// .build(); httpClient.sendAsync(httpRequest, HttpResponse.BodyHandlers.ofInputStream())// .thenAcceptAsync(this::loadHttpResponse, executorService)// From 4c836178470b2d1635fdab3a947bd09aed8b7556 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 12 Sep 2023 18:07:30 +0200 Subject: [PATCH 04/23] fixed build error --- .../java/org/cryptomator/ui/error/ErrorController.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/error/ErrorController.java b/src/main/java/org/cryptomator/ui/error/ErrorController.java index 856d8599f..8fcc01ea8 100644 --- a/src/main/java/org/cryptomator/ui/error/ErrorController.java +++ b/src/main/java/org/cryptomator/ui/error/ErrorController.java @@ -6,7 +6,6 @@ import org.cryptomator.common.Environment; import org.cryptomator.common.ErrorCode; import org.cryptomator.common.Nullable; import org.cryptomator.ui.common.FxController; -import org.cryptomator.ui.fxapp.UpdateChecker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -69,7 +68,6 @@ public class ErrorController implements FxController { private final Stage window; private final Environment environment; private final ExecutorService executorService; - private final UpdateChecker updateChecker; private final BooleanProperty copiedDetails = new SimpleBooleanProperty(); private final ObjectProperty matchingErrorDiscussion = new SimpleObjectProperty<>(); @@ -78,7 +76,7 @@ public class ErrorController implements FxController { private final BooleanProperty askedForLookupDatabasePermission = new SimpleBooleanProperty(); @Inject - ErrorController(Application application, @Named("stackTrace") String stackTrace, ErrorCode errorCode, @Nullable Scene previousScene, Stage window, Environment environment, ExecutorService executorService, UpdateChecker updateChecker) { + ErrorController(Application application, @Named("stackTrace") String stackTrace, ErrorCode errorCode, @Nullable Scene previousScene, Stage window, Environment environment, ExecutorService executorService) { this.application = application; this.stackTrace = stackTrace; this.errorCode = errorCode; @@ -86,7 +84,6 @@ public class ErrorController implements FxController { this.window = window; this.environment = environment; this.executorService = executorService; - this.updateChecker = updateChecker; } @FXML @@ -150,7 +147,7 @@ public class ErrorController implements FxController { askedForLookupDatabasePermission.set(true); HttpClient httpClient = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build(); HttpRequest httpRequest = HttpRequest.newBuilder()// - .header("User-Agent", USER_AGENT_VERSION_FORMAT.formatted(updateChecker.getCurrentVersion())) + .header("User-Agent", USER_AGENT_VERSION_FORMAT.formatted(environment.getAppVersion())) .uri(URI.create(ERROR_CODES_URL_FORMAT.formatted(URLEncoder.encode(errorCode.toString(),StandardCharsets.UTF_8))))// .build(); httpClient.sendAsync(httpRequest, HttpResponse.BodyHandlers.ofInputStream())// From 9d640b57cee557541b5b46db46a8cde234fbe10a Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Wed, 13 Sep 2023 12:31:53 +0200 Subject: [PATCH 05/23] added build number to user-agent header --- src/main/java/org/cryptomator/ui/error/ErrorController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/error/ErrorController.java b/src/main/java/org/cryptomator/ui/error/ErrorController.java index 8fcc01ea8..5009229b5 100644 --- a/src/main/java/org/cryptomator/ui/error/ErrorController.java +++ b/src/main/java/org/cryptomator/ui/error/ErrorController.java @@ -42,7 +42,7 @@ public class ErrorController implements FxController { private static final ObjectMapper JSON = new ObjectMapper(); private static final Logger LOG = LoggerFactory.getLogger(ErrorController.class); - private static final String USER_AGENT_VERSION_FORMAT = "Cryptomator/%s"; + private static final String USER_AGENT_VERSION_FORMAT = "Cryptomator/%s (Build %s)"; private static final String ERROR_CODES_URL_FORMAT = "https://api.cryptomator.org/desktop/error-codes.json?error-code=%s"; private static final String SEARCH_URL_FORMAT = "https://github.com/cryptomator/cryptomator/discussions/categories/errors?discussions_q=category:Errors+%s"; private static final String REPORT_URL_FORMAT = "https://github.com/cryptomator/cryptomator/discussions/new?category=Errors&title=Error+%s&body=%s"; @@ -147,7 +147,7 @@ public class ErrorController implements FxController { askedForLookupDatabasePermission.set(true); HttpClient httpClient = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build(); HttpRequest httpRequest = HttpRequest.newBuilder()// - .header("User-Agent", USER_AGENT_VERSION_FORMAT.formatted(environment.getAppVersion())) + .header("User-Agent", USER_AGENT_VERSION_FORMAT.formatted(environment.getAppVersion(),environment.getBuildNumber().orElse("undefined"))) .uri(URI.create(ERROR_CODES_URL_FORMAT.formatted(URLEncoder.encode(errorCode.toString(),StandardCharsets.UTF_8))))// .build(); httpClient.sendAsync(httpRequest, HttpResponse.BodyHandlers.ofInputStream())// From bcb970afb1639fe5869a3670fbb9d2eeb8e0d2c6 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 13 Sep 2023 13:59:50 +0200 Subject: [PATCH 06/23] Update bug.yml Add missing FUSE option in volume type selection --- .github/ISSUE_TEMPLATE/bug.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 6c30aa606..9ced33c15 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -43,6 +43,7 @@ body: - WinFsp (Local Drive) - FUSE-T - macFUSE + - FUSE - WebDAV (Windows Explorer) - WebDAV (AppleScript) - WebDAV (gio) @@ -95,4 +96,4 @@ body: id: further-info attributes: label: Anything else? - description: Links? References? Screenshots? Configurations? Any data that might be necessary to reproduce the issue? \ No newline at end of file + description: Links? References? Screenshots? Configurations? Any data that might be necessary to reproduce the issue? From 84ac803a7d8dfa3682b25627c3c7b4ae8a3a86cd Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 18 Sep 2023 10:10:50 +0200 Subject: [PATCH 07/23] reordered properties [ci skip] --- .../org/cryptomator/common/Environment.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/cryptomator/common/Environment.java b/src/main/java/org/cryptomator/common/Environment.java index c47870dd8..8e378b93d 100644 --- a/src/main/java/org/cryptomator/common/Environment.java +++ b/src/main/java/org/cryptomator/common/Environment.java @@ -43,15 +43,15 @@ public class Environment { logCryptomatorSystemProperty(SETTINGS_PATH_PROP_NAME); logCryptomatorSystemProperty(IPC_SOCKET_PATH_PROP_NAME); logCryptomatorSystemProperty(KEYCHAIN_PATHS_PROP_NAME); + logCryptomatorSystemProperty(P12_PATH_PROP_NAME); logCryptomatorSystemProperty(LOG_DIR_PROP_NAME); logCryptomatorSystemProperty(LOOPBACK_ALIAS_PROP_NAME); - logCryptomatorSystemProperty(PLUGIN_DIR_PROP_NAME); logCryptomatorSystemProperty(MOUNTPOINT_DIR_PROP_NAME); logCryptomatorSystemProperty(MIN_PW_LENGTH_PROP_NAME); logCryptomatorSystemProperty(APP_VERSION_PROP_NAME); logCryptomatorSystemProperty(BUILD_NUMBER_PROP_NAME); + logCryptomatorSystemProperty(PLUGIN_DIR_PROP_NAME); logCryptomatorSystemProperty(TRAY_ICON_PROP_NAME); - logCryptomatorSystemProperty(P12_PATH_PROP_NAME); } public static Environment getInstance() { @@ -74,10 +74,6 @@ public class Environment { return getPaths(SETTINGS_PATH_PROP_NAME); } - public Stream getP12Path() { - return getPaths(P12_PATH_PROP_NAME); - } - public Stream getIpcSocketPath() { return getPaths(IPC_SOCKET_PATH_PROP_NAME); } @@ -86,6 +82,10 @@ public class Environment { return getPaths(KEYCHAIN_PATHS_PROP_NAME); } + public Stream getP12Path() { + return getPaths(P12_PATH_PROP_NAME); + } + public Optional getLogDir() { return getPath(LOG_DIR_PROP_NAME); } @@ -94,14 +94,14 @@ public class Environment { return Optional.ofNullable(System.getProperty(LOOPBACK_ALIAS_PROP_NAME)); } - public Optional getPluginDir() { - return getPath(PLUGIN_DIR_PROP_NAME); - } - public Optional getMountPointsDir() { return getPath(MOUNTPOINT_DIR_PROP_NAME); } + public int getMinPwLength() { + return Integer.getInteger(MIN_PW_LENGTH_PROP_NAME, DEFAULT_MIN_PW_LENGTH); + } + /** * Returns the app version defined in the {@value APP_VERSION_PROP_NAME} property or returns "SNAPSHOT". * @@ -115,8 +115,8 @@ public class Environment { return Optional.ofNullable(System.getProperty(BUILD_NUMBER_PROP_NAME)); } - public int getMinPwLength() { - return Integer.getInteger(MIN_PW_LENGTH_PROP_NAME, DEFAULT_MIN_PW_LENGTH); + public Optional getPluginDir() { + return getPath(PLUGIN_DIR_PROP_NAME); } public boolean showTrayIcon() { From e31e06b288be0be0e58ffe4ae7ed925819896277 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 18 Sep 2023 10:13:51 +0200 Subject: [PATCH 08/23] added `@VisibleForTesting` --- src/main/java/org/cryptomator/common/Environment.java | 3 ++- src/main/java/org/cryptomator/common/ErrorCode.java | 5 +++-- .../cryptomator/common/mount/MountWithinParentUtil.java | 9 +++++---- .../org/cryptomator/common/settings/VaultSettings.java | 3 ++- .../org/cryptomator/launcher/FileOpenRequestHandler.java | 3 ++- .../cryptomator/ui/addvaultwizard/ReadmeGenerator.java | 6 ++++-- .../ui/convertvault/HubToPasswordConvertController.java | 7 ++++--- .../cryptomator/ui/recoverykey/RecoveryKeyFactory.java | 3 ++- 8 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/cryptomator/common/Environment.java b/src/main/java/org/cryptomator/common/Environment.java index 8e378b93d..17816df96 100644 --- a/src/main/java/org/cryptomator/common/Environment.java +++ b/src/main/java/org/cryptomator/common/Environment.java @@ -2,6 +2,7 @@ package org.cryptomator.common; import com.google.common.base.Splitter; import com.google.common.base.Strings; +import org.jetbrains.annotations.VisibleForTesting; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -128,7 +129,7 @@ public class Environment { return Optional.ofNullable(value).map(Paths::get); } - // visible for testing + @VisibleForTesting Stream getPaths(String propertyName) { Stream rawSettingsPaths = getRawList(propertyName, System.getProperty("path.separator").charAt(0)); return rawSettingsPaths.filter(Predicate.not(Strings::isNullOrEmpty)).map(Path::of); diff --git a/src/main/java/org/cryptomator/common/ErrorCode.java b/src/main/java/org/cryptomator/common/ErrorCode.java index 7363e2278..d75ab97d0 100644 --- a/src/main/java/org/cryptomator/common/ErrorCode.java +++ b/src/main/java/org/cryptomator/common/ErrorCode.java @@ -3,6 +3,7 @@ package org.cryptomator.common; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import com.google.common.base.Throwables; +import org.jetbrains.annotations.VisibleForTesting; import java.util.Locale; import java.util.Objects; @@ -114,7 +115,7 @@ public class ErrorCode { * @param bottomFrames Other stack frames, potentially forming the bottom of the stack of allFrames * @return The number of additional frames in allFrames. In most cases this should be equal to the difference in size. */ - // visible for testing + @VisibleForTesting static int countTopmostFrames(StackTraceElement[] allFrames, StackTraceElement[] bottomFrames) { if (allFrames.length < bottomFrames.length) { // if frames had been stacked on top of bottomFrames, allFrames would be larger @@ -124,7 +125,7 @@ public class ErrorCode { } } - // visible for testing + @VisibleForTesting static int commonSuffixLength(T[] set, T[] subset) { Preconditions.checkArgument(set.length >= subset.length); // iterate items backwards as long as they are identical diff --git a/src/main/java/org/cryptomator/common/mount/MountWithinParentUtil.java b/src/main/java/org/cryptomator/common/mount/MountWithinParentUtil.java index b632923a8..b436bc19a 100644 --- a/src/main/java/org/cryptomator/common/mount/MountWithinParentUtil.java +++ b/src/main/java/org/cryptomator/common/mount/MountWithinParentUtil.java @@ -1,6 +1,7 @@ package org.cryptomator.common.mount; import org.apache.commons.lang3.SystemUtils; +import org.jetbrains.annotations.VisibleForTesting; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -66,7 +67,7 @@ public final class MountWithinParentUtil { } } - //visible for testing + @VisibleForTesting static MountPointState getMountPointState(Path path) throws IOException, IllegalMountPointException { if (Files.notExists(path, LinkOption.NOFOLLOW_LINKS)) { return MountPointState.NOT_EXISTING; @@ -82,7 +83,7 @@ public final class MountWithinParentUtil { return MountPointState.BROKEN_JUNCTION; } - //visible for testing + @VisibleForTesting enum MountPointState { NOT_EXISTING, @@ -93,7 +94,7 @@ public final class MountWithinParentUtil { } - //visible for testing + @VisibleForTesting static void removeResidualHideaway(Path mountPoint, Path hideaway) throws IOException { checkIsHideawayDirectory(mountPoint, hideaway); Files.delete(hideaway); //Fails if not empty @@ -155,7 +156,7 @@ public final class MountWithinParentUtil { } } - //visible for testing + @VisibleForTesting static Path getHideaway(Path mountPoint) { return mountPoint.resolveSibling(HIDEAWAY_PREFIX + mountPoint.getFileName().toString() + HIDEAWAY_SUFFIX); } diff --git a/src/main/java/org/cryptomator/common/settings/VaultSettings.java b/src/main/java/org/cryptomator/common/settings/VaultSettings.java index 7b7e319c9..6662f61ff 100644 --- a/src/main/java/org/cryptomator/common/settings/VaultSettings.java +++ b/src/main/java/org/cryptomator/common/settings/VaultSettings.java @@ -9,6 +9,7 @@ import com.google.common.base.CharMatcher; import com.google.common.base.Strings; import com.google.common.io.BaseEncoding; import org.apache.commons.lang3.SystemUtils; +import org.jetbrains.annotations.VisibleForTesting; import javafx.beans.Observable; import javafx.beans.binding.Bindings; @@ -126,7 +127,7 @@ public class VaultSettings { return json; } - //visible for testing + @VisibleForTesting static String normalizeDisplayName(String original) { if (original.isBlank() || ".".equals(original) || "..".equals(original)) { return "_"; diff --git a/src/main/java/org/cryptomator/launcher/FileOpenRequestHandler.java b/src/main/java/org/cryptomator/launcher/FileOpenRequestHandler.java index eb2418c69..dbdb37823 100644 --- a/src/main/java/org/cryptomator/launcher/FileOpenRequestHandler.java +++ b/src/main/java/org/cryptomator/launcher/FileOpenRequestHandler.java @@ -6,6 +6,7 @@ *******************************************************************************/ package org.cryptomator.launcher; +import org.jetbrains.annotations.VisibleForTesting; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -48,7 +49,7 @@ class FileOpenRequestHandler { handleLaunchArgs(FileSystems.getDefault(), args); } - // visible for testing + @VisibleForTesting void handleLaunchArgs(FileSystem fs, List args) { Collection pathsToOpen = args.stream().map(str -> { try { diff --git a/src/main/java/org/cryptomator/ui/addvaultwizard/ReadmeGenerator.java b/src/main/java/org/cryptomator/ui/addvaultwizard/ReadmeGenerator.java index 5cf14444a..2ffda4d73 100644 --- a/src/main/java/org/cryptomator/ui/addvaultwizard/ReadmeGenerator.java +++ b/src/main/java/org/cryptomator/ui/addvaultwizard/ReadmeGenerator.java @@ -1,5 +1,7 @@ package org.cryptomator.ui.addvaultwizard; +import org.jetbrains.annotations.VisibleForTesting; + import javax.inject.Inject; import java.util.List; import java.util.ResourceBundle; @@ -51,7 +53,7 @@ public class ReadmeGenerator { resourceBundle.getString("addvault.new.readme.accessLocation.4"))); } - // visible for testing + @VisibleForTesting String createDocument(Iterable paragraphs) { StringBuilder sb = new StringBuilder(RTF_HEADER); for (String p : paragraphs) { @@ -63,7 +65,7 @@ public class ReadmeGenerator { return sb.toString(); } - // visible for testing + @VisibleForTesting String escapeNonAsciiChars(CharSequence input) { StringBuilder sb = new StringBuilder(); appendEscaped(sb, input); diff --git a/src/main/java/org/cryptomator/ui/convertvault/HubToPasswordConvertController.java b/src/main/java/org/cryptomator/ui/convertvault/HubToPasswordConvertController.java index 51ff65ec1..fd6d49b89 100644 --- a/src/main/java/org/cryptomator/ui/convertvault/HubToPasswordConvertController.java +++ b/src/main/java/org/cryptomator/ui/convertvault/HubToPasswordConvertController.java @@ -16,6 +16,7 @@ import org.cryptomator.ui.common.FxmlFile; import org.cryptomator.ui.common.FxmlScene; import org.cryptomator.ui.fxapp.FxApplicationWindows; import org.cryptomator.ui.recoverykey.RecoveryKeyFactory; +import org.jetbrains.annotations.VisibleForTesting; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -116,7 +117,7 @@ public class HubToPasswordConvertController implements FxController { }, Platform::runLater); // } - //visible for testing + @VisibleForTesting void convertInternal() throws CompletionException, IllegalArgumentException { var passphrase = newPasswordController.getNewPassword(); var vaultPath = vault.getPath(); @@ -141,7 +142,7 @@ public class HubToPasswordConvertController implements FxController { } } - //visible for testing + @VisibleForTesting void backupHubConfig(Path hubConfigPath) throws IOException { byte[] hubConfigBytes = Files.readAllBytes(hubConfigPath); Path backupPath = hubConfigPath.resolveSibling(VAULTCONFIG_FILENAME + BackupHelper.generateFileIdSuffix(hubConfigBytes) + MASTERKEY_BACKUP_SUFFIX); @@ -149,7 +150,7 @@ public class HubToPasswordConvertController implements FxController { LOG.debug("Successfully created hub config backup {}", backupPath.getFileName()); } - //visible for testing + @VisibleForTesting Path createPasswordConfig(Path passwordConfigPath, Path masterkeyFile, Passphrase passphrase) throws IOException, MasterkeyLoadingFailedException { var unverifiedVaultConfig = vault.getVaultConfigCache().get(); try (var masterkey = masterkeyFileAccess.load(masterkeyFile, passphrase)) { diff --git a/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyFactory.java b/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyFactory.java index 73279396d..8f5bb0500 100644 --- a/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyFactory.java +++ b/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyFactory.java @@ -8,6 +8,7 @@ import org.cryptomator.cryptolib.api.InvalidPassphraseException; import org.cryptomator.cryptolib.api.Masterkey; import org.cryptomator.cryptolib.common.MasterkeyFileAccess; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.VisibleForTesting; import javax.inject.Inject; import javax.inject.Singleton; @@ -58,7 +59,7 @@ public class RecoveryKeyFactory { } } - // visible for testing + @VisibleForTesting String createRecoveryKey(byte[] rawKey) { Preconditions.checkArgument(rawKey.length == 64, "key should be 64 bytes"); byte[] paddedKey = Arrays.copyOf(rawKey, 66); From 6017d6b7a904a2d039a4c27d674f032a20a6fc3e Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 18 Sep 2023 12:34:49 +0200 Subject: [PATCH 09/23] bump webdav-nio-adapter containing fixes for CVE-2023-40167, CVE-2023-2976, CVE-2023-37895 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5e2e46028..311fcaf58 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ 1.3.0-beta6 3.0.0 2.0.0 - 2.0.3 + 2.0.4 3.13.0 From c5d6c0ce9839ad620098c8049614d81a874780a0 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 18 Sep 2023 13:03:09 +0200 Subject: [PATCH 10/23] add `cryptomator.disableUpdateCheck` property --- .../java/org/cryptomator/common/Environment.java | 6 ++++++ .../java/org/cryptomator/ui/fxapp/FxApplication.java | 9 +++++++-- .../java/org/cryptomator/ui/fxapp/UpdateChecker.java | 12 ++++++------ .../ui/preferences/PreferencesController.java | 8 +++++++- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/cryptomator/common/Environment.java b/src/main/java/org/cryptomator/common/Environment.java index 17816df96..981b3729b 100644 --- a/src/main/java/org/cryptomator/common/Environment.java +++ b/src/main/java/org/cryptomator/common/Environment.java @@ -32,6 +32,7 @@ public class Environment { private static final String BUILD_NUMBER_PROP_NAME = "cryptomator.buildNumber"; private static final String PLUGIN_DIR_PROP_NAME = "cryptomator.pluginDir"; private static final String TRAY_ICON_PROP_NAME = "cryptomator.showTrayIcon"; + private static final String DISABLE_UPDATE_CHECK_PROP_NAME = "cryptomator.disableUpdateCheck"; private Environment() {} @@ -53,6 +54,7 @@ public class Environment { logCryptomatorSystemProperty(BUILD_NUMBER_PROP_NAME); logCryptomatorSystemProperty(PLUGIN_DIR_PROP_NAME); logCryptomatorSystemProperty(TRAY_ICON_PROP_NAME); + logCryptomatorSystemProperty(DISABLE_UPDATE_CHECK_PROP_NAME); } public static Environment getInstance() { @@ -124,6 +126,10 @@ public class Environment { return Boolean.getBoolean(TRAY_ICON_PROP_NAME); } + public boolean disableUpdateCheck() { + return Boolean.getBoolean(DISABLE_UPDATE_CHECK_PROP_NAME); + } + private Optional getPath(String propertyName) { String value = System.getProperty(propertyName); return Optional.ofNullable(value).map(Paths::get); diff --git a/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java b/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java index d845655cf..711a0fa44 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java +++ b/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java @@ -1,6 +1,7 @@ package org.cryptomator.ui.fxapp; import dagger.Lazy; +import org.cryptomator.common.Environment; import org.cryptomator.common.settings.Settings; import org.cryptomator.ui.traymenu.TrayMenuComponent; import org.slf4j.Logger; @@ -17,6 +18,7 @@ public class FxApplication { private static final Logger LOG = LoggerFactory.getLogger(FxApplication.class); private final long startupTime; + private final Environment environment; private final Settings settings; private final AppLaunchEventHandler launchEventHandler; private final Lazy trayMenu; @@ -26,8 +28,9 @@ public class FxApplication { private final AutoUnlocker autoUnlocker; @Inject - FxApplication(@Named("startupTime") long startupTime, Settings settings, AppLaunchEventHandler launchEventHandler, Lazy trayMenu, FxApplicationWindows appWindows, FxApplicationStyle applicationStyle, FxApplicationTerminator applicationTerminator, AutoUnlocker autoUnlocker) { + FxApplication(@Named("startupTime") long startupTime, Environment environment, Settings settings, AppLaunchEventHandler launchEventHandler, Lazy trayMenu, FxApplicationWindows appWindows, FxApplicationStyle applicationStyle, FxApplicationTerminator applicationTerminator, AutoUnlocker autoUnlocker) { this.startupTime = startupTime; + this.environment = environment; this.settings = settings; this.launchEventHandler = launchEventHandler; this.trayMenu = trayMenu; @@ -68,7 +71,9 @@ public class FxApplication { return null; }); - appWindows.checkAndShowUpdateReminderWindow(); + if (!environment.disableUpdateCheck()) { + appWindows.checkAndShowUpdateReminderWindow(); + } launchEventHandler.startHandlingLaunchEvents(); autoUnlocker.tryUnlockForTimespan(2, TimeUnit.MINUTES); diff --git a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java index 4418f79b5..709eb2fe7 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java +++ b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java @@ -22,23 +22,23 @@ public class UpdateChecker { private static final Logger LOG = LoggerFactory.getLogger(UpdateChecker.class); private static final Duration AUTOCHECK_DELAY = Duration.seconds(5); + private final Environment env; private final Settings settings; - private final String currentVersion; private final StringProperty latestVersionProperty; private final Comparator semVerComparator; private final ScheduledService updateCheckerService; @Inject UpdateChecker(Settings settings, Environment env, @Named("latestVersion") StringProperty latestVersionProperty, @Named("SemVer") Comparator semVerComparator, ScheduledService updateCheckerService) { + this.env = env; this.settings = settings; this.latestVersionProperty = latestVersionProperty; this.semVerComparator = semVerComparator; this.updateCheckerService = updateCheckerService; - this.currentVersion = env.getAppVersion(); } public void automaticallyCheckForUpdatesIfEnabled() { - if (settings.checkForUpdates.get()) { + if (!env.disableUpdateCheck() && settings.checkForUpdates.get()) { startCheckingForUpdates(AUTOCHECK_DELAY); } } @@ -63,9 +63,9 @@ public class UpdateChecker { private void checkSucceeded(WorkerStateEvent event) { String latestVersion = updateCheckerService.getValue(); - LOG.info("Current version: {}, lastest version: {}", currentVersion, latestVersion); + LOG.info("Current version: {}, lastest version: {}", getCurrentVersion(), latestVersion); - if (semVerComparator.compare(currentVersion, latestVersion) < 0) { + if (semVerComparator.compare(getCurrentVersion(), latestVersion) < 0) { // update is available latestVersionProperty.set(latestVersion); } else { @@ -88,7 +88,7 @@ public class UpdateChecker { } public String getCurrentVersion() { - return currentVersion; + return env.getAppVersion(); } } diff --git a/src/main/java/org/cryptomator/ui/preferences/PreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/PreferencesController.java index caaaf7d80..0937fccd9 100644 --- a/src/main/java/org/cryptomator/ui/preferences/PreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/PreferencesController.java @@ -1,5 +1,6 @@ package org.cryptomator.ui.preferences; +import org.cryptomator.common.Environment; import org.cryptomator.ui.common.FxController; import org.cryptomator.ui.fxapp.UpdateChecker; import org.slf4j.Logger; @@ -19,6 +20,7 @@ public class PreferencesController implements FxController { private static final Logger LOG = LoggerFactory.getLogger(PreferencesController.class); + private final Environment env; private final Stage window; private final ObjectProperty selectedTabProperty; private final BooleanBinding updateAvailable; @@ -31,7 +33,8 @@ public class PreferencesController implements FxController { public Tab aboutTab; @Inject - public PreferencesController(@PreferencesWindow Stage window, ObjectProperty selectedTabProperty, UpdateChecker updateChecker) { + public PreferencesController(Environment env, @PreferencesWindow Stage window, ObjectProperty selectedTabProperty, UpdateChecker updateChecker) { + this.env = env; this.window = window; this.selectedTabProperty = selectedTabProperty; this.updateAvailable = updateChecker.latestVersionProperty().isNotNull(); @@ -42,6 +45,9 @@ public class PreferencesController implements FxController { window.setOnShowing(this::windowWillAppear); selectedTabProperty.addListener(observable -> this.selectChosenTab()); tabPane.getSelectionModel().selectedItemProperty().addListener(observable -> this.selectedTabChanged()); + if (env.disableUpdateCheck()) { + tabPane.getTabs().remove(updatesTab); + } } private void selectChosenTab() { From 47bd0ca64738e6b218b4ba81af4be788d252b11d Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 18 Sep 2023 13:10:19 +0200 Subject: [PATCH 11/23] disable update check for PPA builds --- .github/workflows/debian.yml | 3 ++- dist/linux/debian/rules | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 14cdca80a..2ae6c3262 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -97,7 +97,8 @@ jobs: run: | cp -r dist/linux/debian/ pkgdir export RFC2822_TIMESTAMP=`date --rfc-2822` - envsubst '${SEMVER_STR} ${VERSION_NUM} ${REVISION_NUM}' < dist/linux/debian/rules > pkgdir/debian/rules + export DISABLE_UPDATE_CHECK=${{ inputs.dput }} + envsubst '${SEMVER_STR} ${VERSION_NUM} ${REVISION_NUM} ${DISABLE_UPDATE_CHECK}' < dist/linux/debian/rules > pkgdir/debian/rules envsubst '${PPA_VERSION} ${RFC2822_TIMESTAMP}' < dist/linux/debian/changelog > pkgdir/debian/changelog find . -name "*.jar" >> pkgdir/debian/source/include-binaries mv pkgdir cryptomator_${{ inputs.ppaver }} diff --git a/dist/linux/debian/rules b/dist/linux/debian/rules index 231f2a1d5..c12879025 100755 --- a/dist/linux/debian/rules +++ b/dist/linux/debian/rules @@ -59,6 +59,7 @@ override_dh_auto_build: --java-options "-Dcryptomator.integrationsLinux.trayIconsDir=\"/usr/share/icons/hicolor/symbolic/apps\"" \ --java-options "-Dcryptomator.buildNumber=\"deb-${REVISION_NUM}\"" \ --java-options "-Dcryptomator.appVersion=\"${SEMVER_STR}\"" \ + --java-options "-Dcryptomator.disableUpdateCheck=\"${DISABLE_UPDATE_CHECK}\"" \ --app-version "${VERSION_NUM}.${REVISION_NUM}" \ --resource-dir resources \ --verbose From 1657cd50fc89922f64c69939a4a82d5693fbb470 Mon Sep 17 00:00:00 2001 From: Tobias Hagemann Date: Tue, 19 Sep 2023 12:12:27 +0200 Subject: [PATCH 12/23] fixes #3112 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 311fcaf58..9034aba9d 100644 --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,7 @@ 1.3.0 1.2.2 1.2.1 - 1.3.0-beta6 + 1.3.0 3.0.0 2.0.0 2.0.4 From 5554dfdd89767552d3e718d8663ae0c0c9827fa8 Mon Sep 17 00:00:00 2001 From: Tobias Hagemann Date: Tue, 19 Sep 2023 12:22:24 +0200 Subject: [PATCH 13/23] fixes #3121 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9034aba9d..0edfaa862 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ 2.6.7 1.3.0 1.2.2 - 1.2.1 + 1.2.2 1.3.0 3.0.0 2.0.0 From d6a7efcb7f0b98aeddfc6b263a999437685057af Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 19 Sep 2023 14:00:45 +0200 Subject: [PATCH 14/23] added OS_NAME, OS_VERSION and OS_ARCH to user-agent --- .../org/cryptomator/ui/error/ErrorController.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/error/ErrorController.java b/src/main/java/org/cryptomator/ui/error/ErrorController.java index 5009229b5..0ca8c9dcd 100644 --- a/src/main/java/org/cryptomator/ui/error/ErrorController.java +++ b/src/main/java/org/cryptomator/ui/error/ErrorController.java @@ -2,6 +2,7 @@ package org.cryptomator.ui.error; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.commons.lang3.SystemUtils; import org.cryptomator.common.Environment; import org.cryptomator.common.ErrorCode; import org.cryptomator.common.Nullable; @@ -42,7 +43,7 @@ public class ErrorController implements FxController { private static final ObjectMapper JSON = new ObjectMapper(); private static final Logger LOG = LoggerFactory.getLogger(ErrorController.class); - private static final String USER_AGENT_VERSION_FORMAT = "Cryptomator/%s (Build %s)"; + private static final String USER_AGENT_VERSION_FORMAT = "Cryptomator/%s (Build %s) %s %s (%s)"; private static final String ERROR_CODES_URL_FORMAT = "https://api.cryptomator.org/desktop/error-codes.json?error-code=%s"; private static final String SEARCH_URL_FORMAT = "https://github.com/cryptomator/cryptomator/discussions/categories/errors?discussions_q=category:Errors+%s"; private static final String REPORT_URL_FORMAT = "https://github.com/cryptomator/cryptomator/discussions/new?category=Errors&title=Error+%s&body=%s"; @@ -143,11 +144,17 @@ public class ErrorController implements FxController { @FXML public void lookUpSolution() { + String userAgent = USER_AGENT_VERSION_FORMAT.formatted( // + environment.getAppVersion(), // + environment.getBuildNumber().orElse("undefined"), // + SystemUtils.OS_NAME, // + SystemUtils.OS_VERSION, // + SystemUtils.OS_ARCH); // isLoadingHttpResponse.set(true); askedForLookupDatabasePermission.set(true); HttpClient httpClient = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build(); HttpRequest httpRequest = HttpRequest.newBuilder()// - .header("User-Agent", USER_AGENT_VERSION_FORMAT.formatted(environment.getAppVersion(),environment.getBuildNumber().orElse("undefined"))) + .header("User-Agent", userAgent) .uri(URI.create(ERROR_CODES_URL_FORMAT.formatted(URLEncoder.encode(errorCode.toString(),StandardCharsets.UTF_8))))// .build(); httpClient.sendAsync(httpRequest, HttpResponse.BodyHandlers.ofInputStream())// From c40ad58028df8cc2d438858fa4b77a13ed5990d9 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 19 Sep 2023 15:03:22 +0200 Subject: [PATCH 15/23] detached context menu from button to fix misbehavior --- .../ui/mainwindow/VaultListController.java | 12 +++++-- src/main/resources/fxml/vault_list.fxml | 32 +++++++++---------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java b/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java index 357222b33..889ac290c 100644 --- a/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java +++ b/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java @@ -22,7 +22,9 @@ import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; import javafx.event.Event; import javafx.fxml.FXML; +import javafx.geometry.Side; import javafx.scene.control.Button; +import javafx.scene.control.ContextMenu; import javafx.scene.control.ListView; import javafx.scene.input.ContextMenuEvent; import javafx.scene.input.DragEvent; @@ -67,6 +69,8 @@ public class VaultListController implements FxController { public ListView vaultList; public StackPane root; public Button addVaultBtn; + @FXML + private ContextMenu addVaultContextMenu; @Inject VaultListController(@MainWindow Stage mainWindow, // @@ -146,9 +150,11 @@ public class VaultListController implements FxController { @FXML private void showMenu() { - double screenX = addVaultBtn.localToScreen(addVaultBtn.getBoundsInLocal()).getMinX(); - double screenY = addVaultBtn.localToScreen(addVaultBtn.getBoundsInLocal()).getMaxY(); - addVaultBtn.getContextMenu().show(addVaultBtn, screenX, screenY); + if (addVaultContextMenu.isShowing()) { + addVaultContextMenu.hide(); + } else { + addVaultContextMenu.show(addVaultBtn, Side.BOTTOM, 0.0, 0.0); + } } private void deselect(MouseEvent released) { diff --git a/src/main/resources/fxml/vault_list.fxml b/src/main/resources/fxml/vault_list.fxml index 146fa877c..cfa3750a7 100644 --- a/src/main/resources/fxml/vault_list.fxml +++ b/src/main/resources/fxml/vault_list.fxml @@ -32,23 +32,23 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + From 113717f955dc83b13e0ddba5f069abfbb0fa0456 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 19 Sep 2023 15:12:40 +0200 Subject: [PATCH 16/23] addVaultButton context menu event filter removed --- .../java/org/cryptomator/ui/mainwindow/VaultListController.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java b/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java index 889ac290c..afdb0bb36 100644 --- a/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java +++ b/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java @@ -144,8 +144,6 @@ public class VaultListController implements FxController { root.setOnDragOver(this::handleDragEvent); root.setOnDragDropped(this::handleDragEvent); root.setOnDragExited(this::handleDragEvent); - - addVaultBtn.addEventFilter(ContextMenuEvent.CONTEXT_MENU_REQUESTED, Event::consume); } @FXML From 76a4062f8b21ab637dad2de91541ec1301dfad9d Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 19 Sep 2023 15:12:45 +0200 Subject: [PATCH 17/23] update org.cryptomator.integrations:integrations-win from 1.2.2 to 1.2.3 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0edfaa862..796e73541 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ 2.6.7 1.3.0 - 1.2.2 + 1.2.3 1.2.2 1.3.0 3.0.0 From 9b2987d0a24e5ea0aedd42aa62c013ff0d4a2b11 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 19 Sep 2023 16:26:55 +0200 Subject: [PATCH 18/23] improved function naming --- .../org/cryptomator/ui/mainwindow/VaultListController.java | 3 +-- src/main/resources/fxml/vault_list.fxml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java b/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java index afdb0bb36..8f0a91d58 100644 --- a/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java +++ b/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java @@ -20,7 +20,6 @@ import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.value.ObservableValue; import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; -import javafx.event.Event; import javafx.fxml.FXML; import javafx.geometry.Side; import javafx.scene.control.Button; @@ -147,7 +146,7 @@ public class VaultListController implements FxController { } @FXML - private void showMenu() { + private void toggleMenu() { if (addVaultContextMenu.isShowing()) { addVaultContextMenu.hide(); } else { diff --git a/src/main/resources/fxml/vault_list.fxml b/src/main/resources/fxml/vault_list.fxml index cfa3750a7..f9cb29258 100644 --- a/src/main/resources/fxml/vault_list.fxml +++ b/src/main/resources/fxml/vault_list.fxml @@ -28,7 +28,7 @@ -