diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 6ae61a2b2..6494c0cce 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 f5ce875d9..16b156e7d 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 40d6c8497..67f172b39 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 @@ -175,7 +175,7 @@ jobs: run: | echo "Codesigning jdk files..." find Cryptomator.app/Contents/runtime/Contents/Home/lib/ -name '*.dylib' -exec codesign --force -s ${CODESIGN_IDENTITY} {} \; - find Cryptomator.app/Contents/runtime/Contents/Home/lib/ -name 'jspawnhelper' -exec codesign --force -o runtime -s ${CODESIGN_IDENTITY} {} \; + find Cryptomator.app/Contents/runtime/Contents/Home/lib/ \( -name 'jspawnhelper' -o -name 'pauseengine' -o -name 'simengine' \) -exec codesign --force -o runtime -s ${CODESIGN_IDENTITY} {} \; echo "Codesigning jar contents..." find Cryptomator.app/Contents/runtime/Contents/MacOS -name '*.dylib' -exec codesign --force -s ${CODESIGN_IDENTITY} {} \; for JAR_PATH in `find Cryptomator.app -name "*.jar"`; do diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index bf14d3448..18c50db4b 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' @@ -199,7 +199,7 @@ jobs: } - name: Generate license for MSI run: > - mvn -B license:add-third-party -Djavafx.platform=win + mvn -B license:add-third-party "-Djavafx.platform=win" "-Dlicense.thirdPartyFilename=license.rtf" "-Dlicense.outputDirectory=dist/win/resources" "-Dlicense.fileTemplate=dist/win/resources/licenseTemplate.ftl" @@ -279,7 +279,7 @@ jobs: cache: 'maven' - name: Generate license for exe run: > - mvn -B license:add-third-party -Djavafx.platform=win + mvn -B license:add-third-party "-Djavafx.platform=win" "-Dlicense.thirdPartyFilename=license.rtf" "-Dlicense.fileTemplate=dist/win/bundle/resources/licenseTemplate.ftl" "-Dlicense.outputDirectory=dist/win/bundle/resources" diff --git a/README.md b/README.md index 8d16e6d9a..2b0a78336 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ For more information on the security details visit [cryptomator.org](https://doc ### Dependencies -* JDK 21 (e.g. temurin, zulu) +* JDK 22 (e.g. temurin, zulu) * Maven 3 ### Run Maven diff --git a/dist/linux/appimage/build.sh b/dist/linux/appimage/build.sh index 1adfdc010..e0af3999a 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 -Djavafx.platform=l 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=22.0.1 +JAVAFX_ARCH="x64" +JAVAFX_JMODS_SHA256='fbb22f35951c2e049cc2554dd03c2c56b4f5adc4b2ae9248872f46175ac103d8' +if [ "${CPU_ARCH}" = "aarch64" ]; then + JAVAFX_ARCH="aarch64" + JAVAFX_JMODS_SHA256='1982ad168a5e8d7cf4a9458a7d088b4f0552d0ac3f24f23fb88f8bc7e8d69a13' 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/linux/common/org.cryptomator.Cryptomator.metainfo.xml b/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml index 146933a97..4f6981e62 100644 --- a/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml +++ b/dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml @@ -75,6 +75,9 @@ + + https://github.com/cryptomator/cryptomator/releases/1.13.0 + https://github.com/cryptomator/cryptomator/releases/1.12.4 diff --git a/dist/mac/dmg/build.sh b/dist/mac/dmg/build.sh index 11375cddb..ae15557df 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=22.0.1 +JAVAFX_ARCH="undefined" +JAVAFX_JMODS_SHA256="undefined" if [ "$(machine)" = "arm64e" ]; then - ARCH="aarch64" + JAVAFX_ARCH="aarch64" + JAVAFX_JMODS_SHA256="572fce94b9b09d316b960a49e3c2b5d35231ed0463e3b1c4020b8de89783b51d" else - ARCH="x64" + JAVAFX_ARCH="x64" + JAVAFX_JMODS_SHA256="e07a11c112abbdebe7c058b44c151e1e475de748671d896aef3d73f32453c248" 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 18b243121..7c5e85d58 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='22.0.1' +$javaFxJmodsUrl = "https://download2.gluonhq.com/openjfx/${javaFxVersion}/openjfx-${javaFxVersion}_windows-x64_bin-jmods.zip" +$javaFxJmodsSHA256 = 'de82e53179032a49bec005deb4438e8f261d08c4b58864a5c17e1d87286b09dd' +$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 diff --git a/pom.xml b/pom.xml index e9cb5cc7c..6fb45d9d7 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.cryptomator cryptomator - 1.13.0-SNAPSHOT + 1.13.0 Cryptomator Desktop App @@ -36,7 +36,7 @@ 2.6.9 1.3.1 1.2.5 - 1.2.3 + 1.2.4 1.4.5 5.0.0 2.0.6 @@ -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 @@ -57,7 +57,7 @@ 5.10.2 - 5.11.0 + 5.12.0 2.2 @@ -68,8 +68,8 @@ 1.2.1 3.13.0 3.3.1 - 3.6.1 - 3.2.5 + 3.7.0 + 3.3.0 3.4.1 diff --git a/src/main/java/org/cryptomator/ui/common/FxmlFile.java b/src/main/java/org/cryptomator/ui/common/FxmlFile.java index 1a2374f85..938f93687 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_SUPPORT_END("/fxml/dokany_support_end.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/dokanysupportend/DokanySupportEndComponent.java b/src/main/java/org/cryptomator/ui/dokanysupportend/DokanySupportEndComponent.java new file mode 100644 index 000000000..48a5ab36c --- /dev/null +++ b/src/main/java/org/cryptomator/ui/dokanysupportend/DokanySupportEndComponent.java @@ -0,0 +1,34 @@ +package org.cryptomator.ui.dokanysupportend; + +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; + +@DokanySupportEndScoped +@Subcomponent(modules = {DokanySupportEndModule.class}) +public interface DokanySupportEndComponent { + + @DokanySupportEndWindow + Stage window(); + + @FxmlScene(FxmlFile.DOKANY_SUPPORT_END) + Lazy dokanySupportEndScene(); + + + default void showDokanySupportEndWindow() { + Stage stage = window(); + stage.setScene(dokanySupportEndScene().get()); + stage.sizeToScene(); + stage.show(); + } + + @Subcomponent.Factory + interface Factory { + + DokanySupportEndComponent create(); + } +} \ No newline at end of file diff --git a/src/main/java/org/cryptomator/ui/dokanysupportend/DokanySupportEndController.java b/src/main/java/org/cryptomator/ui/dokanysupportend/DokanySupportEndController.java new file mode 100644 index 000000000..a1d626402 --- /dev/null +++ b/src/main/java/org/cryptomator/ui/dokanysupportend/DokanySupportEndController.java @@ -0,0 +1,34 @@ +package org.cryptomator.ui.dokanysupportend; + +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; + + +@DokanySupportEndScoped +public class DokanySupportEndController implements FxController { + + private final Stage window; + private final FxApplicationWindows applicationWindows; + + @Inject + DokanySupportEndController(@DokanySupportEndWindow Stage window, FxApplicationWindows applicationWindows) { + this.window = window; + this.applicationWindows = applicationWindows; + } + + @FXML + public void close() { + window.close(); + } + + public void openVolumePreferences() { + applicationWindows.showPreferencesWindow(SelectedPreferencesTab.VOLUME); + window.close(); + } + +} \ No newline at end of file diff --git a/src/main/java/org/cryptomator/ui/dokanysupportend/DokanySupportEndModule.java b/src/main/java/org/cryptomator/ui/dokanysupportend/DokanySupportEndModule.java new file mode 100644 index 000000000..64689eb26 --- /dev/null +++ b/src/main/java/org/cryptomator/ui/dokanysupportend/DokanySupportEndModule.java @@ -0,0 +1,57 @@ +package org.cryptomator.ui.dokanysupportend; + +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 DokanySupportEndModule { + + @Provides + @DokanySupportEndWindow + @DokanySupportEndScoped + static FxmlLoaderFactory provideFxmlLoaderFactory(Map, Provider> factories, DefaultSceneFactory sceneFactory, ResourceBundle resourceBundle) { + return new FxmlLoaderFactory(factories, sceneFactory, resourceBundle); + } + + @Provides + @DokanySupportEndWindow + @DokanySupportEndScoped + static Stage provideStage(StageFactory factory, ResourceBundle resourceBundle) { + Stage stage = factory.create(); + stage.setTitle(resourceBundle.getString("dokanySupportEnd.title")); + stage.setMinWidth(500); + stage.setMinHeight(100); + stage.initModality(Modality.APPLICATION_MODAL); + return stage; + } + + @Provides + @FxmlScene(FxmlFile.DOKANY_SUPPORT_END) + @DokanySupportEndScoped + static Scene provideDokanySupportEndScene(@DokanySupportEndWindow FxmlLoaderFactory fxmlLoaders) { + return fxmlLoaders.createScene(FxmlFile.DOKANY_SUPPORT_END); + } + + + @Binds + @IntoMap + @FxControllerKey(DokanySupportEndController.class) + abstract FxController bindDokanySupportEndController(DokanySupportEndController controller); + +} diff --git a/src/main/java/org/cryptomator/ui/dokanysupportend/DokanySupportEndScoped.java b/src/main/java/org/cryptomator/ui/dokanysupportend/DokanySupportEndScoped.java new file mode 100644 index 000000000..967e6f86f --- /dev/null +++ b/src/main/java/org/cryptomator/ui/dokanysupportend/DokanySupportEndScoped.java @@ -0,0 +1,13 @@ +package org.cryptomator.ui.dokanysupportend; + +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 DokanySupportEndScoped { + +} diff --git a/src/main/java/org/cryptomator/ui/dokanysupportend/DokanySupportEndWindow.java b/src/main/java/org/cryptomator/ui/dokanysupportend/DokanySupportEndWindow.java new file mode 100644 index 000000000..bb9b1617c --- /dev/null +++ b/src/main/java/org/cryptomator/ui/dokanysupportend/DokanySupportEndWindow.java @@ -0,0 +1,14 @@ +package org.cryptomator.ui.dokanysupportend; + +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 DokanySupportEndWindow { + +} diff --git a/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java b/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java index 711a0fa44..30e40ea8c 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,7 +76,27 @@ public class FxApplication { appWindows.checkAndShowUpdateReminderWindow(); } + migrateAndInformDokanyRemoval(); + launchEventHandler.startHandlingLaunchEvents(); autoUnlocker.tryUnlockForTimespan(2, TimeUnit.MINUTES); } + + private void migrateAndInformDokanyRemoval() { + var dokanyProviderId = "org.cryptomator.frontend.dokany.mount.DokanyMountProvider"; + boolean dokanyFound = false; + if (settings.mountService.getValueSafe().equals(dokanyProviderId)) { + dokanyFound = true; + settings.mountService.set(null); + } + for (VaultSettings vaultSettings : settings.directories) { + if (vaultSettings.mountService.getValueSafe().equals(dokanyProviderId)) { + dokanyFound = true; + vaultSettings.mountService.set(null); + } + } + if (dokanyFound) { + appWindows.showDokanySupportEndWindow(); + } + } } diff --git a/src/main/java/org/cryptomator/ui/fxapp/FxApplicationModule.java b/src/main/java/org/cryptomator/ui/fxapp/FxApplicationModule.java index af98e284c..0b8b6c70f 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.dokanysupportend.DokanySupportEndComponent; 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, // + DokanySupportEndComponent.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..33d8491a7 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.dokanysupportend.DokanySupportEndComponent; 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 DokanySupportEndComponent.Factory dokanySupportEndWindowBuilder; 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, // + DokanySupportEndComponent.Factory dokanySupportEndWindowBuilder, // 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.dokanySupportEndWindowBuilder = dokanySupportEndWindowBuilder; 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 showDokanySupportEndWindow() { + CompletableFuture.runAsync(() -> dokanySupportEndWindowBuilder.create().showDokanySupportEndWindow(), 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_support_end.fxml b/src/main/resources/fxml/dokany_support_end.fxml new file mode 100644 index 000000000..423a54c72 --- /dev/null +++ b/src/main/resources/fxml/dokany_support_end.fxml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +