From bca20a7a6631df2a8e73f28a805b184eab9fdb6f Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 27 Feb 2024 18:55:14 +0100 Subject: [PATCH 01/82] [ci skip] seperate av whitelisting into own workflow to be able to upload assets on failure --- .github/workflows/av-whitelist.yml | 40 ++++++++++++++++++++ .github/workflows/win-exe.yml | 59 ++++++++++-------------------- 2 files changed, 60 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/av-whitelist.yml diff --git a/.github/workflows/av-whitelist.yml b/.github/workflows/av-whitelist.yml new file mode 100644 index 000000000..102f1bee0 --- /dev/null +++ b/.github/workflows/av-whitelist.yml @@ -0,0 +1,40 @@ +name: AntiVirus Whitelisting + +on: + workflow_call: + inputs: + url: + description: "Url to the file to upload" + required: true + type: string + workflow_dispatch: + inputs: + url: + description: "Url to the file to upload" + required: true + type: string + +jobs: + allowlist: + name: Anti Virus Allowlisting + runs-on: ubuntu-latest + steps: + - name: Download file + run: | + curl --remote-name ${{ inputs.url }} -L + - name: Upload to Kaspersky + uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + with: + protocol: ftps + server: allowlist.kaspersky-labs.com + port: 990 + username: ${{ secrets.ALLOWLIST_KASPERSKY_USERNAME }} + password: ${{ secrets.ALLOWLIST_KASPERSKY_PASSWORD }} + - name: Upload to Avast + uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + with: + protocol: ftp + server: whitelisting.avast.com + port: 21 + username: ${{ secrets.ALLOWLIST_AVAST_USERNAME }} + password: ${{ secrets.ALLOWLIST_AVAST_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index d3720c76b..cca158468 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -39,6 +39,8 @@ jobs: env: LOOPBACK_ALIAS: 'cryptomator-vault' WIN_CONSOLE_FLAG: '' + outputs: + download-url: ${{ fromJSON(steps.publish.outputs.assets)[0].browser_download_url }} #ónly set on a release steps: - uses: actions/checkout@v4 - name: Setup Java @@ -255,19 +257,29 @@ jobs: Cryptomator-*.asc if-no-files-found: error - name: Publish .msi on GitHub Releases + id: publish if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published' uses: softprops/action-gh-release@v1 with: fail_on_unmatched_files: true token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} + # do not change ordering of filelist, required for correct job output files: | *.msi *.asc + allowlist-msi: + uses: ./.github/workflows/av-whitelist.yml + needs: [build-msi] + with: + url: ${{ needs.build-msi.outputs.download-url }} + build-exe: name: Build .exe installer runs-on: windows-latest needs: [get-version, build-msi] + outputs: + download-url: ${{ fromJSON(steps.publish.outputs.assets)[0].browser_download_url }} #ónly set on a release steps: - uses: actions/checkout@v4 - name: Download .msi @@ -366,54 +378,23 @@ jobs: Cryptomator-*.asc if-no-files-found: error - name: Publish .msi on GitHub Releases + id: publish if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published' uses: softprops/action-gh-release@v1 with: fail_on_unmatched_files: true token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} + # do not change ordering of filelist, required for correct job output files: | Cryptomator-*.exe Cryptomator-*.asc - allowlist: - name: Anti Virus Allowlisting - if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published' - runs-on: ubuntu-latest - needs: [build-msi, build-exe] - steps: - - name: Download .msi - uses: actions/download-artifact@v4 - with: - name: msi - path: msi - - name: Download .exe - uses: actions/download-artifact@v4 - with: - name: exe - path: exe - - name: Collect files - run: | - mkdir files - cp msi/*.msi files - cp exe/*.exe files - - name: Upload to Kaspersky - uses: SamKirkland/FTP-Deploy-Action@v4.3.4 - with: - protocol: ftps - server: allowlist.kaspersky-labs.com - port: 990 - username: ${{ secrets.ALLOWLIST_KASPERSKY_USERNAME }} - password: ${{ secrets.ALLOWLIST_KASPERSKY_PASSWORD }} - local-dir: files/ - - name: Upload to Avast - uses: SamKirkland/FTP-Deploy-Action@v4.3.4 - with: - protocol: ftp - server: whitelisting.avast.com - port: 21 - username: ${{ secrets.ALLOWLIST_AVAST_USERNAME }} - password: ${{ secrets.ALLOWLIST_AVAST_PASSWORD }} - local-dir: files/ + allowlist-exe: + uses: ./.github/workflows/av-whitelist.yml + needs: [build-exe] + with: + url: ${{ needs.build-exe.outputs.download-url }} + notify-winget: name: Notify for winget-release if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published' && needs.get-version.outputs.versionType == 'stable' From feed72a7297fade83ab0a7f15b480bcf262b72d0 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 27 Feb 2024 22:52:56 +0100 Subject: [PATCH 02/82] [ci skip] fix flathub workflow --- .github/workflows/flathub.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flathub.yml b/.github/workflows/flathub.yml index 1edbc94d8..23a1135a0 100644 --- a/.github/workflows/flathub.yml +++ b/.github/workflows/flathub.yml @@ -56,7 +56,7 @@ jobs: - name: Update build file run: | sed -i -e 's/VERSION: [0-9]\+\.[0-9]\+\.[0-9]\+.*/VERSION: ${{ needs.get-version.outputs.semVerStr }}/g' org.cryptomator.Cryptomator.yaml - sed -i -e 's/sha512: [0-9A-Za-z_-\+]\{128\} #CRYPTOMATOR/sha512: ${{ needs.tarball.outputs.sha512 }} #CRYPTOMATOR/g' org.cryptomator.Cryptomator.yaml + sed -i -e 's/sha512: [0-9A-Za-z_\+-]\{128\} #CRYPTOMATOR/sha512: ${{ needs.tarball.outputs.sha512 }} #CRYPTOMATOR/g' org.cryptomator.Cryptomator.yaml sed -i -e 's;url: https://github.com/cryptomator/cryptomator/archive/refs/tags/[^[:blank:]]\+;url: ${{ needs.tarball.outputs.url }};g' org.cryptomator.Cryptomator.yaml - name: Commit and push run: | From 414465371ba8396304aba8550c142d57ead95b61 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 28 Feb 2024 13:19:54 +0100 Subject: [PATCH 03/82] [ci skip] refactor win-exe workflow * only publish, if msi and exe succeed * make stable release jobs dependent of publish --- .github/workflows/win-exe.yml | 55 +++++++++++++++++------------------ 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index cca158468..7dcaaa0ee 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -39,8 +39,6 @@ jobs: env: LOOPBACK_ALIAS: 'cryptomator-vault' WIN_CONSOLE_FLAG: '' - outputs: - download-url: ${{ fromJSON(steps.publish.outputs.assets)[0].browser_download_url }} #ónly set on a release steps: - uses: actions/checkout@v4 - name: Setup Java @@ -256,30 +254,11 @@ jobs: Cryptomator-*.msi Cryptomator-*.asc if-no-files-found: error - - name: Publish .msi on GitHub Releases - id: publish - if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published' - uses: softprops/action-gh-release@v1 - with: - fail_on_unmatched_files: true - token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} - # do not change ordering of filelist, required for correct job output - files: | - *.msi - *.asc - - allowlist-msi: - uses: ./.github/workflows/av-whitelist.yml - needs: [build-msi] - with: - url: ${{ needs.build-msi.outputs.download-url }} build-exe: name: Build .exe installer runs-on: windows-latest needs: [get-version, build-msi] - outputs: - download-url: ${{ fromJSON(steps.publish.outputs.assets)[0].browser_download_url }} #ónly set on a release steps: - uses: actions/checkout@v4 - name: Download .msi @@ -377,28 +356,48 @@ jobs: Cryptomator-*.exe Cryptomator-*.asc if-no-files-found: error + + publish: + name: Publish installers to the github release + if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published' + runs-on: ubuntu-latest + needs: [build-msi, build-exe] + outputs: + download-url-msi: ${{ fromJSON(steps.publish.outputs.assets)[0].browser_download_url }} + download-url-exe: ${{ fromJSON(steps.publish.outputs.assets)[1].browser_download_url }} + steps: + - name: Download installers + uses: actions/download-artifact@v4 + with: + merge-multiple: true - name: Publish .msi on GitHub Releases id: publish - if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published' uses: softprops/action-gh-release@v1 with: fail_on_unmatched_files: true token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} # do not change ordering of filelist, required for correct job output files: | - Cryptomator-*.exe - Cryptomator-*.asc + *.msi + *.exe + *.asc + + allowlist-msi: + uses: ./.github/workflows/av-whitelist.yml + needs: [publish] + with: + url: ${{ needs.publish.outputs.download-url-msi }} allowlist-exe: uses: ./.github/workflows/av-whitelist.yml - needs: [build-exe] + needs: [publish] with: - url: ${{ needs.build-exe.outputs.download-url }} + url: ${{ needs.publish.outputs.download-url-exe }} notify-winget: name: Notify for winget-release - if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published' && needs.get-version.outputs.versionType == 'stable' - needs: [build-msi, get-version] + if: needs.get-version.outputs.versionType == 'stable' + needs: [publish, get-version] runs-on: ubuntu-latest steps: - name: Slack Notification From ef3affece310d06def2099ba2e6ba81fa31dd990 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 28 Feb 2024 13:42:37 +0100 Subject: [PATCH 04/82] [ci skip] fix wrong PR description in flathub workflow --- .github/workflows/flathub.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flathub.yml b/.github/workflows/flathub.yml index 23a1135a0..da8f6c77f 100644 --- a/.github/workflows/flathub.yml +++ b/.github/workflows/flathub.yml @@ -68,7 +68,7 @@ jobs: git push - name: Create pull request run: | - echo "> [!IMPORTANT]\n> Todos:\n> - [ ] Update maven dependencies\n> - [ ] Check for JDK update\n> - [ ] Check for JFX update" > pr_body.md + printf "> [!IMPORTANT]\n> Todos:\n> - [ ] Update maven dependencies\n> - [ ] Check for JDK update\n> - [ ] Check for JFX update" > pr_body.md PR_URL=$(gh pr create --title "Release ${{ needs.get-version.outputs.semVerStr }}" --body-file pr_body.md) echo "FLATHUB_PR_URL=$PR_URL" >> "$GITHUB_ENV" env: From 4064b61cd7a72aea50cbb769bfcfbde24d00f723 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Thu, 29 Feb 2024 09:29:26 +0100 Subject: [PATCH 05/82] refactored updateChecker by incorporating state management and date tracking --- .../cryptomator/ui/fxapp/UpdateChecker.java | 49 ++++++++++++------- .../ui/fxapp/UpdateCheckerModule.java | 9 ---- .../UpdatesPreferencesController.java | 46 ++++++++++++++++- .../resources/fxml/preferences_updates.fxml | 27 +++++----- src/main/resources/i18n/strings.properties | 7 +++ 5 files changed, 96 insertions(+), 42 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java index 709eb2fe7..f3ef0e5a9 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java +++ b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java @@ -2,44 +2,50 @@ package org.cryptomator.ui.fxapp; import org.cryptomator.common.Environment; import org.cryptomator.common.settings.Settings; +import org.cryptomator.ui.health.Check; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.inject.Inject; import javax.inject.Named; import javafx.beans.binding.BooleanBinding; +import javafx.beans.property.ObjectProperty; import javafx.beans.property.ReadOnlyStringProperty; +import javafx.beans.property.SimpleObjectProperty; +import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.concurrent.ScheduledService; import javafx.concurrent.Worker; import javafx.concurrent.WorkerStateEvent; import javafx.util.Duration; +import java.time.LocalDateTime; import java.util.Comparator; @FxApplicationScoped public class UpdateChecker { private static final Logger LOG = LoggerFactory.getLogger(UpdateChecker.class); - private static final Duration AUTOCHECK_DELAY = Duration.seconds(5); + private static final Duration AUTO_CHECK_DELAY = Duration.seconds(5); private final Environment env; private final Settings settings; - private final StringProperty latestVersionProperty; - private final Comparator semVerComparator; + private final StringProperty latestVersionProperty = new SimpleStringProperty(); private final ScheduledService updateCheckerService; + private final ObjectProperty state = new SimpleObjectProperty<>(UpdateCheckState.NOT_CHECKED); + private final ObjectProperty updateCheckTimeProperty = new SimpleObjectProperty<>(); @Inject - UpdateChecker(Settings settings, Environment env, @Named("latestVersion") StringProperty latestVersionProperty, @Named("SemVer") Comparator semVerComparator, ScheduledService updateCheckerService) { + UpdateChecker(Settings settings, // + Environment env, // + ScheduledService updateCheckerService) { this.env = env; this.settings = settings; - this.latestVersionProperty = latestVersionProperty; - this.semVerComparator = semVerComparator; this.updateCheckerService = updateCheckerService; } public void automaticallyCheckForUpdatesIfEnabled() { if (!env.disableUpdateCheck() && settings.checkForUpdates.get()) { - startCheckingForUpdates(AUTOCHECK_DELAY); + startCheckingForUpdates(AUTO_CHECK_DELAY); } } @@ -59,26 +65,30 @@ public class UpdateChecker { private void checkStarted(WorkerStateEvent event) { LOG.debug("Checking for updates..."); + state.set(UpdateCheckState.IS_CHECKING); } private void checkSucceeded(WorkerStateEvent event) { String latestVersion = updateCheckerService.getValue(); - LOG.info("Current version: {}, lastest version: {}", getCurrentVersion(), latestVersion); - - if (semVerComparator.compare(getCurrentVersion(), latestVersion) < 0) { - // update is available - latestVersionProperty.set(latestVersion); - } else { - latestVersionProperty.set(null); - } + LOG.info("Current version: {}, latest version: {}", getCurrentVersion(), latestVersion); + state.set(UpdateCheckState.CHECK_SUCCESSFUL); + updateCheckTimeProperty.set(LocalDateTime.now()); + latestVersionProperty.set(latestVersion); } private void checkFailed(WorkerStateEvent event) { LOG.warn("Error checking for updates", event.getSource().getException()); + state.set(UpdateCheckState.CHECK_FAILED); + } + + public enum UpdateCheckState { + NOT_CHECKED, + IS_CHECKING, + CHECK_SUCCESSFUL, + CHECK_FAILED; } /* Observable Properties */ - public BooleanBinding checkingForUpdatesProperty() { return updateCheckerService.stateProperty().isEqualTo(Worker.State.RUNNING); } @@ -88,7 +98,12 @@ public class UpdateChecker { } public String getCurrentVersion() { - return env.getAppVersion(); + return "1.12.3"; //env.getAppVersion(); } + public ObjectProperty updateCheckTimeProperty() { + return updateCheckTimeProperty; + } +public ObjectProperty updateCheckStateProperty() { return state;} + } diff --git a/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java b/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java index b5f06d7e5..585180662 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java +++ b/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java @@ -11,8 +11,6 @@ import org.slf4j.LoggerFactory; import javax.inject.Named; import javafx.beans.binding.Bindings; import javafx.beans.binding.ObjectBinding; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; import javafx.concurrent.ScheduledService; import javafx.concurrent.Task; import javafx.util.Duration; @@ -32,13 +30,6 @@ public abstract class UpdateCheckerModule { private static final Duration UPDATE_CHECK_INTERVAL = Duration.hours(3); private static final Duration DISABLED_UPDATE_CHECK_INTERVAL = Duration.hours(100000); // Duration.INDEFINITE leads to overflows... - @Provides - @Named("latestVersion") - @FxApplicationScoped - static StringProperty provideLatestVersion() { - return new SimpleStringProperty(); - } - @Provides @FxApplicationScoped static Optional provideHttpClient() { diff --git a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java index 630b82776..93c58f9c0 100644 --- a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java @@ -1,7 +1,9 @@ package org.cryptomator.ui.preferences; +import org.cryptomator.common.SemVerComparator; import org.cryptomator.common.settings.Settings; import org.cryptomator.ui.common.FxController; +import org.cryptomator.ui.controls.FormattedLabel; import org.cryptomator.ui.fxapp.UpdateChecker; import javax.inject.Inject; @@ -9,11 +11,19 @@ import javafx.application.Application; import javafx.beans.binding.Bindings; import javafx.beans.binding.BooleanBinding; import javafx.beans.binding.ObjectBinding; +import javafx.beans.property.ObjectProperty; import javafx.beans.property.ReadOnlyStringProperty; import javafx.fxml.FXML; import javafx.scene.control.CheckBox; import javafx.scene.control.ContentDisplay; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; +import java.util.Comparator; +import java.util.Locale; +import java.util.ResourceBundle; + @PreferencesScoped public class UpdatesPreferencesController implements FxController { @@ -21,28 +31,60 @@ public class UpdatesPreferencesController implements FxController { private final Application application; private final Settings settings; + private final ResourceBundle resourceBundle; private final UpdateChecker updateChecker; private final ObjectBinding checkForUpdatesButtonState; private final ReadOnlyStringProperty latestVersion; private final String currentVersion; private final BooleanBinding updateAvailable; + private final ObjectProperty updateCheckDateProperty; + private final Comparator versionComparator = new SemVerComparator(); + private final ObjectProperty updateCheckStateProperty; /* FXML */ public CheckBox checkForUpdatesCheckbox; + public FormattedLabel updateCheckDateFormattedLabel; + public FormattedLabel statusFormattedLabel; @Inject - UpdatesPreferencesController(Application application, Settings settings, UpdateChecker updateChecker) { + UpdatesPreferencesController(Application application, Settings settings, ResourceBundle resourceBundle, UpdateChecker updateChecker) { this.application = application; this.settings = settings; + this.resourceBundle = resourceBundle; this.updateChecker = updateChecker; this.checkForUpdatesButtonState = Bindings.when(updateChecker.checkingForUpdatesProperty()).then(ContentDisplay.LEFT).otherwise(ContentDisplay.TEXT_ONLY); this.latestVersion = updateChecker.latestVersionProperty(); - this.updateAvailable = latestVersion.isNotNull(); this.currentVersion = updateChecker.getCurrentVersion(); + this.updateAvailable = Bindings.createBooleanBinding(() -> { + if (latestVersion.get() != null) { + return versionComparator.compare(currentVersion, latestVersion.get()) < 0; + } else { + return false; + } + }, latestVersion); + this.updateCheckDateProperty = updateChecker.updateCheckTimeProperty(); + this.updateCheckStateProperty = updateChecker.updateCheckStateProperty(); } public void initialize() { checkForUpdatesCheckbox.selectedProperty().bindBidirectional(settings.checkForUpdates); + + DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(Locale.getDefault()); + updateCheckDateFormattedLabel.arg1Property().bind(Bindings.createStringBinding(() -> { + return (updateCheckDateProperty.get() != null) ? updateCheckDateProperty.get().format(formatter) : ""; + }, updateCheckDateProperty)); + updateCheckDateFormattedLabel.managedProperty().bind(updateCheckDateProperty.isNotNull()); + updateCheckDateFormattedLabel.visibleProperty().bind(updateCheckDateProperty.isNotNull()); + + statusFormattedLabel.arg1Property().bind(Bindings.createObjectBinding(() ->{ + return switch (updateCheckStateProperty.get()) { + case NOT_CHECKED -> resourceBundle.getString("preferences.updates.status.notChecked"); + case IS_CHECKING -> resourceBundle.getString("preferences.updates.status.isChecking"); + case CHECK_SUCCESSFUL -> resourceBundle.getString("preferences.updates.status.checkSuccessful"); + case CHECK_FAILED -> resourceBundle.getString("preferences.updates.status.checkFailed"); + }; + }, updateCheckStateProperty + )); } @FXML diff --git a/src/main/resources/fxml/preferences_updates.fxml b/src/main/resources/fxml/preferences_updates.fxml index 3156d1c3c..6efb3700b 100644 --- a/src/main/resources/fxml/preferences_updates.fxml +++ b/src/main/resources/fxml/preferences_updates.fxml @@ -8,6 +8,7 @@ + - - + + - - - - - - - - + + + + + + diff --git a/src/main/resources/i18n/strings.properties b/src/main/resources/i18n/strings.properties index 1585448e5..b449c2224 100644 --- a/src/main/resources/i18n/strings.properties +++ b/src/main/resources/i18n/strings.properties @@ -321,6 +321,13 @@ preferences.updates.currentVersion=Current Version: %s preferences.updates.autoUpdateCheck=Check for updates automatically preferences.updates.checkNowBtn=Check Now preferences.updates.updateAvailable=Update to version %s available. +preferences.updates.lastUpdateCheck=The last update check was performed on: %s. +preferences.updates.status=Status: %s +preferences.updates.status.notChecked=Not checked +preferences.updates.status.isChecking=Is checking +preferences.updates.status.checkSuccessful=Check successful +preferences.updates.status.checkFailed=Check failed + ## Contribution preferences.contribute=Support Us preferences.contribute.registeredFor=Supporter certificate registered for %s From 8064d75102c100174254f292f991023ac56ee6cf Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 5 Mar 2024 10:15:11 +0100 Subject: [PATCH 06/82] removed state label and reorganized ui elements --- .../cryptomator/ui/fxapp/UpdateChecker.java | 10 ++--- .../UpdatesPreferencesController.java | 38 +++++++++---------- .../resources/fxml/preferences_updates.fxml | 20 ++++++++-- src/main/resources/i18n/strings.properties | 9 ++--- 4 files changed, 42 insertions(+), 35 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java index f3ef0e5a9..a29a06e59 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java +++ b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java @@ -2,12 +2,10 @@ package org.cryptomator.ui.fxapp; import org.cryptomator.common.Environment; import org.cryptomator.common.settings.Settings; -import org.cryptomator.ui.health.Check; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.inject.Inject; -import javax.inject.Named; import javafx.beans.binding.BooleanBinding; import javafx.beans.property.ObjectProperty; import javafx.beans.property.ReadOnlyStringProperty; @@ -19,7 +17,6 @@ import javafx.concurrent.Worker; import javafx.concurrent.WorkerStateEvent; import javafx.util.Duration; import java.time.LocalDateTime; -import java.util.Comparator; @FxApplicationScoped public class UpdateChecker { @@ -98,12 +95,15 @@ public class UpdateChecker { } public String getCurrentVersion() { - return "1.12.3"; //env.getAppVersion(); + return env.getAppVersion(); } public ObjectProperty updateCheckTimeProperty() { return updateCheckTimeProperty; } -public ObjectProperty updateCheckStateProperty() { return state;} + + public ObjectProperty updateCheckStateProperty() { + return state; + } } diff --git a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java index 93c58f9c0..fb5fd964c 100644 --- a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java @@ -1,5 +1,6 @@ package org.cryptomator.ui.preferences; +import org.cryptomator.common.Environment; import org.cryptomator.common.SemVerComparator; import org.cryptomator.common.settings.Settings; import org.cryptomator.ui.common.FxController; @@ -16,13 +17,12 @@ import javafx.beans.property.ReadOnlyStringProperty; import javafx.fxml.FXML; import javafx.scene.control.CheckBox; import javafx.scene.control.ContentDisplay; - +import javafx.scene.layout.HBox; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.time.format.FormatStyle; import java.util.Comparator; import java.util.Locale; -import java.util.ResourceBundle; @PreferencesScoped public class UpdatesPreferencesController implements FxController { @@ -30,8 +30,8 @@ public class UpdatesPreferencesController implements FxController { private static final String DOWNLOADS_URI = "https://cryptomator.org/downloads"; private final Application application; + private final Environment environment; private final Settings settings; - private final ResourceBundle resourceBundle; private final UpdateChecker updateChecker; private final ObjectBinding checkForUpdatesButtonState; private final ReadOnlyStringProperty latestVersion; @@ -44,13 +44,14 @@ public class UpdatesPreferencesController implements FxController { /* FXML */ public CheckBox checkForUpdatesCheckbox; public FormattedLabel updateCheckDateFormattedLabel; - public FormattedLabel statusFormattedLabel; + public HBox checkFailedHBox; + public FormattedLabel latestVersionFormattedLabel; @Inject - UpdatesPreferencesController(Application application, Settings settings, ResourceBundle resourceBundle, UpdateChecker updateChecker) { + UpdatesPreferencesController(Application application, Environment environment, Settings settings, UpdateChecker updateChecker) { this.application = application; + this.environment = environment; this.settings = settings; - this.resourceBundle = resourceBundle; this.updateChecker = updateChecker; this.checkForUpdatesButtonState = Bindings.when(updateChecker.checkingForUpdatesProperty()).then(ContentDisplay.LEFT).otherwise(ContentDisplay.TEXT_ONLY); this.latestVersion = updateChecker.latestVersionProperty(); @@ -70,21 +71,13 @@ public class UpdatesPreferencesController implements FxController { checkForUpdatesCheckbox.selectedProperty().bindBidirectional(settings.checkForUpdates); DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(Locale.getDefault()); - updateCheckDateFormattedLabel.arg1Property().bind(Bindings.createStringBinding(() -> { - return (updateCheckDateProperty.get() != null) ? updateCheckDateProperty.get().format(formatter) : ""; - }, updateCheckDateProperty)); - updateCheckDateFormattedLabel.managedProperty().bind(updateCheckDateProperty.isNotNull()); - updateCheckDateFormattedLabel.visibleProperty().bind(updateCheckDateProperty.isNotNull()); + updateCheckDateFormattedLabel.arg1Property().bind(Bindings.createStringBinding(() -> (updateCheckDateProperty.get() != null) ? updateCheckDateProperty.get().format(formatter) : "-", updateCheckDateProperty)); + + checkFailedHBox.managedProperty().bind(updateCheckStateProperty.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_FAILED)); + checkFailedHBox.visibleProperty().bind(updateCheckStateProperty.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_FAILED)); + + latestVersionFormattedLabel.arg1Property().bind(Bindings.createStringBinding(() -> (latestVersion.get() != null) ? latestVersion.get() : "-", latestVersion)); - statusFormattedLabel.arg1Property().bind(Bindings.createObjectBinding(() ->{ - return switch (updateCheckStateProperty.get()) { - case NOT_CHECKED -> resourceBundle.getString("preferences.updates.status.notChecked"); - case IS_CHECKING -> resourceBundle.getString("preferences.updates.status.isChecking"); - case CHECK_SUCCESSFUL -> resourceBundle.getString("preferences.updates.status.checkSuccessful"); - case CHECK_FAILED -> resourceBundle.getString("preferences.updates.status.checkFailed"); - }; - }, updateCheckStateProperty - )); } @FXML @@ -97,6 +90,11 @@ public class UpdatesPreferencesController implements FxController { application.getHostServices().showDocument(DOWNLOADS_URI); } + @FXML + public void showLogfileDirectory() { + environment.getLogDir().ifPresent(logDirPath -> application.getHostServices().showDocument(logDirPath.toUri().toString())); + } + /* Observable Properties */ public ObjectBinding checkForUpdatesButtonStateProperty() { diff --git a/src/main/resources/fxml/preferences_updates.fxml b/src/main/resources/fxml/preferences_updates.fxml index 6efb3700b..ef037580f 100644 --- a/src/main/resources/fxml/preferences_updates.fxml +++ b/src/main/resources/fxml/preferences_updates.fxml @@ -1,14 +1,16 @@ + + + + - - + + + @@ -28,8 +33,15 @@ - - + + + + + diff --git a/src/main/resources/i18n/strings.properties b/src/main/resources/i18n/strings.properties index b449c2224..0a4c795a0 100644 --- a/src/main/resources/i18n/strings.properties +++ b/src/main/resources/i18n/strings.properties @@ -318,15 +318,12 @@ preferences.volume.feature.readOnly=Read-only mount ## Updates preferences.updates=Updates preferences.updates.currentVersion=Current Version: %s +preferences.updates.latestVersion=Latest Version: %s preferences.updates.autoUpdateCheck=Check for updates automatically preferences.updates.checkNowBtn=Check Now preferences.updates.updateAvailable=Update to version %s available. -preferences.updates.lastUpdateCheck=The last update check was performed on: %s. -preferences.updates.status=Status: %s -preferences.updates.status.notChecked=Not checked -preferences.updates.status.isChecking=Is checking -preferences.updates.status.checkSuccessful=Check successful -preferences.updates.status.checkFailed=Check failed +preferences.updates.lastUpdateCheck=The last update check was performed on: %s +preferences.updates.checkFailed=Check failed ## Contribution preferences.contribute=Support Us From b3789700e1b82fe54e8f56e8741cd85f4589919e Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 5 Mar 2024 12:56:38 +0100 Subject: [PATCH 07/82] add upToDateLabel and fix update indicator issue --- .../cryptomator/ui/fxapp/UpdateChecker.java | 2 +- .../mainwindow/MainWindowTitleController.java | 2 +- .../UpdatesPreferencesController.java | 27 +++++++++++++++++-- .../resources/fxml/preferences_updates.fxml | 5 ++++ src/main/resources/i18n/strings.properties | 1 + 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java index a29a06e59..e2e423f84 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java +++ b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java @@ -68,9 +68,9 @@ public class UpdateChecker { private void checkSucceeded(WorkerStateEvent event) { String latestVersion = updateCheckerService.getValue(); LOG.info("Current version: {}, latest version: {}", getCurrentVersion(), latestVersion); - state.set(UpdateCheckState.CHECK_SUCCESSFUL); updateCheckTimeProperty.set(LocalDateTime.now()); latestVersionProperty.set(latestVersion); + state.set(UpdateCheckState.CHECK_SUCCESSFUL); } private void checkFailed(WorkerStateEvent event) { diff --git a/src/main/java/org/cryptomator/ui/mainwindow/MainWindowTitleController.java b/src/main/java/org/cryptomator/ui/mainwindow/MainWindowTitleController.java index 479a2d860..2dcbd6095 100644 --- a/src/main/java/org/cryptomator/ui/mainwindow/MainWindowTitleController.java +++ b/src/main/java/org/cryptomator/ui/mainwindow/MainWindowTitleController.java @@ -46,7 +46,7 @@ public class MainWindowTitleController implements FxController { this.appWindows = appWindows; this.trayMenuInitialized = trayMenu.isInitialized(); this.updateChecker = updateChecker; - this.updateAvailable = updateChecker.latestVersionProperty().isNotNull(); + this.updateAvailable = updateChecker.updateCheckStateProperty().isEqualTo(UpdateChecker.UpdateCheckState.CHECK_SUCCESSFUL).and(updateChecker.latestVersionProperty().isNotEqualTo(updateChecker.getCurrentVersion())); this.licenseHolder = licenseHolder; this.settings = settings; this.showMinimizeButton = Bindings.createBooleanBinding(this::isShowMinimizeButton, settings.showMinimizeButton, settings.showTrayIcon); diff --git a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java index fb5fd964c..57ebc9706 100644 --- a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java @@ -8,6 +8,7 @@ import org.cryptomator.ui.controls.FormattedLabel; import org.cryptomator.ui.fxapp.UpdateChecker; import javax.inject.Inject; +import javafx.animation.PauseTransition; import javafx.application.Application; import javafx.beans.binding.Bindings; import javafx.beans.binding.BooleanBinding; @@ -17,13 +18,17 @@ import javafx.beans.property.ReadOnlyStringProperty; import javafx.fxml.FXML; import javafx.scene.control.CheckBox; import javafx.scene.control.ContentDisplay; +import javafx.scene.control.Label; import javafx.scene.layout.HBox; +import javafx.util.Duration; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.time.format.FormatStyle; import java.util.Comparator; import java.util.Locale; + + @PreferencesScoped public class UpdatesPreferencesController implements FxController { @@ -46,6 +51,7 @@ public class UpdatesPreferencesController implements FxController { public FormattedLabel updateCheckDateFormattedLabel; public HBox checkFailedHBox; public FormattedLabel latestVersionFormattedLabel; + public Label upToDateLabel; @Inject UpdatesPreferencesController(Application application, Environment environment, Settings settings, UpdateChecker updateChecker) { @@ -73,11 +79,28 @@ public class UpdatesPreferencesController implements FxController { DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(Locale.getDefault()); updateCheckDateFormattedLabel.arg1Property().bind(Bindings.createStringBinding(() -> (updateCheckDateProperty.get() != null) ? updateCheckDateProperty.get().format(formatter) : "-", updateCheckDateProperty)); - checkFailedHBox.managedProperty().bind(updateCheckStateProperty.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_FAILED)); - checkFailedHBox.visibleProperty().bind(updateCheckStateProperty.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_FAILED)); + BooleanBinding isUpdateCheckFailed = updateCheckStateProperty.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_FAILED); + checkFailedHBox.managedProperty().bind(isUpdateCheckFailed); + checkFailedHBox.visibleProperty().bind(isUpdateCheckFailed); latestVersionFormattedLabel.arg1Property().bind(Bindings.createStringBinding(() -> (latestVersion.get() != null) ? latestVersion.get() : "-", latestVersion)); + BooleanBinding isUpdateSuccessfulAndCurrent = updateCheckStateProperty.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_SUCCESSFUL) + .and(latestVersion.isEqualTo(currentVersion)); + + updateCheckStateProperty.addListener((_, _, _) -> { + if (isUpdateSuccessfulAndCurrent.get()) { + upToDateLabel.setVisible(true); + upToDateLabel.setManaged(true); + + PauseTransition delay = new PauseTransition(Duration.seconds(5)); + delay.setOnFinished(_ -> { + upToDateLabel.setVisible(false); + upToDateLabel.setManaged(false); + }); + delay.play(); + } + }); } @FXML diff --git a/src/main/resources/fxml/preferences_updates.fxml b/src/main/resources/fxml/preferences_updates.fxml index ef037580f..3db4824f5 100644 --- a/src/main/resources/fxml/preferences_updates.fxml +++ b/src/main/resources/fxml/preferences_updates.fxml @@ -42,6 +42,11 @@ + diff --git a/src/main/resources/i18n/strings.properties b/src/main/resources/i18n/strings.properties index 0a4c795a0..96b49d119 100644 --- a/src/main/resources/i18n/strings.properties +++ b/src/main/resources/i18n/strings.properties @@ -324,6 +324,7 @@ preferences.updates.checkNowBtn=Check Now preferences.updates.updateAvailable=Update to version %s available. preferences.updates.lastUpdateCheck=The last update check was performed on: %s preferences.updates.checkFailed=Check failed +preferences.updates.upToDate=Cryptomator is up-to-date. ## Contribution preferences.contribute=Support Us From dd4f87b54c9ed61492e4bd3bb7373b5a00f246ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 17:21:09 +0000 Subject: [PATCH 08/82] Bump the java-production-dependencies group with 4 updates (#3359) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a39bdd080..d6d08e5bf 100644 --- a/pom.xml +++ b/pom.xml @@ -44,14 +44,14 @@ 3.14.0 - 2.50 + 2.51 2.2 33.0.0-jre 2.16.1 21.0.1 4.4.0 9.37.3 - 1.5.0 + 1.5.2 2.0.12 0.8.0 1.8.2 From f783f5d5ec5d62f5332e60dbc5eb06d182433498 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 17:21:45 +0000 Subject: [PATCH 09/82] Bump the java-test-dependencies group with 1 update (#3358) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d6d08e5bf..0ddf03d29 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ 5.10.2 - 5.10.0 + 5.11.0 2.2 From c719982ef3d14cbb715abfde84a40d1b8bba3dfa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 17:24:28 +0000 Subject: [PATCH 10/82] Bump the github-actions group with 1 update (#3354) --- .github/workflows/get-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml index cbb463824..3dab1ce8b 100644 --- a/.github/workflows/get-version.yml +++ b/.github/workflows/get-version.yml @@ -71,6 +71,6 @@ jobs: echo "revNum=${REVCOUNT}" >> $GITHUB_OUTPUT echo "type=${TYPE}" >> $GITHUB_OUTPUT - name: Validate Version - uses: skymatic/semver-validation-action@v2 + uses: skymatic/semver-validation-action@v3 with: version: ${{ steps.versions.outputs.semVerStr }} \ No newline at end of file From db224e9e5c3c1d943c45e78b66dd1f9e2143b31c Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Fri, 8 Mar 2024 09:58:59 +0100 Subject: [PATCH 11/82] added latestVersion and lastUpdateCheck to settings and integrated with update checker --- .../cryptomator/common/settings/Settings.java | 6 +++++- .../common/settings/SettingsJson.java | 3 +++ .../cryptomator/ui/fxapp/UpdateChecker.java | 21 ++++++++++++++++++- .../UpdatesPreferencesController.java | 2 +- .../UpdateReminderComponent.java | 6 ++++-- .../UpdateReminderController.java | 5 ++--- 6 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/cryptomator/common/settings/Settings.java b/src/main/java/org/cryptomator/common/settings/Settings.java index 4e0e0df97..6c46654c1 100644 --- a/src/main/java/org/cryptomator/common/settings/Settings.java +++ b/src/main/java/org/cryptomator/common/settings/Settings.java @@ -44,7 +44,7 @@ public class Settings { static final String DEFAULT_KEYCHAIN_PROVIDER = SystemUtils.IS_OS_WINDOWS ? "org.cryptomator.windows.keychain.WindowsProtectedKeychainAccess" : SystemUtils.IS_OS_MAC ? "org.cryptomator.macos.keychain.MacSystemKeychainAccess" : "org.cryptomator.linux.keychain.SecretServiceKeychainAccess"; static final String DEFAULT_USER_INTERFACE_ORIENTATION = NodeOrientation.LEFT_TO_RIGHT.name(); static final boolean DEFAULT_SHOW_MINIMIZE_BUTTON = false; - static final String DEFAULT_LAST_UPDATE_CHECK = "2000-01-01"; + public static final String DEFAULT_LAST_UPDATE_CHECK = "2000-01-01T10:00:00"; public final ObservableList directories; public final BooleanProperty askedForUpdateCheck; @@ -68,6 +68,7 @@ public class Settings { public final StringProperty language; public final StringProperty mountService; public final StringProperty lastUpdateCheck; + public final StringProperty latestVersion; private Consumer saveCmd; @@ -105,6 +106,7 @@ public class Settings { this.language = new SimpleStringProperty(this, "language", json.language); this.mountService = new SimpleStringProperty(this, "mountService", json.mountService); this.lastUpdateCheck = new SimpleStringProperty(this, "lastUpdateCheck", json.lastUpdateCheck); + this.latestVersion = new SimpleStringProperty(this, "latestVersion", json.latestVersion); this.directories.addAll(json.directories.stream().map(VaultSettings::new).toList()); @@ -132,6 +134,7 @@ public class Settings { language.addListener(this::somethingChanged); mountService.addListener(this::somethingChanged); lastUpdateCheck.addListener(this::somethingChanged); + latestVersion.addListener(this::somethingChanged); } @SuppressWarnings("deprecation") @@ -186,6 +189,7 @@ public class Settings { json.language = language.get(); json.mountService = mountService.get(); json.lastUpdateCheck = lastUpdateCheck.get(); + json.latestVersion = latestVersion.get(); return json; } diff --git a/src/main/java/org/cryptomator/common/settings/SettingsJson.java b/src/main/java/org/cryptomator/common/settings/SettingsJson.java index 2c7c963da..2dbb514c0 100644 --- a/src/main/java/org/cryptomator/common/settings/SettingsJson.java +++ b/src/main/java/org/cryptomator/common/settings/SettingsJson.java @@ -83,4 +83,7 @@ class SettingsJson { @JsonProperty("lastUpdateCheck") String lastUpdateCheck = Settings.DEFAULT_LAST_UPDATE_CHECK; + @JsonProperty("latestVersion") + String latestVersion; + } diff --git a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java index e2e423f84..369ab168a 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java +++ b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java @@ -16,7 +16,10 @@ import javafx.concurrent.ScheduledService; import javafx.concurrent.Worker; import javafx.concurrent.WorkerStateEvent; import javafx.util.Duration; +import java.time.LocalDate; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; @FxApplicationScoped public class UpdateChecker { @@ -38,6 +41,21 @@ public class UpdateChecker { this.env = env; this.settings = settings; this.updateCheckerService = updateCheckerService; + this.latestVersionProperty.set(settings.latestVersion.get()); + var dateTimeString = !settings.lastUpdateCheck.get().isEmpty() ? settings.lastUpdateCheck.get() : Settings.DEFAULT_LAST_UPDATE_CHECK; + try { + LocalDateTime dateTime = LocalDateTime.parse(dateTimeString, DateTimeFormatter.ISO_DATE_TIME); + this.updateCheckTimeProperty.set(dateTime); + } catch (DateTimeParseException e) { + try { + LocalDate date = LocalDate.parse(dateTimeString, DateTimeFormatter.ISO_DATE); + this.updateCheckTimeProperty.set(LocalDateTime.of(date, LocalDate.MIN.atStartOfDay().toLocalTime())); + } catch (DateTimeParseException ex) { + LOG.error("The date/time format is invalid:" + dateTimeString, ex); + } + } + this.latestVersionProperty().addListener((_, _, newValue) -> settings.latestVersion.set(newValue)); + this.updateCheckTimeProperty().addListener((_,_,newValue) -> settings.lastUpdateCheck.set(newValue.toString())); } public void automaticallyCheckForUpdatesIfEnabled() { @@ -69,6 +87,7 @@ public class UpdateChecker { String latestVersion = updateCheckerService.getValue(); LOG.info("Current version: {}, latest version: {}", getCurrentVersion(), latestVersion); updateCheckTimeProperty.set(LocalDateTime.now()); + //settings.lastUpdateCheck.set(updateCheckTimeProperty.get().toString()); latestVersionProperty.set(latestVersion); state.set(UpdateCheckState.CHECK_SUCCESSFUL); } @@ -95,7 +114,7 @@ public class UpdateChecker { } public String getCurrentVersion() { - return env.getAppVersion(); + return "1.12.3";//env.getAppVersion(); } public ObjectProperty updateCheckTimeProperty() { diff --git a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java index 57ebc9706..f168b0a5c 100644 --- a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java @@ -77,7 +77,7 @@ public class UpdatesPreferencesController implements FxController { checkForUpdatesCheckbox.selectedProperty().bindBidirectional(settings.checkForUpdates); DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(Locale.getDefault()); - updateCheckDateFormattedLabel.arg1Property().bind(Bindings.createStringBinding(() -> (updateCheckDateProperty.get() != null) ? updateCheckDateProperty.get().format(formatter) : "-", updateCheckDateProperty)); + updateCheckDateFormattedLabel.arg1Property().bind(Bindings.createStringBinding(() -> (!updateCheckDateProperty.get().equals(LocalDateTime.parse(Settings.DEFAULT_LAST_UPDATE_CHECK)) && latestVersionProperty().isNotNull().get() ) ? updateCheckDateProperty.get().format(formatter) : "-", updateCheckDateProperty, latestVersionProperty())); BooleanBinding isUpdateCheckFailed = updateCheckStateProperty.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_FAILED); checkFailedHBox.managedProperty().bind(isUpdateCheckFailed); diff --git a/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderComponent.java b/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderComponent.java index aa13f30da..d51d8df82 100644 --- a/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderComponent.java +++ b/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderComponent.java @@ -5,10 +5,11 @@ import dagger.Subcomponent; import org.cryptomator.common.settings.Settings; import org.cryptomator.ui.common.FxmlFile; import org.cryptomator.ui.common.FxmlScene; +import org.cryptomator.ui.fxapp.UpdateChecker; import javafx.scene.Scene; import javafx.stage.Stage; -import java.time.LocalDate; +import java.time.LocalDateTime; @UpdateReminderScoped @Subcomponent(modules = {UpdateReminderModule.class}) @@ -21,9 +22,10 @@ public interface UpdateReminderComponent { Lazy updateReminderScene(); Settings settings(); + UpdateChecker updateChecker(); default void checkAndShowUpdateReminderWindow() { - if (LocalDate.parse(settings().lastUpdateCheck.get()).isBefore(LocalDate.now().minusDays(14)) && !settings().checkForUpdates.getValue()) { + if (updateChecker().updateCheckTimeProperty().get().isBefore(LocalDateTime.now().minusDays(14)) && !settings().checkForUpdates.getValue()) { Stage stage = window(); stage.setScene(updateReminderScene().get()); stage.sizeToScene(); diff --git a/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderController.java b/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderController.java index 28ae0b5c6..bd70115e3 100644 --- a/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderController.java +++ b/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderController.java @@ -8,6 +8,7 @@ import javax.inject.Inject; import javafx.fxml.FXML; import javafx.stage.Stage; import java.time.LocalDate; +import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; @UpdateReminderScoped @@ -27,20 +28,18 @@ public class UpdateReminderController implements FxController { @FXML public void cancel() { - settings.lastUpdateCheck.set(LocalDate.now().format(DateTimeFormatter.ISO_DATE)); + updateChecker.updateCheckTimeProperty().set(LocalDateTime.now()); window.close(); } @FXML public void once() { - settings.lastUpdateCheck.set(LocalDate.now().format(DateTimeFormatter.ISO_DATE)); updateChecker.checkForUpdatesNow(); window.close(); } @FXML public void automatically() { - settings.lastUpdateCheck.set(LocalDate.now().format(DateTimeFormatter.ISO_DATE)); updateChecker.checkForUpdatesNow(); settings.checkForUpdates.set(true); window.close(); From 1ed77ebcc05f97b44d77a543b9d8764885cf6d21 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Fri, 8 Mar 2024 10:27:35 +0100 Subject: [PATCH 12/82] code cleanup --- src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java | 3 +-- .../ui/preferences/UpdatesPreferencesController.java | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java index 369ab168a..2cbf9bb31 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java +++ b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java @@ -87,7 +87,6 @@ public class UpdateChecker { String latestVersion = updateCheckerService.getValue(); LOG.info("Current version: {}, latest version: {}", getCurrentVersion(), latestVersion); updateCheckTimeProperty.set(LocalDateTime.now()); - //settings.lastUpdateCheck.set(updateCheckTimeProperty.get().toString()); latestVersionProperty.set(latestVersion); state.set(UpdateCheckState.CHECK_SUCCESSFUL); } @@ -114,7 +113,7 @@ public class UpdateChecker { } public String getCurrentVersion() { - return "1.12.3";//env.getAppVersion(); + return env.getAppVersion(); } public ObjectProperty updateCheckTimeProperty() { diff --git a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java index f168b0a5c..49f2a2250 100644 --- a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java @@ -28,7 +28,6 @@ import java.util.Comparator; import java.util.Locale; - @PreferencesScoped public class UpdatesPreferencesController implements FxController { @@ -77,7 +76,7 @@ public class UpdatesPreferencesController implements FxController { checkForUpdatesCheckbox.selectedProperty().bindBidirectional(settings.checkForUpdates); DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(Locale.getDefault()); - updateCheckDateFormattedLabel.arg1Property().bind(Bindings.createStringBinding(() -> (!updateCheckDateProperty.get().equals(LocalDateTime.parse(Settings.DEFAULT_LAST_UPDATE_CHECK)) && latestVersionProperty().isNotNull().get() ) ? updateCheckDateProperty.get().format(formatter) : "-", updateCheckDateProperty, latestVersionProperty())); + updateCheckDateFormattedLabel.arg1Property().bind(Bindings.createStringBinding(() -> (!updateCheckDateProperty.get().equals(LocalDateTime.parse(Settings.DEFAULT_LAST_UPDATE_CHECK)) && latestVersionProperty().isNotNull().get()) ? updateCheckDateProperty.get().format(formatter) : "-", updateCheckDateProperty, latestVersionProperty())); BooleanBinding isUpdateCheckFailed = updateCheckStateProperty.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_FAILED); checkFailedHBox.managedProperty().bind(isUpdateCheckFailed); @@ -85,8 +84,7 @@ public class UpdatesPreferencesController implements FxController { latestVersionFormattedLabel.arg1Property().bind(Bindings.createStringBinding(() -> (latestVersion.get() != null) ? latestVersion.get() : "-", latestVersion)); - BooleanBinding isUpdateSuccessfulAndCurrent = updateCheckStateProperty.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_SUCCESSFUL) - .and(latestVersion.isEqualTo(currentVersion)); + BooleanBinding isUpdateSuccessfulAndCurrent = updateCheckStateProperty.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_SUCCESSFUL).and(latestVersion.isEqualTo(currentVersion)); updateCheckStateProperty.addListener((_, _, _) -> { if (isUpdateSuccessfulAndCurrent.get()) { From f5e445a610254c65f71baf177af0bae9b803e884 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 07:57:00 +0000 Subject: [PATCH 13/82] Bump the java-production-dependencies group with 3 updates (#3365) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0ddf03d29..61a25a2f0 100644 --- a/pom.xml +++ b/pom.xml @@ -47,11 +47,11 @@ 2.51 2.2 33.0.0-jre - 2.16.1 + 2.16.2 21.0.1 4.4.0 9.37.3 - 1.5.2 + 1.5.3 2.0.12 0.8.0 1.8.2 From 4a1eaf25c7561e4947ccb1e159c5ed7d7e6536c3 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 12 Mar 2024 09:46:37 +0100 Subject: [PATCH 14/82] Closes #3361, Fixes #3351 --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index 61a25a2f0..47c735850 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,6 @@ 1.2.3 1.4.4 4.0.0 - 2.0.0 2.0.6 From ed03606981cc01fe93eaad7cf78be4817dcc5631 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 12 Mar 2024 09:51:11 +0100 Subject: [PATCH 15/82] One should also remove the actual dependency --- pom.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pom.xml b/pom.xml index 47c735850..6e831fcd9 100644 --- a/pom.xml +++ b/pom.xml @@ -85,11 +85,6 @@ fuse-nio-adapter ${cryptomator.fuse.version} - - org.cryptomator - dokany-nio-adapter - ${cryptomator.dokany.version} - org.cryptomator webdav-nio-adapter From f2a50b59b5804a368099aa22a9f712ce3e2fafd5 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 12 Mar 2024 09:56:30 +0100 Subject: [PATCH 16/82] well, that should be the last reference to dokany --- src/main/java/module-info.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index b353b7a8a..4d956c180 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -21,7 +21,6 @@ open module org.cryptomator.desktop { requires org.cryptomator.cryptolib; requires org.cryptomator.cryptofs; - requires org.cryptomator.frontend.dokany; requires org.cryptomator.frontend.fuse; requires org.cryptomator.frontend.webdav; requires org.cryptomator.integrations.api; From 0009940e1ec4d05b84a97321da41b558cf81aaa9 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 14 Mar 2024 12:09:10 +0100 Subject: [PATCH 17/82] adjusted after dependency update --- .idea/compiler.xml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index a3e38d3aa..18834c0fc 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -14,31 +14,29 @@ + + com.fasterxml.jackson.core jackson-databind ${jackson.version} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson.version} + diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index b353b7a8a..cfac6bbeb 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -39,6 +39,7 @@ open module org.cryptomator.desktop { requires com.auth0.jwt; requires com.google.common; requires com.fasterxml.jackson.databind; + requires com.fasterxml.jackson.datatype.jsr310; requires com.nimbusds.jose.jwt; requires com.nulabinc.zxcvbn; requires com.tobiasdiez.easybind; diff --git a/src/main/java/org/cryptomator/common/settings/Settings.java b/src/main/java/org/cryptomator/common/settings/Settings.java index f17a1f802..be0361153 100644 --- a/src/main/java/org/cryptomator/common/settings/Settings.java +++ b/src/main/java/org/cryptomator/common/settings/Settings.java @@ -26,7 +26,6 @@ import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.geometry.NodeOrientation; import java.time.Instant; -import java.util.Date; import java.util.function.Consumer; public class Settings { @@ -46,8 +45,7 @@ public class Settings { static final String DEFAULT_KEYCHAIN_PROVIDER = SystemUtils.IS_OS_WINDOWS ? "org.cryptomator.windows.keychain.WindowsProtectedKeychainAccess" : SystemUtils.IS_OS_MAC ? "org.cryptomator.macos.keychain.MacSystemKeychainAccess" : "org.cryptomator.linux.keychain.SecretServiceKeychainAccess"; static final String DEFAULT_USER_INTERFACE_ORIENTATION = NodeOrientation.LEFT_TO_RIGHT.name(); static final boolean DEFAULT_SHOW_MINIMIZE_BUTTON = false; - static final Instant DEFAULT_LAST_UPDATE_REMINDER = Instant.ofEpochSecond(946681200); //2000-01-01T00:00:00Z - public static final Instant DEFAULT_LAST_SUCCESSFUL_UPDATE_CHECK = Instant.ofEpochSecond(946681200); //2000-01-01T00:00:00Z + public static final Instant DEFAULT_TIMESTAMP = Instant.parse("2000-01-01T00:00:00Z"); public final ObservableList directories; public final BooleanProperty askedForUpdateCheck; public final BooleanProperty checkForUpdates; @@ -71,7 +69,6 @@ public class Settings { public final StringProperty mountService; public final ObjectProperty lastUpdateReminder; public final ObjectProperty lastSuccessfulUpdateCheck; - public final StringProperty latestVersion; private Consumer saveCmd; @@ -108,9 +105,8 @@ public class Settings { this.windowHeight = new SimpleIntegerProperty(this, "windowHeight", json.windowHeight); this.language = new SimpleStringProperty(this, "language", json.language); this.mountService = new SimpleStringProperty(this, "mountService", json.mountService); - this.lastUpdateReminder = new SimpleObjectProperty<>(this, "lastUpdateReminder", json.lastUpdateReminder.toInstant()); - this.lastSuccessfulUpdateCheck = new SimpleObjectProperty<>(this, "lastSuccessfulUpdateCheck", json.lastSuccessfulUpdateCheck.toInstant()); - this.latestVersion = new SimpleStringProperty(this, "latestVersion", json.latestVersion); + this.lastUpdateReminder = new SimpleObjectProperty<>(this, "lastUpdateReminder", json.lastUpdateReminder); + this.lastSuccessfulUpdateCheck = new SimpleObjectProperty<>(this, "lastSuccessfulUpdateCheck", json.lastSuccessfulUpdateCheck); this.directories.addAll(json.directories.stream().map(VaultSettings::new).toList()); @@ -139,7 +135,6 @@ public class Settings { mountService.addListener(this::somethingChanged); lastUpdateReminder.addListener(this::somethingChanged); lastSuccessfulUpdateCheck.addListener(this::somethingChanged); - latestVersion.addListener(this::somethingChanged); } @SuppressWarnings("deprecation") @@ -193,9 +188,8 @@ public class Settings { json.windowHeight = windowHeight.get(); json.language = language.get(); json.mountService = mountService.get(); - json.lastUpdateReminder = Date.from(lastUpdateReminder.get()); - json.lastSuccessfulUpdateCheck = Date.from(lastSuccessfulUpdateCheck.get()); - json.latestVersion = latestVersion.get(); + json.lastUpdateReminder = lastUpdateReminder.get(); + json.lastSuccessfulUpdateCheck = lastSuccessfulUpdateCheck.get(); return json; } diff --git a/src/main/java/org/cryptomator/common/settings/SettingsJson.java b/src/main/java/org/cryptomator/common/settings/SettingsJson.java index ebaf841ed..0acd72fe7 100644 --- a/src/main/java/org/cryptomator/common/settings/SettingsJson.java +++ b/src/main/java/org/cryptomator/common/settings/SettingsJson.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Date; +import java.time.Instant; import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) @@ -83,14 +83,11 @@ class SettingsJson { String preferredVolumeImpl; @JsonProperty("lastUpdateReminder") - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") - Date lastUpdateReminder = Date.from(Settings.DEFAULT_LAST_UPDATE_REMINDER); + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC") + Instant lastUpdateReminder = Settings.DEFAULT_TIMESTAMP; @JsonProperty("lastSuccessfulUpdateCheck") - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss z") - Date lastSuccessfulUpdateCheck = Date.from(Settings.DEFAULT_LAST_SUCCESSFUL_UPDATE_CHECK); - - @JsonProperty("latestVersion") - String latestVersion; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC") + Instant lastSuccessfulUpdateCheck = Settings.DEFAULT_TIMESTAMP; } diff --git a/src/main/java/org/cryptomator/common/settings/SettingsProvider.java b/src/main/java/org/cryptomator/common/settings/SettingsProvider.java index 586708ed1..a33b51027 100644 --- a/src/main/java/org/cryptomator/common/settings/SettingsProvider.java +++ b/src/main/java/org/cryptomator/common/settings/SettingsProvider.java @@ -10,6 +10,7 @@ package org.cryptomator.common.settings; import com.fasterxml.jackson.core.JacksonException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.google.common.base.Suppliers; import org.cryptomator.common.Environment; import org.slf4j.Logger; @@ -36,7 +37,7 @@ import java.util.stream.Stream; @Singleton public class SettingsProvider implements Supplier { - private static final ObjectMapper JSON = new ObjectMapper().setDefaultLeniency(true); + private static final ObjectMapper JSON = new ObjectMapper().setDefaultLeniency(true).registerModule(new JavaTimeModule()); private static final Logger LOG = LoggerFactory.getLogger(SettingsProvider.class); private static final long SAVE_DELAY_MS = 1000; diff --git a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java index 32267f27c..0d266dd02 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java +++ b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java @@ -35,6 +35,7 @@ public class UpdateChecker { private final ObjectProperty lastSuccessfulUpdateCheck = new SimpleObjectProperty<>(); private final Comparator versionComparator = new SemVerComparator(); private final BooleanBinding updateAvailable; + private final BooleanBinding checkFailed; @Inject UpdateChecker(Settings settings, // @@ -43,13 +44,13 @@ public class UpdateChecker { this.env = env; this.settings = settings; this.updateCheckerService = updateCheckerService; - this.latestVersion.bindBidirectional(settings.latestVersion); this.lastSuccessfulUpdateCheck.bindBidirectional(settings.lastSuccessfulUpdateCheck); this.updateAvailable = Bindings.createBooleanBinding(() -> { var latestVersion = this.latestVersion.get(); return latestVersion != null && versionComparator.compare(getCurrentVersion(), latestVersion) < 0; }, latestVersion); + this.checkFailed = Bindings.createBooleanBinding(() -> state.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_FAILED).get(), state); } public void automaticallyCheckForUpdatesIfEnabled() { @@ -87,7 +88,6 @@ public class UpdateChecker { private void checkFailed(WorkerStateEvent event) { state.set(UpdateCheckState.CHECK_FAILED); - LOG.warn("Error checking for updates", event.getSource().getException()); } public enum UpdateCheckState { @@ -109,6 +109,9 @@ public class UpdateChecker { public BooleanBinding updateAvailableProperty() { return updateAvailable; } + public BooleanBinding checkFailedProperty() { + return checkFailed; + } public boolean isUpdateAvailable() { return updateAvailable.get(); diff --git a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java index e5597db08..ebfee8689 100644 --- a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java @@ -47,10 +47,11 @@ public class UpdatesPreferencesController implements FxController { private final ObservableValue timeDifferenceMessage; private final String currentVersion; private final BooleanBinding updateAvailable; + private final BooleanBinding checkFailed; private final BooleanProperty upToDateLabelVisible = new SimpleBooleanProperty(false); private final ObjectProperty updateCheckState; private final DateTimeFormatter formatter; - private final BooleanBinding isUpdateSuccessfulAndCurrent; + private final BooleanBinding upToDate; /* FXML */ public CheckBox checkForUpdatesCheckbox; @@ -72,13 +73,14 @@ public class UpdatesPreferencesController implements FxController { this.updateAvailable = updateChecker.updateAvailableProperty(); this.updateCheckState = updateChecker.updateCheckStateProperty(); this.formatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(Locale.getDefault()); - this.isUpdateSuccessfulAndCurrent = updateCheckState.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_SUCCESSFUL).and(latestVersion.isEqualTo(currentVersion)); + this.upToDate = updateCheckState.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_SUCCESSFUL).and(latestVersion.isEqualTo(currentVersion)); + this.checkFailed = updateChecker.checkFailedProperty(); } public void initialize() { checkForUpdatesCheckbox.selectedProperty().bindBidirectional(settings.checkForUpdates); - isUpdateSuccessfulAndCurrent.addListener((_, _, newVal) -> { + upToDate.addListener((_, _, newVal) -> { if (newVal) { upToDateLabelVisible.set(true); PauseTransition delay = new PauseTransition(javafx.util.Duration.seconds(5)); @@ -131,7 +133,7 @@ public class UpdatesPreferencesController implements FxController { public String getLastSuccessfulUpdateCheck() { Instant lastCheck = lastSuccessfulUpdateCheck.getValue(); - if (lastCheck != null && !lastCheck.equals(Settings.DEFAULT_LAST_SUCCESSFUL_UPDATE_CHECK)) { + if (lastCheck != null && !lastCheck.equals(Settings.DEFAULT_TIMESTAMP)) { return formatter.format(LocalDateTime.ofInstant(lastCheck, ZoneId.systemDefault())); } else { return "-"; @@ -139,7 +141,7 @@ public class UpdatesPreferencesController implements FxController { } private String updateTimeDifferenceMessage(Instant lastSuccessCheck) { - if (lastSuccessCheck.equals(Settings.DEFAULT_LAST_SUCCESSFUL_UPDATE_CHECK)) { + if (lastSuccessCheck.equals(Settings.DEFAULT_TIMESTAMP)) { return resourceBundle.getString("preferences.updates.lastUpdateCheck.never"); } @@ -180,11 +182,11 @@ public class UpdatesPreferencesController implements FxController { } public BooleanBinding checkFailedProperty() { - return updateCheckState.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_FAILED); + return checkFailed; } public boolean isCheckFailed() { - return checkFailedProperty().get(); + return checkFailed.get(); } } diff --git a/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderComponent.java b/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderComponent.java index ffd127451..dfa1e5484 100644 --- a/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderComponent.java +++ b/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderComponent.java @@ -25,7 +25,8 @@ public interface UpdateReminderComponent { default void checkAndShowUpdateReminderWindow() { var now = Instant.now(); - if (settings().lastUpdateReminder.get().isBefore(now.minus(Duration.ofDays(14))) && !settings().checkForUpdates.getValue()) { + var twoWeeksAgo = now.minus(Duration.ofDays(14)); + if (settings().lastUpdateReminder.get().isBefore(twoWeeksAgo) && !settings().checkForUpdates.getValue() && settings().lastSuccessfulUpdateCheck.get().isBefore(twoWeeksAgo)) { settings().lastUpdateReminder.set(now); Stage stage = window(); stage.setScene(updateReminderScene().get()); diff --git a/src/main/resources/fxml/preferences_updates.fxml b/src/main/resources/fxml/preferences_updates.fxml index 66e15d695..97c917603 100644 --- a/src/main/resources/fxml/preferences_updates.fxml +++ b/src/main/resources/fxml/preferences_updates.fxml @@ -12,6 +12,8 @@ + + - - + + + + + + + diff --git a/src/main/resources/i18n/strings.properties b/src/main/resources/i18n/strings.properties index cbefacd21..0fbe68ca8 100644 --- a/src/main/resources/i18n/strings.properties +++ b/src/main/resources/i18n/strings.properties @@ -326,7 +326,7 @@ preferences.updates.lastUpdateCheck.never=never preferences.updates.lastUpdateCheck.recently=recently preferences.updates.lastUpdateCheck.daysAgo=%s days ago preferences.updates.lastUpdateCheck.hoursAgo=%s hours ago -preferences.updates.checkFailed=Check failed +preferences.updates.checkFailed=Looking for updates failed. Please check your internet connection and try again later. preferences.updates.upToDate=Cryptomator is up-to-date. ## Contribution From 08f81b7df4485984665d45d0545fd8c998f3f0bb Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Mon, 29 Apr 2024 11:12:14 +0200 Subject: [PATCH 38/82] registered module in SettingsJsonTest --- .../java/org/cryptomator/common/settings/SettingsJsonTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/cryptomator/common/settings/SettingsJsonTest.java b/src/test/java/org/cryptomator/common/settings/SettingsJsonTest.java index da78ee5bc..a73431681 100644 --- a/src/test/java/org/cryptomator/common/settings/SettingsJsonTest.java +++ b/src/test/java/org/cryptomator/common/settings/SettingsJsonTest.java @@ -3,6 +3,7 @@ package org.cryptomator.common.settings; import com.fasterxml.jackson.core.JacksonException; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import org.hamcrest.MatcherAssert; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -68,7 +69,7 @@ public class SettingsJsonTest { jsonObj.theme = UiTheme.DARK; jsonObj.showTrayIcon = false; - var jsonStr = new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(jsonObj); + var jsonStr = new ObjectMapper().registerModule(new JavaTimeModule()).writerWithDefaultPrettyPrinter().writeValueAsString(jsonObj); MatcherAssert.assertThat(jsonStr, containsString("\"theme\" : \"DARK\"")); MatcherAssert.assertThat(jsonStr, containsString("\"showTrayIcon\" : false")); From dac517a6fb5f584864528863c18cd83c96973c99 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 2 May 2024 16:59:45 +0200 Subject: [PATCH 39/82] update project ot jdk 22 Note: dependency bumps regarding jdk22 compatiblilty are missing! --- .github/workflows/appimage.yml | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/check-jdk-updates.yml | 2 +- .github/workflows/debian.yml | 6 +++--- .github/workflows/dependency-check.yml | 2 +- .github/workflows/get-version.yml | 2 +- .github/workflows/mac-dmg.yml | 2 +- .github/workflows/pullrequest.yml | 2 +- .github/workflows/release-check.yml | 2 +- .github/workflows/win-exe.yml | 2 +- .idea/misc.xml | 2 +- pom.xml | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 4f4682e5a..4ca0212b3 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -11,7 +11,7 @@ on: env: JAVA_DIST: 'zulu' - JAVA_VERSION: '21.0.2+13' + JAVA_VERSION: '22.0.1+8' jobs: get-version: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3559e5fa2..c38bb49e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ on: env: JAVA_DIST: 'zulu' - JAVA_VERSION: 21 + JAVA_VERSION: 22 defaults: run: diff --git a/.github/workflows/check-jdk-updates.yml b/.github/workflows/check-jdk-updates.yml index c628571e8..c73546994 100644 --- a/.github/workflows/check-jdk-updates.yml +++ b/.github/workflows/check-jdk-updates.yml @@ -5,7 +5,7 @@ on: - cron: '0 0 1 * *' # run once a month at the first day of month env: - JDK_VERSION: '21.0.2+13' + JDK_VERSION: '22.0.1+8' JDK_VENDOR: zulu jobs: diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index dd7d2adf0..9c220843b 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -17,9 +17,9 @@ on: env: JAVA_DIST: 'zulu' - JAVA_VERSION: '21.0.2+13' - COFFEELIBS_JDK: 21 - COFFEELIBS_JDK_VERSION: '21.0.2+13-0ppa1' + JAVA_VERSION: '22.0.1+8' + COFFEELIBS_JDK: 22 + COFFEELIBS_JDK_VERSION: '22.0.1+8-0ppa1' OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/21.0.1/openjfx-21.0.1_linux-x64_bin-jmods.zip' OPENJFX_JMODS_AMD64_HASH: '7baed11ca56d5fee85995fa6612d4299f1e8b7337287228f7f12fd50407c56f8' OPENJFX_JMODS_AARCH64: 'https://download2.gluonhq.com/openjfx/21.0.1/openjfx-21.0.1_linux-aarch64_bin-jmods.zip' diff --git a/.github/workflows/dependency-check.yml b/.github/workflows/dependency-check.yml index 21fed1912..02633a334 100644 --- a/.github/workflows/dependency-check.yml +++ b/.github/workflows/dependency-check.yml @@ -11,7 +11,7 @@ jobs: with: runner-os: 'ubuntu-latest' java-distribution: 'temurin' - java-version: 21 + java-version: 22 secrets: nvd-api-key: ${{ secrets.NVD_API_KEY }} slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml index 3dab1ce8b..7dc22462f 100644 --- a/.github/workflows/get-version.yml +++ b/.github/workflows/get-version.yml @@ -23,7 +23,7 @@ on: env: JAVA_DIST: 'zulu' - JAVA_VERSION: 21 + JAVA_VERSION: 22 jobs: determine-version: diff --git a/.github/workflows/mac-dmg.yml b/.github/workflows/mac-dmg.yml index 82e7ba728..cce580ec1 100644 --- a/.github/workflows/mac-dmg.yml +++ b/.github/workflows/mac-dmg.yml @@ -16,7 +16,7 @@ on: env: JAVA_DIST: 'zulu' - JAVA_VERSION: '21.0.2+13' + JAVA_VERSION: '22.0.1+8' jobs: get-version: diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 2730f5c24..4db444da5 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -5,7 +5,7 @@ on: env: JAVA_DIST: 'zulu' - JAVA_VERSION: 21 + JAVA_VERSION: 22 defaults: run: diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml index e5b977d79..160da33e9 100644 --- a/.github/workflows/release-check.yml +++ b/.github/workflows/release-check.yml @@ -12,7 +12,7 @@ defaults: env: JAVA_DIST: 'zulu' - JAVA_VERSION: 21 + JAVA_VERSION: 22 jobs: check-preconditions: diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index 37e89e427..caad9ade7 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -16,7 +16,7 @@ on: env: JAVA_DIST: 'zulu' - JAVA_VERSION: '21.0.2+13' + JAVA_VERSION: '22.0.1+8' OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/21.0.1/openjfx-21.0.1_windows-x64_bin-jmods.zip' OPENJFX_JMODS_AMD64_HASH: 'daf8acae631c016c24cfe23f88469400274d3441dd890615a42dfb501f3eb94a' WINFSP_MSI: 'https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi' diff --git a/.idea/misc.xml b/.idea/misc.xml index ee700a1c2..3bcfa174b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -8,7 +8,7 @@ - + \ No newline at end of file diff --git a/pom.xml b/pom.xml index e6b8d527d..7b2ea2cbb 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ UTF-8 - 21 + 22 From e79257e5ea07122d604707d7811dc0595f34cb3a Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Mon, 6 May 2024 13:46:49 +0200 Subject: [PATCH 40/82] changed checkFailed property to ObservableValue --- src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java | 8 +++++--- .../ui/preferences/UpdatesPreferencesController.java | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java index 0d266dd02..7bf51aaa8 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java +++ b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java @@ -14,6 +14,7 @@ import javafx.beans.property.ReadOnlyStringProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; +import javafx.beans.value.ObservableValue; import javafx.concurrent.ScheduledService; import javafx.concurrent.Worker; import javafx.concurrent.WorkerStateEvent; @@ -35,7 +36,8 @@ public class UpdateChecker { private final ObjectProperty lastSuccessfulUpdateCheck = new SimpleObjectProperty<>(); private final Comparator versionComparator = new SemVerComparator(); private final BooleanBinding updateAvailable; - private final BooleanBinding checkFailed; + //private final BooleanBinding checkFailed; + private final ObservableValue checkFailed; @Inject UpdateChecker(Settings settings, // @@ -50,7 +52,7 @@ public class UpdateChecker { var latestVersion = this.latestVersion.get(); return latestVersion != null && versionComparator.compare(getCurrentVersion(), latestVersion) < 0; }, latestVersion); - this.checkFailed = Bindings.createBooleanBinding(() -> state.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_FAILED).get(), state); + this.checkFailed = state.map(UpdateCheckState.CHECK_FAILED::equals); } public void automaticallyCheckForUpdatesIfEnabled() { @@ -109,7 +111,7 @@ public class UpdateChecker { public BooleanBinding updateAvailableProperty() { return updateAvailable; } - public BooleanBinding checkFailedProperty() { + public ObservableValue checkFailedProperty() { return checkFailed; } diff --git a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java index ebfee8689..58d22d50c 100644 --- a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java @@ -47,7 +47,7 @@ public class UpdatesPreferencesController implements FxController { private final ObservableValue timeDifferenceMessage; private final String currentVersion; private final BooleanBinding updateAvailable; - private final BooleanBinding checkFailed; + private final ObservableValue checkFailed; private final BooleanProperty upToDateLabelVisible = new SimpleBooleanProperty(false); private final ObjectProperty updateCheckState; private final DateTimeFormatter formatter; @@ -181,12 +181,12 @@ public class UpdatesPreferencesController implements FxController { return updateAvailable.get(); } - public BooleanBinding checkFailedProperty() { + public ObservableValue checkFailedProperty() { return checkFailed; } public boolean isCheckFailed() { - return checkFailed.get(); + return checkFailed.getValue(); } } From 3bf1e659ef90e95c88a7b9b62aeb2f68e2a8d7d6 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 7 May 2024 12:41:39 +0200 Subject: [PATCH 41/82] changed checkFailed text wording --- src/main/resources/i18n/strings.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/i18n/strings.properties b/src/main/resources/i18n/strings.properties index 0fbe68ca8..acdac613b 100644 --- a/src/main/resources/i18n/strings.properties +++ b/src/main/resources/i18n/strings.properties @@ -326,7 +326,7 @@ preferences.updates.lastUpdateCheck.never=never preferences.updates.lastUpdateCheck.recently=recently preferences.updates.lastUpdateCheck.daysAgo=%s days ago preferences.updates.lastUpdateCheck.hoursAgo=%s hours ago -preferences.updates.checkFailed=Looking for updates failed. Please check your internet connection and try again later. +preferences.updates.checkFailed=Looking for updates failed. Please check your internet connection or try again later. preferences.updates.upToDate=Cryptomator is up-to-date. ## Contribution From 9ad2d223c3790cad9b9c874a994b2e61ae12cfbb Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 7 May 2024 13:23:53 +0200 Subject: [PATCH 42/82] changed BooleanBinding updateAvailable to ObservableValue --- .../org/cryptomator/ui/fxapp/UpdateChecker.java | 14 +++++--------- .../ui/mainwindow/MainWindowTitleController.java | 7 ++++--- .../preferences/UpdatesPreferencesController.java | 6 +++--- .../updatereminder/UpdateReminderController.java | 3 --- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java index 7bf51aaa8..4386fca8e 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java +++ b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java @@ -1,13 +1,13 @@ package org.cryptomator.ui.fxapp; import org.cryptomator.common.Environment; +import org.cryptomator.common.ObservableUtil; import org.cryptomator.common.SemVerComparator; import org.cryptomator.common.settings.Settings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.inject.Inject; -import javafx.beans.binding.Bindings; import javafx.beans.binding.BooleanBinding; import javafx.beans.property.ObjectProperty; import javafx.beans.property.ReadOnlyStringProperty; @@ -35,7 +35,7 @@ public class UpdateChecker { private final ObjectProperty state = new SimpleObjectProperty<>(UpdateCheckState.NOT_CHECKED); private final ObjectProperty lastSuccessfulUpdateCheck = new SimpleObjectProperty<>(); private final Comparator versionComparator = new SemVerComparator(); - private final BooleanBinding updateAvailable; + private final ObservableValue updateAvailable; //private final BooleanBinding checkFailed; private final ObservableValue checkFailed; @@ -47,11 +47,7 @@ public class UpdateChecker { this.settings = settings; this.updateCheckerService = updateCheckerService; this.lastSuccessfulUpdateCheck.bindBidirectional(settings.lastSuccessfulUpdateCheck); - - this.updateAvailable = Bindings.createBooleanBinding(() -> { - var latestVersion = this.latestVersion.get(); - return latestVersion != null && versionComparator.compare(getCurrentVersion(), latestVersion) < 0; - }, latestVersion); + this.updateAvailable = ObservableUtil.mapWithDefault(latestVersion, latest -> versionComparator.compare(getCurrentVersion(), latest) < 0, false); this.checkFailed = state.map(UpdateCheckState.CHECK_FAILED::equals); } @@ -108,7 +104,7 @@ public class UpdateChecker { return latestVersion; } - public BooleanBinding updateAvailableProperty() { + public ObservableValue updateAvailableProperty() { return updateAvailable; } public ObservableValue checkFailedProperty() { @@ -116,7 +112,7 @@ public class UpdateChecker { } public boolean isUpdateAvailable() { - return updateAvailable.get(); + return updateAvailable.getValue(); } public ObjectProperty lastSuccessfulUpdateCheckProperty() { diff --git a/src/main/java/org/cryptomator/ui/mainwindow/MainWindowTitleController.java b/src/main/java/org/cryptomator/ui/mainwindow/MainWindowTitleController.java index f3c92790d..9761667cc 100644 --- a/src/main/java/org/cryptomator/ui/mainwindow/MainWindowTitleController.java +++ b/src/main/java/org/cryptomator/ui/mainwindow/MainWindowTitleController.java @@ -15,6 +15,7 @@ import javax.inject.Inject; import javafx.beans.binding.Bindings; import javafx.beans.binding.BooleanBinding; import javafx.beans.property.ReadOnlyBooleanProperty; +import javafx.beans.value.ObservableValue; import javafx.fxml.FXML; import javafx.scene.input.MouseButton; import javafx.scene.layout.HBox; @@ -30,7 +31,7 @@ public class MainWindowTitleController implements FxController { private final FxApplicationWindows appWindows; private final boolean trayMenuInitialized; private final UpdateChecker updateChecker; - private final BooleanBinding updateAvailable; + private final ObservableValue updateAvailable; private final LicenseHolder licenseHolder; private final Settings settings; private final BooleanBinding showMinimizeButton; @@ -126,12 +127,12 @@ public class MainWindowTitleController implements FxController { return licenseHolder; } - public BooleanBinding updateAvailableProperty() { + public ObservableValue updateAvailableProperty() { return updateAvailable; } public boolean isUpdateAvailable() { - return updateAvailable.get(); + return updateAvailable.getValue(); } public boolean isTrayIconPresent() { diff --git a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java index 58d22d50c..dca54121f 100644 --- a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java @@ -46,7 +46,7 @@ public class UpdatesPreferencesController implements FxController { private final ObservableValue lastSuccessfulUpdateCheck; private final ObservableValue timeDifferenceMessage; private final String currentVersion; - private final BooleanBinding updateAvailable; + private final ObservableValue updateAvailable; private final ObservableValue checkFailed; private final BooleanProperty upToDateLabelVisible = new SimpleBooleanProperty(false); private final ObjectProperty updateCheckState; @@ -173,12 +173,12 @@ public class UpdatesPreferencesController implements FxController { return upToDateLabelVisible.get(); } - public BooleanBinding updateAvailableProperty() { + public ObservableValue updateAvailableProperty() { return updateAvailable; } public boolean isUpdateAvailable() { - return updateAvailable.get(); + return updateAvailable.getValue(); } public ObservableValue checkFailedProperty() { diff --git a/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderController.java b/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderController.java index 4f657d706..183298c44 100644 --- a/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderController.java +++ b/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderController.java @@ -7,9 +7,6 @@ import org.cryptomator.ui.fxapp.UpdateChecker; import javax.inject.Inject; import javafx.fxml.FXML; import javafx.stage.Stage; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; @UpdateReminderScoped public class UpdateReminderController implements FxController { From da8e84f39d5d1ba2633b132b613d068f3cd336c1 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 7 May 2024 13:27:52 +0200 Subject: [PATCH 43/82] removed unnecessary HBox --- .../UpdatesPreferencesController.java | 2 -- src/main/resources/fxml/preferences_updates.fxml | 16 +++++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java index dca54121f..818ec0694 100644 --- a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java @@ -20,7 +20,6 @@ import javafx.fxml.FXML; import javafx.scene.control.CheckBox; import javafx.scene.control.ContentDisplay; import javafx.scene.control.Label; -import javafx.scene.layout.HBox; import java.time.Duration; import java.time.Instant; import java.time.LocalDateTime; @@ -55,7 +54,6 @@ public class UpdatesPreferencesController implements FxController { /* FXML */ public CheckBox checkForUpdatesCheckbox; - public HBox checkFailedHBox; public Label upToDateLabel; @Inject diff --git a/src/main/resources/fxml/preferences_updates.fxml b/src/main/resources/fxml/preferences_updates.fxml index 97c917603..a1637932b 100644 --- a/src/main/resources/fxml/preferences_updates.fxml +++ b/src/main/resources/fxml/preferences_updates.fxml @@ -35,15 +35,13 @@ - - - - - - - - - + + + + + + + From 249becc25d4af1f6e138af742628b4dd9e24bfd8 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Wed, 8 May 2024 08:28:53 +0200 Subject: [PATCH 44/82] removed unused instance var --- .../ui/preferences/UpdatesPreferencesController.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java index 818ec0694..850e51ec5 100644 --- a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java @@ -48,7 +48,6 @@ public class UpdatesPreferencesController implements FxController { private final ObservableValue updateAvailable; private final ObservableValue checkFailed; private final BooleanProperty upToDateLabelVisible = new SimpleBooleanProperty(false); - private final ObjectProperty updateCheckState; private final DateTimeFormatter formatter; private final BooleanBinding upToDate; @@ -69,9 +68,8 @@ public class UpdatesPreferencesController implements FxController { this.timeDifferenceMessage = lastSuccessfulUpdateCheck.map(this::updateTimeDifferenceMessage); this.currentVersion = updateChecker.getCurrentVersion(); this.updateAvailable = updateChecker.updateAvailableProperty(); - this.updateCheckState = updateChecker.updateCheckStateProperty(); this.formatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(Locale.getDefault()); - this.upToDate = updateCheckState.isEqualTo(UpdateChecker.UpdateCheckState.CHECK_SUCCESSFUL).and(latestVersion.isEqualTo(currentVersion)); + this.upToDate = updateChecker.updateCheckStateProperty().isEqualTo(UpdateChecker.UpdateCheckState.CHECK_SUCCESSFUL).and(latestVersion.isEqualTo(currentVersion)); this.checkFailed = updateChecker.checkFailedProperty(); } From 1581a10c0456fed85ec124ceb94cef231c464328 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Wed, 8 May 2024 08:30:06 +0200 Subject: [PATCH 45/82] removed unused label id --- .../ui/preferences/UpdatesPreferencesController.java | 1 - src/main/resources/fxml/preferences_updates.fxml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java index 850e51ec5..94a462192 100644 --- a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java @@ -53,7 +53,6 @@ public class UpdatesPreferencesController implements FxController { /* FXML */ public CheckBox checkForUpdatesCheckbox; - public Label upToDateLabel; @Inject UpdatesPreferencesController(Application application, Environment environment, ResourceBundle resourceBundle, Settings settings, UpdateChecker updateChecker) { diff --git a/src/main/resources/fxml/preferences_updates.fxml b/src/main/resources/fxml/preferences_updates.fxml index a1637932b..809c56567 100644 --- a/src/main/resources/fxml/preferences_updates.fxml +++ b/src/main/resources/fxml/preferences_updates.fxml @@ -47,7 +47,7 @@ - From dc993dc57ce441011001059e36db1f111881879c Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Mon, 3 Jun 2024 12:29:54 +0200 Subject: [PATCH 59/82] fixes #3440 (PR in #3447) --- .../java/org/cryptomator/common/SubstitutingProperties.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/cryptomator/common/SubstitutingProperties.java b/src/main/java/org/cryptomator/common/SubstitutingProperties.java index 8ba98a2b6..0536e3554 100644 --- a/src/main/java/org/cryptomator/common/SubstitutingProperties.java +++ b/src/main/java/org/cryptomator/common/SubstitutingProperties.java @@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory; import java.util.Map; import java.util.Properties; +import java.util.regex.Matcher; import java.util.regex.Pattern; public class SubstitutingProperties extends PropertiesDecorator { @@ -58,7 +59,7 @@ public class SubstitutingProperties extends PropertiesDecorator { LoggerFactory.getLogger(SubstitutingProperties.class).warn("Variable {} used for substitution not found in {}. Replaced with empty string.", key, src); return ""; } else { - return val.replace("\\", "\\\\"); + return Matcher.quoteReplacement(val); } } From 7180af9bc7e83cb70ce2db7df81af3c8ab5ecf1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 10:30:50 +0000 Subject: [PATCH 60/82] Bump the java-production-dependencies group across 1 directory with 9 updates (#3446) --- pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 0963ea5ed..e9cb5cc7c 100644 --- a/pom.xml +++ b/pom.xml @@ -43,17 +43,17 @@ 3.14.0 - 2.51 + 2.51.1 2.2 - 33.0.0-jre - 2.16.2 + 33.2.1-jre + 2.17.1 21.0.1 4.4.0 9.37.3 - 1.5.3 - 2.0.12 + 1.5.6 + 2.0.13 0.8.0 - 1.8.2 + 1.9.0 5.10.2 From d2599ea525749f814fe537213645889052aa406d Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 6 Jun 2024 12:07:18 +0200 Subject: [PATCH 61/82] closes #2656 --- .../contrib/version170-migrate-settings.bat | 5 --- .../contrib/version170-migrate-settings.ps1 | 35 ------------------- dist/win/resources/main.wxs | 6 ---- 3 files changed, 46 deletions(-) delete mode 100644 dist/win/contrib/version170-migrate-settings.bat delete mode 100644 dist/win/contrib/version170-migrate-settings.ps1 diff --git a/dist/win/contrib/version170-migrate-settings.bat b/dist/win/contrib/version170-migrate-settings.bat deleted file mode 100644 index d94e062a1..000000000 --- a/dist/win/contrib/version170-migrate-settings.bat +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -:: see comments in file ./version170-migrate-settings.ps1 - -cd %~dp0 -powershell -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command .\version170-migrate-settings.ps1 diff --git a/dist/win/contrib/version170-migrate-settings.ps1 b/dist/win/contrib/version170-migrate-settings.ps1 deleted file mode 100644 index 8e019fe66..000000000 --- a/dist/win/contrib/version170-migrate-settings.ps1 +++ /dev/null @@ -1,35 +0,0 @@ -# This script migrates Cryptomator settings for all local users on Windows in case the users uses custom directories as mountpoint -# See also https://github.com/cryptomator/cryptomator/pull/2654. -# -# TODO: This script should be evaluated in a yearly interval if it is still needed and if not, should be removed -# -#Requires -RunAsAdministrator - -#Get all active, local user profiles -$profileList = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' -Get-ChildItem $profileList | ForEach-Object { - $profilePath = $_.GetValue("ProfileImagePath") - $settingsPath = "$profilePath\AppData\Roaming\Cryptomator\settings.json" - if(!(Test-Path -Path $settingsPath -PathType Leaf)) { - #No settings file, nothing to do. - return; - } - $settings = Get-Content -Path $settingsPath | ConvertFrom-Json - if($settings.preferredVolumeImpl -ne "FUSE") { - #Fuse not used, nothing to do - return; - } - - #check if customMountPoints are used - $atLeastOneCustomPath = $false; - foreach ($vault in $settings.directories){ - $atLeastOneCustomPath = $atLeastOneCustomPath -or ($vault.useCustomMountPath -eq "True") - } - - #if so, use WinFsp Local Drive - if( $atLeastOneCustomPath ) { - Add-Member -Force -InputObject $settings -Name "mountService" -Value "org.cryptomator.frontend.fuse.mount.WinFspMountProvider" -MemberType NoteProperty - $newSettings = $settings | Select-Object * -ExcludeProperty "preferredVolumeImpl" - ConvertTo-Json $newSettings | Set-Content -Path $settingsPath - } -} diff --git a/dist/win/resources/main.wxs b/dist/win/resources/main.wxs index 2fe2eb348..335dd3511 100644 --- a/dist/win/resources/main.wxs +++ b/dist/win/resources/main.wxs @@ -139,11 +139,6 @@ Sequence="execute" Before="PatchWebDAV" /> - - - - NOT Installed OR REINSTALL - NOT Installed OR REINSTALL From 91d6264b9ffc53e32363403a151c45b4b9103ceb Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 6 Jun 2024 12:07:49 +0200 Subject: [PATCH 62/82] ignore downloaded artifact --- dist/linux/appimage/.gitignore | 4 +++- dist/mac/dmg/.gitignore | 6 ++++-- dist/win/.gitignore | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dist/linux/appimage/.gitignore b/dist/linux/appimage/.gitignore index 1ed40c771..3e0cd2a39 100644 --- a/dist/linux/appimage/.gitignore +++ b/dist/linux/appimage/.gitignore @@ -1,4 +1,6 @@ -# created during build +# downloaded/created during build +openjfx-jmods.zip +*.jmod Cryptomator.AppDir *.AppImage *.AppImage.zsync \ No newline at end of file diff --git a/dist/mac/dmg/.gitignore b/dist/mac/dmg/.gitignore index cdc73d89b..ebc5e2c5e 100644 --- a/dist/mac/dmg/.gitignore +++ b/dist/mac/dmg/.gitignore @@ -1,6 +1,8 @@ -# created during build +# downloaded/created during build Cryptomator.app/ runtime/ dmg/ *.dmg -license.rtf \ No newline at end of file +license.rtf +openjfx-jmods.zip +*.jmod \ No newline at end of file diff --git a/dist/win/.gitignore b/dist/win/.gitignore index 32316fd59..7b2faa4b5 100644 --- a/dist/win/.gitignore +++ b/dist/win/.gitignore @@ -6,4 +6,5 @@ installer *.msi *.exe *.jmod +resources/jfxJmods.zip license.rtf \ No newline at end of file From 0dc9a3a83421ae8d98980800086e13b46f959fd5 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Fri, 7 Jun 2024 14:56:54 +0200 Subject: [PATCH 63/82] align local build scripts --- dist/linux/appimage/build.sh | 36 ++++++++++++++++++------------------ dist/mac/dmg/build.sh | 15 ++++++++++----- dist/win/build.ps1 | 23 ++++++++++++----------- 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/dist/linux/appimage/build.sh b/dist/linux/appimage/build.sh index 091e66c00..d939e9434 100755 --- a/dist/linux/appimage/build.sh +++ b/dist/linux/appimage/build.sh @@ -12,9 +12,9 @@ command -v unzip >/dev/null 2>&1 || { echo >&2 "unzip not found."; exit 1; } VERSION=$(mvn -f ../../../pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout) SEMVER_STR=${VERSION} -MACHINE_TYPE=$(uname -m) +CPU_ARCH=$(uname -p) -if [[ ! "${MACHINE_TYPE}" =~ x86_64|aarch64 ]]; then echo "Platform ${MACHINE_TYPE} not supported"; exit 1; fi +if [[ ! "${CPU_ARCH}" =~ x86_64|aarch64 ]]; then echo "Platform ${CPU_ARCH} not supported"; exit 1; fi mvn -f ../../../pom.xml versions:set -DnewVersion=${SEMVER_STR} @@ -23,20 +23,20 @@ mvn -B -f ../../../pom.xml clean package -Plinux -DskipTests cp ../../../LICENSE.txt ../../../target cp ../../../target/cryptomator-*.jar ../../../target/mods - -# download javaFX jmods -OPENJFX_URL='https://download2.gluonhq.com/openjfx/21.0.1/openjfx-21.0.1_linux-x64_bin-jmods.zip' -OPENJFX_SHA='7baed11ca56d5fee85995fa6612d4299f1e8b7337287228f7f12fd50407c56f8' -OPENJFX_URL_aarch64='https://download2.gluonhq.com/openjfx/21.0.1/openjfx-21.0.1_linux-aarch64_bin-jmods.zip' -OPENJFX_SHA_aarch64='871e7b9d7af16aef2e55c1b7830d0e0b2503b13dd8641374ba7e55ecb81d2ef9' - -if [[ "${MACHINE_TYPE}" = "aarch64" ]]; then - OPENJFX_URL="${OPENJFX_URL_aarch64}"; - OPENJFX_SHA="${OPENJFX_SHA_aarch64}"; +JAVAFX_VERSION=21.0.1 +JAVAFX_ARCH="x64" +JAVAFX_JMODS_SHA256='7baed11ca56d5fee85995fa6612d4299f1e8b7337287228f7f12fd50407c56f8' +if [ "${CPU_ARCH}" = "aarch64" ]; then + JAVAFX_ARCH="aarch64" + JAVAFX_JMODS_SHA256='871e7b9d7af16aef2e55c1b7830d0e0b2503b13dd8641374ba7e55ecb81d2ef9' fi -curl -L ${OPENJFX_URL} -o openjfx-jmods.zip -echo "${OPENJFX_SHA} openjfx-jmods.zip" | shasum -a256 --check +# download javaFX jmods +JAVAFX_JMODS_URL="https://download2.gluonhq.com/openjfx/${JAVAFX_VERSION}/openjfx-21.0.1_linux-${JAVAFX_ARCH}_bin-jmods.zip" + + +curl -L ${JAVAFX_JMODS_URL} -o openjfx-jmods.zip +echo "${JAVAFX_JMODS_SHA256} openjfx-jmods.zip" | shasum -a256 --check mkdir -p openjfx-jmods unzip -o -j openjfx-jmods.zip \*/javafx.base.jmod \*/javafx.controls.jmod \*/javafx.fxml.jmod \*/javafx.graphics.jmod -d openjfx-jmods JMOD_VERSION=$(jmod describe ./openjfx-jmods/javafx.base.jmod | head -1) @@ -114,17 +114,17 @@ ln -s usr/share/applications/org.cryptomator.Cryptomator.desktop Cryptomator.App ln -s bin/cryptomator.sh Cryptomator.AppDir/AppRun # load AppImageTool -curl -L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-${MACHINE_TYPE}.AppImage -o /tmp/appimagetool.AppImage +curl -L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-${CPU_ARCH}.AppImage -o /tmp/appimagetool.AppImage chmod +x /tmp/appimagetool.AppImage # create AppImage /tmp/appimagetool.AppImage \ Cryptomator.AppDir \ - cryptomator-${SEMVER_STR}-${MACHINE_TYPE}.AppImage \ - -u 'gh-releases-zsync|cryptomator|cryptomator|latest|cryptomator-*-${MACHINE_TYPE}.AppImage.zsync' + cryptomator-${SEMVER_STR}-${CPU_ARCH}.AppImage \ + -u 'gh-releases-zsync|cryptomator|cryptomator|latest|cryptomator-*-${CPU_ARCH}.AppImage.zsync' echo "" -echo "Done. AppImage successfully created: cryptomator-${SEMVER_STR}-${MACHINE_TYPE}.AppImage" +echo "Done. AppImage successfully created: cryptomator-${SEMVER_STR}-${CPU_ARCH}.AppImage" echo "" echo >&2 "To clean up, run: rm -rf Cryptomator.AppDir appdir runtime squashfs-root openjfx-jmods; rm /tmp/appimagetool.AppImage openjfx-jmods.zip" echo "" diff --git a/dist/mac/dmg/build.sh b/dist/mac/dmg/build.sh index ce2380289..4f4ed3069 100755 --- a/dist/mac/dmg/build.sh +++ b/dist/mac/dmg/build.sh @@ -29,13 +29,17 @@ REVISION_NO=`git rev-list --count HEAD` VERSION_NO=`mvn -f../../../pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout | sed -rn 's/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/p'` FUSE_LIB="FUSE-T" -ARCH="undefined" +JAVAFX_VERISON=21.0.1 +JAVAFX_ARCH="undefined" +JAVAFX_JMODS_SHA256="undefined" if [ "$(machine)" = "arm64e" ]; then - ARCH="aarch64" + JAVAFX_ARCH="aarch64" + JAVAFX_JMODS_SHA256="7afaa1c57a6cc3c384d636e597b9a5364693e2db4aaec0a6e63d2fa964400b58" else - ARCH="x64" + JAVAFX_ARCH="x64" + JAVAFX_JMODS_SHA256="bd6abab20da73d5a968dcf2fd915d81b5fb919340e3bb84979ee9a888a829939" fi -OPENJFX_JMODS="https://download2.gluonhq.com/openjfx/21.0.1/openjfx-21.0.1_osx-${ARCH}_bin-jmods.zip" +JAVAFX_JMODS_URL="https://download2.gluonhq.com/openjfx/${JAVAFX_VERSION}/openjfx-${JAVAFX_VERSION}_osx-${JAVAFX_ARCH}_bin-jmods.zip" # check preconditions if [ -z "${JAVA_HOME}" ]; then echo "JAVA_HOME not set. Run using JAVA_HOME=/path/to/jdk ./build.sh"; exit 1; fi @@ -47,7 +51,8 @@ if [ -n "${CODESIGN_IDENTITY}" ]; then fi # download and check jmods -curl -L ${OPENJFX_JMODS} -o openjfx-jmods.zip +curl -L ${JAVAFX_JMODS_URL} -o openjfx-jmods.zip +echo "${JAVAFX_JMODS_SHA256} openjfx-jmods.zip" | shasum -a256 --check mkdir -p openjfx-jmods/ unzip -jo openjfx-jmods.zip \*/javafx.base.jmod \*/javafx.controls.jmod \*/javafx.fxml.jmod \*/javafx.graphics.jmod -d openjfx-jmods JMOD_VERSION=$(jmod describe openjfx-jmods/javafx.base.jmod | head -1) diff --git a/dist/win/build.ps1 b/dist/win/build.ps1 index 117c0afb8..f05a87b8c 100644 --- a/dist/win/build.ps1 +++ b/dist/win/build.ps1 @@ -51,21 +51,22 @@ if ($clean -and (Test-Path -Path $runtimeImagePath)) { } ## download jfx jmods -$jmodsVersion='21.0.1' -$jmodsUrl = "https://download2.gluonhq.com/openjfx/${jmodsVersion}/openjfx-${jmodsVersion}_windows-x64_bin-jmods.zip" -$jfxJmodsChecksum = 'daf8acae631c016c24cfe23f88469400274d3441dd890615a42dfb501f3eb94a' -$jfxJmodsZip = '.\resources\jfxJmods.zip' -if( !(Test-Path -Path $jfxJmodsZip) ) { - Write-Output "Downloading ${jmodsUrl}..." - Invoke-WebRequest $jmodsUrl -OutFile $jfxJmodsZip # redirects are followed by default +$javaFxVersion='21.0.1' +$javaFxJmodsUrl = "https://download2.gluonhq.com/openjfx/${javaFxVersion}/openjfx-${javaFxVersion}_windows-x64_bin-jmods.zip" +$javaFxJmodsSHA256 = 'daf8acae631c016c24cfe23f88469400274d3441dd890615a42dfb501f3eb94a' +$javaFxJmods = '.\resources\jfxJmods.zip' +if( !(Test-Path -Path $javaFxJmods) ) { + Write-Output "Downloading ${javaFxJmodsUrl}..." + Invoke-WebRequest $javaFxJmodsUrl -OutFile $javaFxJmods # redirects are followed by default } -$jmodsChecksumActual = $(Get-FileHash -Path $jfxJmodsZip -Algorithm SHA256).Hash -if( $jmodsChecksumActual -ne $jfxJmodsChecksum ) { - Write-Error "Checksum mismatch for jfxJmods.zip. Expected: $jfxJmodsChecksum, actual: $jmodsChecksumActual" +$jmodsChecksumActual = $(Get-FileHash -Path $javaFxJmods -Algorithm SHA256).Hash +if( $jmodsChecksumActual -ne $javaFxJmodsSHA256 ) { + Write-Error "Checksum mismatch for jfxJmods.zip. Expected: $javaFxJmodsSHA256 +, actual: $jmodsChecksumActual" exit 1; } -Expand-Archive -Path $jfxJmodsZip -Force -DestinationPath ".\resources\" +Expand-Archive -Path $javaFxJmods -Force -DestinationPath ".\resources\" Remove-Item -Recurse -Force -Path ".\resources\javafx-jmods" Move-Item -Force -Path ".\resources\javafx-jmods-*" -Destination ".\resources\javafx-jmods" -ErrorAction Stop From 0bf8fb39dd88941c98c4e0604b8db84b6fa5c5a5 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Fri, 7 Jun 2024 14:58:18 +0200 Subject: [PATCH 64/82] Update to javafx 22.0.1 --- .github/workflows/appimage.yml | 8 ++++---- .github/workflows/debian.yml | 8 ++++---- .github/workflows/mac-dmg.yml | 8 ++++---- .github/workflows/win-exe.yml | 4 ++-- dist/linux/appimage/build.sh | 6 +++--- dist/mac/dmg/build.sh | 6 +++--- dist/win/build.ps1 | 4 ++-- pom.xml | 2 +- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 5d0dc2d5b..ae9aff7db 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -29,12 +29,12 @@ jobs: include: - os: ubuntu-latest appimage-suffix: x86_64 - openjfx-url: 'https://download2.gluonhq.com/openjfx/21.0.1/openjfx-21.0.1_linux-x64_bin-jmods.zip' - openjfx-sha: '7baed11ca56d5fee85995fa6612d4299f1e8b7337287228f7f12fd50407c56f8' + openjfx-url: 'https://download2.gluonhq.com/openjfx/22.0.1/openjfx-22.0.1_linux-x64_bin-jmods.zip' + openjfx-sha: 'fbb22f35951c2e049cc2554dd03c2c56b4f5adc4b2ae9248872f46175ac103d8' - os: [self-hosted, Linux, ARM64] appimage-suffix: aarch64 - openjfx-url: 'https://download2.gluonhq.com/openjfx/21.0.1/openjfx-21.0.1_linux-aarch64_bin-jmods.zip' - openjfx-sha: '871e7b9d7af16aef2e55c1b7830d0e0b2503b13dd8641374ba7e55ecb81d2ef9' + openjfx-url: 'https://download2.gluonhq.com/openjfx/22.0.1/openjfx-22.0.1_linux-aarch64_bin-jmods.zip' + openjfx-sha: '1982ad168a5e8d7cf4a9458a7d088b4f0552d0ac3f24f23fb88f8bc7e8d69a13' steps: - uses: actions/checkout@v4 - name: Setup Java diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 9c220843b..3f628c121 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -20,10 +20,10 @@ env: JAVA_VERSION: '22.0.1+8' COFFEELIBS_JDK: 22 COFFEELIBS_JDK_VERSION: '22.0.1+8-0ppa1' - OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/21.0.1/openjfx-21.0.1_linux-x64_bin-jmods.zip' - OPENJFX_JMODS_AMD64_HASH: '7baed11ca56d5fee85995fa6612d4299f1e8b7337287228f7f12fd50407c56f8' - OPENJFX_JMODS_AARCH64: 'https://download2.gluonhq.com/openjfx/21.0.1/openjfx-21.0.1_linux-aarch64_bin-jmods.zip' - OPENJFX_JMODS_AARCH64_HASH: '871e7b9d7af16aef2e55c1b7830d0e0b2503b13dd8641374ba7e55ecb81d2ef9' + OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/22.0.1/openjfx-22.0.1_linux-x64_bin-jmods.zip' + OPENJFX_JMODS_AMD64_HASH: 'fbb22f35951c2e049cc2554dd03c2c56b4f5adc4b2ae9248872f46175ac103d8' + OPENJFX_JMODS_AARCH64: 'https://download2.gluonhq.com/openjfx/22.0.1/openjfx-22.0.1_linux-aarch64_bin-jmods.zip' + OPENJFX_JMODS_AARCH64_HASH: '1982ad168a5e8d7cf4a9458a7d088b4f0552d0ac3f24f23fb88f8bc7e8d69a13' jobs: build: diff --git a/.github/workflows/mac-dmg.yml b/.github/workflows/mac-dmg.yml index 7e6bde81b..fbc6def3d 100644 --- a/.github/workflows/mac-dmg.yml +++ b/.github/workflows/mac-dmg.yml @@ -37,15 +37,15 @@ jobs: output-suffix: x64 xcode-path: '/Applications/Xcode_13.2.1.app' fuse-lib: macFUSE - openjfx-url: 'https://download2.gluonhq.com/openjfx/21.0.1/openjfx-21.0.1_osx-x64_bin-jmods.zip' - openjfx-sha: 'bd6abab20da73d5a968dcf2fd915d81b5fb919340e3bb84979ee9a888a829939' + openjfx-url: 'https://download2.gluonhq.com/openjfx/22.0.1/openjfx-22.0.1_osx-x64_bin-jmods.zip' + openjfx-sha: 'e07a11c112abbdebe7c058b44c151e1e475de748671d896aef3d73f32453c248' - os: [self-hosted, macOS, ARM64] architecture: aarch64 output-suffix: arm64 xcode-path: '/Applications/Xcode_13.2.1.app' fuse-lib: FUSE-T - openjfx-url: 'https://download2.gluonhq.com/openjfx/21.0.1/openjfx-21.0.1_osx-aarch64_bin-jmods.zip' - openjfx-sha: '7afaa1c57a6cc3c384d636e597b9a5364693e2db4aaec0a6e63d2fa964400b58' + openjfx-url: 'https://download2.gluonhq.com/openjfx/22.0.1/openjfx-22.0.1_osx-aarch64_bin-jmods.zip' + openjfx-sha: '572fce94b9b09d316b960a49e3c2b5d35231ed0463e3b1c4020b8de89783b51d' steps: - uses: actions/checkout@v4 - name: Setup Java diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index b6abcf0ec..e3d5d9d87 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -17,8 +17,8 @@ on: env: JAVA_DIST: 'zulu' JAVA_VERSION: '22.0.1+8' - OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/21.0.1/openjfx-21.0.1_windows-x64_bin-jmods.zip' - OPENJFX_JMODS_AMD64_HASH: 'daf8acae631c016c24cfe23f88469400274d3441dd890615a42dfb501f3eb94a' + OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/22.0.1/openjfx-22.0.1_windows-x64_bin-jmods.zip' + OPENJFX_JMODS_AMD64_HASH: 'de82e53179032a49bec005deb4438e8f261d08c4b58864a5c17e1d87286b09dd' WINFSP_MSI: 'https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi' WINFSP_UNINSTALLER: 'https://github.com/cryptomator/winfsp-uninstaller/releases/latest/download/winfsp-uninstaller.exe' diff --git a/dist/linux/appimage/build.sh b/dist/linux/appimage/build.sh index d939e9434..6266c26bd 100755 --- a/dist/linux/appimage/build.sh +++ b/dist/linux/appimage/build.sh @@ -23,12 +23,12 @@ mvn -B -f ../../../pom.xml clean package -Plinux -DskipTests cp ../../../LICENSE.txt ../../../target cp ../../../target/cryptomator-*.jar ../../../target/mods -JAVAFX_VERSION=21.0.1 +JAVAFX_VERSION=22.0.1 JAVAFX_ARCH="x64" -JAVAFX_JMODS_SHA256='7baed11ca56d5fee85995fa6612d4299f1e8b7337287228f7f12fd50407c56f8' +JAVAFX_JMODS_SHA256='fbb22f35951c2e049cc2554dd03c2c56b4f5adc4b2ae9248872f46175ac103d8' if [ "${CPU_ARCH}" = "aarch64" ]; then JAVAFX_ARCH="aarch64" - JAVAFX_JMODS_SHA256='871e7b9d7af16aef2e55c1b7830d0e0b2503b13dd8641374ba7e55ecb81d2ef9' + JAVAFX_JMODS_SHA256='1982ad168a5e8d7cf4a9458a7d088b4f0552d0ac3f24f23fb88f8bc7e8d69a13' fi # download javaFX jmods diff --git a/dist/mac/dmg/build.sh b/dist/mac/dmg/build.sh index 4f4ed3069..56fc264b2 100755 --- a/dist/mac/dmg/build.sh +++ b/dist/mac/dmg/build.sh @@ -29,15 +29,15 @@ REVISION_NO=`git rev-list --count HEAD` VERSION_NO=`mvn -f../../../pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout | sed -rn 's/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/p'` FUSE_LIB="FUSE-T" -JAVAFX_VERISON=21.0.1 +JAVAFX_VERISON=22.0.1 JAVAFX_ARCH="undefined" JAVAFX_JMODS_SHA256="undefined" if [ "$(machine)" = "arm64e" ]; then JAVAFX_ARCH="aarch64" - JAVAFX_JMODS_SHA256="7afaa1c57a6cc3c384d636e597b9a5364693e2db4aaec0a6e63d2fa964400b58" + JAVAFX_JMODS_SHA256="572fce94b9b09d316b960a49e3c2b5d35231ed0463e3b1c4020b8de89783b51d" else JAVAFX_ARCH="x64" - JAVAFX_JMODS_SHA256="bd6abab20da73d5a968dcf2fd915d81b5fb919340e3bb84979ee9a888a829939" + JAVAFX_JMODS_SHA256="e07a11c112abbdebe7c058b44c151e1e475de748671d896aef3d73f32453c248" fi JAVAFX_JMODS_URL="https://download2.gluonhq.com/openjfx/${JAVAFX_VERSION}/openjfx-${JAVAFX_VERSION}_osx-${JAVAFX_ARCH}_bin-jmods.zip" diff --git a/dist/win/build.ps1 b/dist/win/build.ps1 index f05a87b8c..e88c3c8e7 100644 --- a/dist/win/build.ps1 +++ b/dist/win/build.ps1 @@ -51,9 +51,9 @@ if ($clean -and (Test-Path -Path $runtimeImagePath)) { } ## download jfx jmods -$javaFxVersion='21.0.1' +$javaFxVersion='22.0.1' $javaFxJmodsUrl = "https://download2.gluonhq.com/openjfx/${javaFxVersion}/openjfx-${javaFxVersion}_windows-x64_bin-jmods.zip" -$javaFxJmodsSHA256 = 'daf8acae631c016c24cfe23f88469400274d3441dd890615a42dfb501f3eb94a' +$javaFxJmodsSHA256 = 'de82e53179032a49bec005deb4438e8f261d08c4b58864a5c17e1d87286b09dd' $javaFxJmods = '.\resources\jfxJmods.zip' if( !(Test-Path -Path $javaFxJmods) ) { Write-Output "Downloading ${javaFxJmodsUrl}..." diff --git a/pom.xml b/pom.xml index e9cb5cc7c..de19ab9a8 100644 --- a/pom.xml +++ b/pom.xml @@ -47,7 +47,7 @@ 2.2 33.2.1-jre 2.17.1 - 21.0.1 + 22.0.1 4.4.0 9.37.3 1.5.6 From 92bf73297a53d017c9191673dccdbc95927e87c9 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 11 Jun 2024 14:43:56 +0200 Subject: [PATCH 65/82] add dokany info dialog --- .../org/cryptomator/ui/common/FxmlFile.java | 1 + .../DokanyInfoDialogComponent.java | 34 +++++++++++ .../DokanyInfoDialogController.java | 33 +++++++++++ .../DokanyInfoDialogModule.java | 57 +++++++++++++++++++ .../DokanyInfoDialogScoped.java | 13 +++++ .../DokanyInfoDialogWindow.java | 14 +++++ .../cryptomator/ui/fxapp/FxApplication.java | 18 ++++++ .../ui/fxapp/FxApplicationModule.java | 2 + .../ui/fxapp/FxApplicationWindows.java | 11 +++- src/main/resources/fxml/dokany_info.fxml | 53 +++++++++++++++++ src/main/resources/i18n/strings.properties | 5 ++ 11 files changed, 240 insertions(+), 1 deletion(-) create mode 100644 src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogComponent.java create mode 100644 src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogController.java create mode 100644 src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogModule.java create mode 100644 src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogScoped.java create mode 100644 src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogWindow.java create mode 100644 src/main/resources/fxml/dokany_info.fxml diff --git a/src/main/java/org/cryptomator/ui/common/FxmlFile.java b/src/main/java/org/cryptomator/ui/common/FxmlFile.java index 1a2374f85..c8529a8b6 100644 --- a/src/main/java/org/cryptomator/ui/common/FxmlFile.java +++ b/src/main/java/org/cryptomator/ui/common/FxmlFile.java @@ -12,6 +12,7 @@ public enum FxmlFile { CONVERTVAULT_HUBTOPASSWORD_START("/fxml/convertvault_hubtopassword_start.fxml"), // CONVERTVAULT_HUBTOPASSWORD_CONVERT("/fxml/convertvault_hubtopassword_convert.fxml"), // CONVERTVAULT_HUBTOPASSWORD_SUCCESS("/fxml/convertvault_hubtopassword_success.fxml"), // + DOKANY_INFO_DIALOG("/fxml/dokany_info.fxml"), // ERROR("/fxml/error.fxml"), // FORGET_PASSWORD("/fxml/forget_password.fxml"), // HEALTH_START("/fxml/health_start.fxml"), // diff --git a/src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogComponent.java b/src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogComponent.java new file mode 100644 index 000000000..4c4f3b552 --- /dev/null +++ b/src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogComponent.java @@ -0,0 +1,34 @@ +package org.cryptomator.ui.dokanyinfodialog; + +import dagger.Lazy; +import dagger.Subcomponent; +import org.cryptomator.ui.common.FxmlFile; +import org.cryptomator.ui.common.FxmlScene; + +import javafx.scene.Scene; +import javafx.stage.Stage; + +@DokanyInfoDialogScoped +@Subcomponent(modules = {DokanyInfoDialogModule.class}) +public interface DokanyInfoDialogComponent { + + @DokanyInfoDialogWindow + Stage window(); + + @FxmlScene(FxmlFile.DOKANY_INFO_DIALOG) + Lazy dokanyInfoScene(); + + + default void showDokanyInfoWindow() { + Stage stage = window(); + stage.setScene(dokanyInfoScene().get()); + stage.sizeToScene(); + stage.show(); + } + + @Subcomponent.Factory + interface Factory { + + DokanyInfoDialogComponent create(); + } +} \ No newline at end of file diff --git a/src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogController.java b/src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogController.java new file mode 100644 index 000000000..06f4f34d6 --- /dev/null +++ b/src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogController.java @@ -0,0 +1,33 @@ +package org.cryptomator.ui.dokanyinfodialog; + +import org.cryptomator.ui.common.FxController; +import org.cryptomator.ui.fxapp.FxApplicationWindows; +import org.cryptomator.ui.preferences.SelectedPreferencesTab; + +import javax.inject.Inject; +import javafx.fxml.FXML; +import javafx.stage.Stage; + + +@DokanyInfoDialogScoped +public class DokanyInfoDialogController implements FxController { + + private final Stage window; + private final FxApplicationWindows applicationWindows; + + @Inject + DokanyInfoDialogController(@DokanyInfoDialogWindow Stage window, FxApplicationWindows applicationWindows) { + this.window = window; + this.applicationWindows = applicationWindows; + } + + @FXML + public void close() { + window.close(); + } + + public void openVolumePreferences() { + applicationWindows.showPreferencesWindow(SelectedPreferencesTab.VOLUME); + } + +} \ No newline at end of file diff --git a/src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogModule.java b/src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogModule.java new file mode 100644 index 000000000..ec6817a2f --- /dev/null +++ b/src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogModule.java @@ -0,0 +1,57 @@ +package org.cryptomator.ui.dokanyinfodialog; + +import dagger.Binds; +import dagger.Module; +import dagger.Provides; +import dagger.multibindings.IntoMap; +import org.cryptomator.ui.common.DefaultSceneFactory; +import org.cryptomator.ui.common.FxController; +import org.cryptomator.ui.common.FxControllerKey; +import org.cryptomator.ui.common.FxmlFile; +import org.cryptomator.ui.common.FxmlLoaderFactory; +import org.cryptomator.ui.common.FxmlScene; +import org.cryptomator.ui.common.StageFactory; + +import javax.inject.Provider; +import javafx.scene.Scene; +import javafx.stage.Modality; +import javafx.stage.Stage; +import java.util.Map; +import java.util.ResourceBundle; + +@Module +abstract class DokanyInfoDialogModule { + + @Provides + @DokanyInfoDialogWindow + @DokanyInfoDialogScoped + static FxmlLoaderFactory provideFxmlLoaderFactory(Map, Provider> factories, DefaultSceneFactory sceneFactory, ResourceBundle resourceBundle) { + return new FxmlLoaderFactory(factories, sceneFactory, resourceBundle); + } + + @Provides + @DokanyInfoDialogWindow + @DokanyInfoDialogScoped + static Stage provideStage(StageFactory factory, ResourceBundle resourceBundle) { + Stage stage = factory.create(); + stage.setTitle(resourceBundle.getString("dokanyInfo.title")); + stage.setMinWidth(500); + stage.setMinHeight(100); + stage.initModality(Modality.APPLICATION_MODAL); + return stage; + } + + @Provides + @FxmlScene(FxmlFile.DOKANY_INFO_DIALOG) + @DokanyInfoDialogScoped + static Scene provideDokanyInfoDialogScene(@DokanyInfoDialogWindow FxmlLoaderFactory fxmlLoaders) { + return fxmlLoaders.createScene(FxmlFile.DOKANY_INFO_DIALOG); + } + + + @Binds + @IntoMap + @FxControllerKey(DokanyInfoDialogController.class) + abstract FxController bindDokanyInfoDialogController(DokanyInfoDialogController controller); + +} diff --git a/src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogScoped.java b/src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogScoped.java new file mode 100644 index 000000000..adb721cac --- /dev/null +++ b/src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogScoped.java @@ -0,0 +1,13 @@ +package org.cryptomator.ui.dokanyinfodialog; + +import javax.inject.Scope; +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Scope +@Documented +@Retention(RetentionPolicy.RUNTIME) +@interface DokanyInfoDialogScoped { + +} diff --git a/src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogWindow.java b/src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogWindow.java new file mode 100644 index 000000000..ac3b9544e --- /dev/null +++ b/src/main/java/org/cryptomator/ui/dokanyinfodialog/DokanyInfoDialogWindow.java @@ -0,0 +1,14 @@ +package org.cryptomator.ui.dokanyinfodialog; + +import javax.inject.Qualifier; +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; + +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +@Qualifier +@Documented +@Retention(RUNTIME) +@interface DokanyInfoDialogWindow { + +} diff --git a/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java b/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java index 711a0fa44..605411748 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java +++ b/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java @@ -3,6 +3,7 @@ package org.cryptomator.ui.fxapp; import dagger.Lazy; import org.cryptomator.common.Environment; import org.cryptomator.common.settings.Settings; +import org.cryptomator.common.settings.VaultSettings; import org.cryptomator.ui.traymenu.TrayMenuComponent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -75,6 +76,23 @@ public class FxApplication { appWindows.checkAndShowUpdateReminderWindow(); } + var dokany = "org.cryptomator.frontend.dokany.mount.DokanyMountProvider"; + boolean dokanyInfoWindowShown = false; + if (settings.mountService.getValueSafe().equals(dokany)) { + appWindows.showDokanyInfoWindow(); + dokanyInfoWindowShown = true; + settings.mountService.set(null); + } + for (VaultSettings vaultSettings : settings.directories) { + if (vaultSettings.mountService.getValueSafe().equals(dokany)) { + if (!dokanyInfoWindowShown) { + appWindows.showDokanyInfoWindow(); + dokanyInfoWindowShown = true; + } + vaultSettings.mountService.set(null); + } + } + launchEventHandler.startHandlingLaunchEvents(); autoUnlocker.tryUnlockForTimespan(2, TimeUnit.MINUTES); } diff --git a/src/main/java/org/cryptomator/ui/fxapp/FxApplicationModule.java b/src/main/java/org/cryptomator/ui/fxapp/FxApplicationModule.java index af98e284c..d6734a3a3 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/FxApplicationModule.java +++ b/src/main/java/org/cryptomator/ui/fxapp/FxApplicationModule.java @@ -7,6 +7,7 @@ package org.cryptomator.ui.fxapp; import dagger.Module; import dagger.Provides; +import org.cryptomator.ui.dokanyinfodialog.DokanyInfoDialogComponent; import org.cryptomator.ui.error.ErrorComponent; import org.cryptomator.ui.health.HealthCheckComponent; import org.cryptomator.ui.lock.LockComponent; @@ -33,6 +34,7 @@ import java.io.InputStream; ErrorComponent.class, // HealthCheckComponent.class, // UpdateReminderComponent.class, // + DokanyInfoDialogComponent.class, // ShareVaultComponent.class}) abstract class FxApplicationModule { diff --git a/src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java b/src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java index 41a7ca785..9e0f11abf 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java +++ b/src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java @@ -5,6 +5,7 @@ import dagger.Lazy; import org.cryptomator.common.vaults.Vault; import org.cryptomator.common.vaults.VaultState; import org.cryptomator.integrations.tray.TrayIntegrationProvider; +import org.cryptomator.ui.dokanyinfodialog.DokanyInfoDialogComponent; import org.cryptomator.ui.error.ErrorComponent; import org.cryptomator.ui.lock.LockComponent; import org.cryptomator.ui.mainwindow.MainWindowComponent; @@ -48,6 +49,7 @@ public class FxApplicationWindows { private final QuitComponent.Builder quitWindowBuilder; private final UnlockComponent.Factory unlockWorkflowFactory; private final UpdateReminderComponent.Factory updateReminderWindowBuilder; + private final DokanyInfoDialogComponent.Factory dokanyInfoWindowBuilder; private final LockComponent.Factory lockWorkflowFactory; private final ErrorComponent.Factory errorWindowFactory; private final ExecutorService executor; @@ -56,13 +58,14 @@ public class FxApplicationWindows { private final FilteredList visibleWindows; @Inject - public FxApplicationWindows(@PrimaryStage Stage primaryStage, + public FxApplicationWindows(@PrimaryStage Stage primaryStage, // Optional trayIntegration, // Lazy mainWindow, // Lazy preferencesWindow, // QuitComponent.Builder quitWindowBuilder, // UnlockComponent.Factory unlockWorkflowFactory, // UpdateReminderComponent.Factory updateReminderWindowBuilder, // + DokanyInfoDialogComponent.Factory dokanyInfoWindowBuilder, // LockComponent.Factory lockWorkflowFactory, // ErrorComponent.Factory errorWindowFactory, // VaultOptionsComponent.Factory vaultOptionsWindow, // @@ -75,6 +78,7 @@ public class FxApplicationWindows { this.quitWindowBuilder = quitWindowBuilder; this.unlockWorkflowFactory = unlockWorkflowFactory; this.updateReminderWindowBuilder = updateReminderWindowBuilder; + this.dokanyInfoWindowBuilder = dokanyInfoWindowBuilder; this.lockWorkflowFactory = lockWorkflowFactory; this.errorWindowFactory = errorWindowFactory; this.executor = executor; @@ -142,6 +146,11 @@ public class FxApplicationWindows { CompletableFuture.runAsync(() -> updateReminderWindowBuilder.create().checkAndShowUpdateReminderWindow(), Platform::runLater); } + public void showDokanyInfoWindow() { + CompletableFuture.runAsync(() -> dokanyInfoWindowBuilder.create().showDokanyInfoWindow(), Platform::runLater); + } + + public CompletionStage startUnlockWorkflow(Vault vault, @Nullable Stage owner) { return CompletableFuture.supplyAsync(() -> { Preconditions.checkState(vault.stateProperty().transition(VaultState.Value.LOCKED, VaultState.Value.PROCESSING), "Vault not locked."); diff --git a/src/main/resources/fxml/dokany_info.fxml b/src/main/resources/fxml/dokany_info.fxml new file mode 100644 index 000000000..abf44a074 --- /dev/null +++ b/src/main/resources/fxml/dokany_info.fxml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +