diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 000000000..5ab2e03f7 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,29 @@ +# .github/release.yml +# see https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes + +changelog: + exclude: + authors: + - cryptobot + - dependabot + - github-actions + categories: + - title: What's New 🎉 + labels: + - type:feature-request + - type:enhancement + - title: Bugfixes 🐛 + labels: + - type:security-issue + - type:bug + - type:minor-bug + - title: Other Changes 📎 + labels: + - "*" + exclude: + labels: + - type:feature-request + - type:enhancement + - type:security-issue + - type:bug + - type:minor-bug \ No newline at end of file diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index c0f0850e7..552cbee65 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -10,7 +10,7 @@ on: required: false env: - JAVA_VERSION: 19 + JAVA_VERSION: 20 jobs: get-version: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b31bfa08a..bf21af27c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ on: types: [labeled] env: - JAVA_VERSION: 19 + JAVA_VERSION: 20 defaults: run: @@ -53,4 +53,8 @@ jobs: body: |- :construction: Work in Progress + Please be patient, the builds are still running. We will publish new versions of Cryptomator here in a few moments. + + As usual, the GPG signatures can be checked using [our public key `5811 7AFA 1F85 B3EE C154 677D 615D 449F E6E6 A235`](https://gist.github.com/cryptobot/211111cf092037490275f39d408f461a). --- + \ No newline at end of file diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 700322c06..bd353a434 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -19,9 +19,9 @@ on: type: boolean env: - JAVA_VERSION: 19 - OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/19.0.2.1/openjfx-19.0.2.1_linux-x64_bin-jmods.zip' - OPENJFX_JMODS_AARCH64: 'https://download2.gluonhq.com/openjfx/19.0.2.1/openjfx-19.0.2.1_linux-aarch64_bin-jmods.zip' + JAVA_VERSION: 20 + OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/20.0.1/openjfx-20.0.1_linux-x64_bin-jmods.zip' + OPENJFX_JMODS_AARCH64: 'https://download2.gluonhq.com/openjfx/20.0.1/openjfx-20.0.1_linux-aarch64_bin-jmods.zip' jobs: build: @@ -45,7 +45,7 @@ jobs: run: | sudo add-apt-repository ppa:coffeelibs/openjdk sudo apt-get update - sudo apt-get install debhelper devscripts dput coffeelibs-jdk-19 libgtk2.0-0 + sudo apt-get install debhelper devscripts dput coffeelibs-jdk-${{ env.JAVA_VERSION }} libgtk2.0-0 - name: Setup Java uses: actions/setup-java@v3 with: diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml index 5cffb56fb..d8684dc20 100644 --- a/.github/workflows/get-version.yml +++ b/.github/workflows/get-version.yml @@ -22,7 +22,7 @@ on: value: ${{ jobs.determine-version.outputs.type }} env: - JAVA_VERSION: 19 + JAVA_VERSION: 20 JAVA_DIST: 'temurin' JAVA_CACHE: 'maven' diff --git a/.github/workflows/mac-dmg.yml b/.github/workflows/mac-dmg.yml index 27320dba8..bad80138b 100644 --- a/.github/workflows/mac-dmg.yml +++ b/.github/workflows/mac-dmg.yml @@ -10,7 +10,7 @@ on: required: false env: - JAVA_VERSION: 19 + JAVA_VERSION: 20 jobs: get-version: diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 48f7bd185..73a21edde 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -4,7 +4,7 @@ on: pull_request: env: - JAVA_VERSION: 19 + JAVA_VERSION: 20 defaults: run: diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml index 7309cb852..481861540 100644 --- a/.github/workflows/release-check.yml +++ b/.github/workflows/release-check.yml @@ -7,7 +7,7 @@ on: - 'hotfix/**' env: - JAVA_VERSION: 19 + JAVA_VERSION: 20 defaults: run: diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index 45ce36c2e..df67c1dcb 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -14,11 +14,11 @@ on: env: - JAVA_VERSION: 19 + JAVA_VERSION: 20 JAVA_DIST: 'temurin' JAVA_CACHE: 'maven' - JFX_JMODS_URL: 'https://download2.gluonhq.com/openjfx/19.0.2.1/openjfx-19.0.2.1_windows-x64_bin-jmods.zip' - JFX_JMODS_HASH: 'B7CF2CAD2468842B3B78D99F6C0555771499A36FA1F1EE3DD1B9A4597F1FAB86' + JFX_JMODS_URL: 'https://download2.gluonhq.com/openjfx/20.0.1/openjfx-20.0.1_windows-x64_bin-jmods.zip' + JFX_JMODS_HASH: 'D00767334C43B8832B5CF10267D34CA8F563D187C4655B73EB6020DD79C054B5' defaults: run: @@ -51,7 +51,7 @@ jobs: run: | curl --output jfxjmods.zip -L "${{ env.JFX_JMODS_URL }}" if(!(Get-FileHash -Path jfxjmods.zip -Algorithm SHA256).Hash.equals("${{ env.JFX_JMODS_HASH }}")) { - exit 1; + throw "Wrong checksum of JMOD archive downloaded from ${{ env.JFX_JMODS_URL }}."; } Expand-Archive -Path jfxjmods.zip -DestinationPath jfxjmods Get-ChildItem -Path jfxjmods -Recurse -Filter "*.jmod" | ForEach-Object { Move-Item -Path $_ -Destination $_.Directory.Parent} diff --git a/.idea/misc.xml b/.idea/misc.xml index e5d629592..891096945 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -8,7 +8,7 @@ - + \ No newline at end of file diff --git a/dist/linux/debian/control b/dist/linux/debian/control index edf9dd3ce..b04812fbb 100644 --- a/dist/linux/debian/control +++ b/dist/linux/debian/control @@ -2,7 +2,7 @@ Source: cryptomator Maintainer: Cryptobot Section: utils Priority: optional -Build-Depends: debhelper (>=10), coffeelibs-jdk-19, libgtk2.0-0, libgtk-3-0, libxxf86vm1, libgl1 +Build-Depends: debhelper (>=10), coffeelibs-jdk-20, libgtk2.0-0, libgtk-3-0, libxxf86vm1, libgl1 Standards-Version: 4.5.0 Homepage: https://cryptomator.org Vcs-Git: https://github.com/cryptomator/cryptomator.git diff --git a/dist/linux/debian/rules b/dist/linux/debian/rules index be1014ea9..e0f077cc9 100755 --- a/dist/linux/debian/rules +++ b/dist/linux/debian/rules @@ -4,7 +4,7 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -JAVA_HOME = /usr/lib/jvm/java-19-coffeelibs +JAVA_HOME = /usr/lib/jvm/java-20-coffeelibs DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) ifeq ($(DEB_BUILD_ARCH),amd64) JMODS_PATH = jmods/amd64:${JAVA_HOME}/jmods diff --git a/dist/win/resources/main.wxs b/dist/win/resources/main.wxs index 50edd6371..df73b195f 100644 --- a/dist/win/resources/main.wxs +++ b/dist/win/resources/main.wxs @@ -70,6 +70,9 @@ + + + @@ -172,11 +175,12 @@ - JP_UPGRADABLE_FOUND + JP_UPGRADABLE_FOUND - JP_DOWNGRADABLE_FOUND + JP_DOWNGRADABLE_FOUND + @@ -188,6 +192,10 @@ NOT Installed OR REINSTALL + + + + diff --git a/pom.xml b/pom.xml index bf8405d91..af89f6bc3 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ UTF-8 - 19 + 20 @@ -37,8 +37,8 @@ 1.3.0-beta1 1.2.0 1.2.0 - 2.0.0-alpha1 - 2.0.5 + 1.3.0-beta1 + 3.0.0 2.0.0 2.0.2 @@ -48,7 +48,7 @@ 2.2 31.1-jre 2.10.1 - 19.0.2.1 + 20.0.1 4.3.0 9.31 1.4.5 @@ -64,7 +64,7 @@ 23.0.0 8.1.0 - 0.8.8 + 0.8.9 @@ -332,6 +332,9 @@ org.apache.maven.plugins maven-surefire-plugin + + --enable-preview + org.apache.maven.plugins diff --git a/src/main/java/org/cryptomator/common/LocationPreset.java b/src/main/java/org/cryptomator/common/LocationPreset.java index 17d276bf8..7861c6266 100644 --- a/src/main/java/org/cryptomator/common/LocationPreset.java +++ b/src/main/java/org/cryptomator/common/LocationPreset.java @@ -10,7 +10,7 @@ import java.util.List; */ public enum LocationPreset { - DROPBOX("Dropbox", "~/Dropbox"), + DROPBOX("Dropbox", "~/Library/CloudStorage/Dropbox", "~/Dropbox"), ICLOUDDRIVE("iCloud Drive", "~/Library/Mobile Documents/com~apple~CloudDocs", "~/iCloudDrive"), GDRIVE("Google Drive", "~/Google Drive/My Drive", "~/Google Drive"), MEGA("MEGA", "~/MEGA"), diff --git a/src/main/java/org/cryptomator/ipc/IpcMessage.java b/src/main/java/org/cryptomator/ipc/IpcMessage.java index 9d1c8d3de..7f76da295 100644 --- a/src/main/java/org/cryptomator/ipc/IpcMessage.java +++ b/src/main/java/org/cryptomator/ipc/IpcMessage.java @@ -9,8 +9,8 @@ import java.nio.channels.ReadableByteChannel; import java.nio.channels.WritableByteChannel; import java.util.function.Function; -// TODO make sealed, remove enum -interface IpcMessage { +//TODO can the enum be removed? +sealed interface IpcMessage permits HandleLaunchArgsMessage, RevealRunningAppMessage { enum MessageType { REVEAL_RUNNING_APP(RevealRunningAppMessage::decode), diff --git a/src/main/java/org/cryptomator/ipc/IpcMessageListener.java b/src/main/java/org/cryptomator/ipc/IpcMessageListener.java index f49275824..756305cbe 100644 --- a/src/main/java/org/cryptomator/ipc/IpcMessageListener.java +++ b/src/main/java/org/cryptomator/ipc/IpcMessageListener.java @@ -5,10 +5,9 @@ import java.util.List; public interface IpcMessageListener { default void handleMessage(IpcMessage message) { - if (message instanceof RevealRunningAppMessage) { - revealRunningApp(); - } else if (message instanceof HandleLaunchArgsMessage m) { - handleLaunchArgs(m.args()); + switch (message) { + case RevealRunningAppMessage m -> revealRunningApp(); // TODO: rename to _ with JEP 443 + case HandleLaunchArgsMessage m -> handleLaunchArgs(m.args()); } } diff --git a/src/main/java/org/cryptomator/launcher/SupportedLanguages.java b/src/main/java/org/cryptomator/launcher/SupportedLanguages.java index 760fb1168..0838c420e 100644 --- a/src/main/java/org/cryptomator/launcher/SupportedLanguages.java +++ b/src/main/java/org/cryptomator/launcher/SupportedLanguages.java @@ -1,12 +1,14 @@ package org.cryptomator.launcher; import org.cryptomator.common.settings.Settings; -import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.inject.Inject; import javax.inject.Singleton; +import java.text.Collator; +import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Locale; @@ -14,26 +16,39 @@ import java.util.Locale; public class SupportedLanguages { private static final Logger LOG = LoggerFactory.getLogger(SupportedLanguages.class); - // these are BCP 47 language codes, not ISO. Note the "-" instead of the "_": - public static final List LANGUAGAE_TAGS = List.of("en", "ar", "be", "bn", "bs", "ca", "cs", "da", "de", "el", "es", "fil", "fa", "fr", "gl", "he", // - "hi", "hr", "hu", "id", "it", "ja", "ko", "lv", "mk", "nb", "nl", "nn", "no", "pa", "pl", "pt", "pt-BR", "ro", "ru", "si", "sk", "sr", "sr-Latn", "sv", "sw", // - "ta", "te", "th", "tr", "uk", "vi", "zh", "zh-HK", "zh-TW"); + // these are BCP 47 language codes, not ISO. Note the "-" instead of the "_". + // "en" is not part of this list - it is always inserted at the top. + public static final List LANGUAGE_TAGS = List.of("ar", "be", "bn", "bs", "ca", "cs", "da", "de", "el", "es", "fr", "gl", "he", // + "hi", "hr", "hu", "id", "it", "ja", "ko", "lv", "nb", "nl", "nn", "pa", "pl", "pt", "pt-BR", "ro", "ru", "sk", "sr", "sr-Latn", "sv", "sw", // + "ta", "th", "tr", "uk", "vi", "zh", "zh-HK", "zh-TW"); + public static final String ENGLISH = "en"; - @Nullable - private final String preferredLanguage; + private final List sortedLanguageTags; + + private final Locale preferredLocale; @Inject public SupportedLanguages(Settings settings) { - this.preferredLanguage = settings.languageProperty().get(); + var preferredLanguage = settings.languageProperty().get(); + preferredLocale = preferredLanguage == null ? Locale.getDefault() : Locale.forLanguageTag(preferredLanguage); + var collator = Collator.getInstance(preferredLocale); + collator.setStrength(Collator.PRIMARY); + var sorted = new ArrayList(); + sorted.add(0, Settings.DEFAULT_LANGUAGE); + sorted.add(1, ENGLISH); + LANGUAGE_TAGS.stream() // + .sorted((a, b) -> collator.compare(Locale.forLanguageTag(a).getDisplayName(), Locale.forLanguageTag(b).getDisplayName())) // + .forEach(sorted::add); + sortedLanguageTags = Collections.unmodifiableList(sorted); } public void applyPreferred() { - if (preferredLanguage == null) { - LOG.debug("Using system locale"); - return; - } - var preferredLocale = Locale.forLanguageTag(preferredLanguage); - LOG.debug("Applying preferred locale {}", preferredLocale.getDisplayName(Locale.ENGLISH)); + LOG.debug("Using locale {}", preferredLocale); Locale.setDefault(preferredLocale); } + + public List getLanguageTags() { + return sortedLanguageTags; + } + } diff --git a/src/main/java/org/cryptomator/ui/health/StartController.java b/src/main/java/org/cryptomator/ui/health/StartController.java index fa41a7fdc..4e95b6b0f 100644 --- a/src/main/java/org/cryptomator/ui/health/StartController.java +++ b/src/main/java/org/cryptomator/ui/health/StartController.java @@ -102,14 +102,16 @@ public class StartController implements FxController { } private void loadingKeyFailed(Throwable e) { - if (e instanceof UnlockCancelledException) { - // ok - } else if (e instanceof VaultKeyInvalidException) { - LOG.error("Invalid key"); //TODO: specific error screen - appWindows.showErrorWindow(e, window, null); - } else { - LOG.error("Failed to load key.", e); - appWindows.showErrorWindow(e, window, null); + switch (e) { + case UnlockCancelledException uce -> {} //ok + case VaultKeyInvalidException vkie -> { + LOG.error("Invalid key"); //TODO: specific error screen + appWindows.showErrorWindow(e, window, null); + } + default -> { + LOG.error("Failed to load key.", e); + appWindows.showErrorWindow(e, window, null); + } } } diff --git a/src/main/java/org/cryptomator/ui/preferences/InterfacePreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/InterfacePreferencesController.java index dd463b9e3..05b733f86 100644 --- a/src/main/java/org/cryptomator/ui/preferences/InterfacePreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/InterfacePreferencesController.java @@ -1,6 +1,5 @@ package org.cryptomator.ui.preferences; -import com.google.common.base.Strings; import org.cryptomator.common.LicenseHolder; import org.cryptomator.common.settings.Settings; import org.cryptomator.common.settings.UiTheme; @@ -35,6 +34,7 @@ public class InterfacePreferencesController implements FxController { private final ObjectProperty selectedTabProperty; private final LicenseHolder licenseHolder; private final ResourceBundle resourceBundle; + private final SupportedLanguages supportedLanguages; public ChoiceBox themeChoiceBox; public CheckBox showMinimizeButtonCheckbox; public CheckBox showTrayIconCheckbox; @@ -44,13 +44,14 @@ public class InterfacePreferencesController implements FxController { public RadioButton nodeOrientationRtl; @Inject - InterfacePreferencesController(Settings settings, TrayMenuComponent trayMenu, ObjectProperty selectedTabProperty, LicenseHolder licenseHolder, ResourceBundle resourceBundle) { + InterfacePreferencesController(Settings settings, SupportedLanguages supportedLanguages, TrayMenuComponent trayMenu, ObjectProperty selectedTabProperty, LicenseHolder licenseHolder, ResourceBundle resourceBundle) { this.settings = settings; this.trayMenuInitialized = trayMenu.isInitialized(); this.trayMenuSupported = trayMenu.isSupported(); this.selectedTabProperty = selectedTabProperty; this.licenseHolder = licenseHolder; this.resourceBundle = resourceBundle; + this.supportedLanguages = supportedLanguages; } @FXML @@ -66,8 +67,7 @@ public class InterfacePreferencesController implements FxController { showTrayIconCheckbox.selectedProperty().bindBidirectional(settings.showTrayIcon()); - preferredLanguageChoiceBox.getItems().add(null); - preferredLanguageChoiceBox.getItems().addAll(SupportedLanguages.LANGUAGAE_TAGS); + preferredLanguageChoiceBox.getItems().addAll(supportedLanguages.getLanguageTags()); preferredLanguageChoiceBox.valueProperty().bindBidirectional(settings.languageProperty()); preferredLanguageChoiceBox.setConverter(new LanguageTagConverter(resourceBundle)); @@ -141,9 +141,7 @@ public class InterfacePreferencesController implements FxController { return resourceBundle.getString("preferences.interface.language.auto"); } else { var locale = Locale.forLanguageTag(tag); - var lang = locale.getDisplayLanguage(locale); - var region = locale.getDisplayCountry(locale); - return lang + (Strings.isNullOrEmpty(region) ? "" : " (" + region + ")"); + return locale.getDisplayName(); } } diff --git a/src/main/java/org/cryptomator/ui/traymenu/AwtTrayMenuController.java b/src/main/java/org/cryptomator/ui/traymenu/AwtTrayMenuController.java index 428abdc08..757e9b997 100644 --- a/src/main/java/org/cryptomator/ui/traymenu/AwtTrayMenuController.java +++ b/src/main/java/org/cryptomator/ui/traymenu/AwtTrayMenuController.java @@ -112,7 +112,7 @@ public class AwtTrayMenuController implements TrayMenuController { menuItem.setEnabled(a.enabled()); menu.add(menuItem); } - case SeparatorItem s -> menu.addSeparator(); // TODO: rename pattern variable with JEP 443 + case SeparatorItem s -> menu.addSeparator(); // TODO: rename to _ with JEP 443 case SubMenuItem s -> { var submenu = new Menu(s.title()); addChildren(submenu, s.items()); diff --git a/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java b/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java index aeb4a9166..7bc0cbccd 100644 --- a/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java +++ b/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java @@ -38,12 +38,11 @@ public class UnlockInvalidMountPointController implements FxController { @FXML public void initialize() { var e = unlockException.get(); - String translationKey = "unlock.error.customPath.description.generic"; - if (e instanceof MountPointNotSupportedException) { - translationKey = "unlock.error.customPath.description.notSupported"; - } else if (e instanceof MountPointNotExistsException) { - translationKey = "unlock.error.customPath.description.notExists"; - } + var translationKey = switch (e) { + case MountPointNotSupportedException x -> "unlock.error.customPath.description.notSupported"; + case MountPointNotExistsException x -> "unlock.error.customPath.description.notExists"; + default -> "unlock.error.customPath.description.generic"; + }; dialogDescription.setFormat(resourceBundle.getString(translationKey)); dialogDescription.setArg1(e.getMessage()); } diff --git a/src/test/java/org/cryptomator/launcher/SupportedLanguagesTest.java b/src/test/java/org/cryptomator/launcher/SupportedLanguagesTest.java index 7d76409e8..8ea48465b 100644 --- a/src/test/java/org/cryptomator/launcher/SupportedLanguagesTest.java +++ b/src/test/java/org/cryptomator/launcher/SupportedLanguagesTest.java @@ -25,7 +25,7 @@ public class SupportedLanguagesTest { } public static Stream languageTags() { - return SupportedLanguages.LANGUAGAE_TAGS.stream() // + return SupportedLanguages.LANGUAGE_TAGS.stream() // .filter(tag -> !"en".equals(tag)); // english uses the default bundle } } \ No newline at end of file