diff --git a/assembly-linux.xml b/assembly-linux.xml index d8d224d67..1de114820 100644 --- a/assembly-linux.xml +++ b/assembly-linux.xml @@ -34,7 +34,14 @@ cryptomator-*.jar - libs + mods + + + target/mods + + *.jar + + mods target/libs diff --git a/assembly-mac.xml b/assembly-mac.xml index cf044be12..95b8adb21 100644 --- a/assembly-mac.xml +++ b/assembly-mac.xml @@ -34,7 +34,14 @@ cryptomator-*.jar - libs + mods + + + target/mods + + *.jar + + mods target/libs diff --git a/assembly-win.xml b/assembly-win.xml index e04495220..c64a34b05 100644 --- a/assembly-win.xml +++ b/assembly-win.xml @@ -34,7 +34,14 @@ cryptomator-*.jar - libs + mods + + + target/mods + + *.jar + + mods target/libs diff --git a/pom.xml b/pom.xml index 16411e337..7b571effb 100644 --- a/pom.xml +++ b/pom.xml @@ -23,6 +23,9 @@ UTF-8 16 + + com.github.serceman,com.github.jnr,org.ow2.asm,net.java.dev.jna,org.apache.jackrabbit,org.apache.httpcomponents + 2.1.0-beta9 1.0.0-rc1 @@ -41,6 +44,7 @@ 30.1.1-jre 2.37 2.8.7 + 1.5.2 1.7.31 1.2.3 @@ -142,7 +146,7 @@ com.nulab-inc zxcvbn - 1.3.0 + ${zxcvbn.version} @@ -150,6 +154,29 @@ com.google.guava guava ${guava.version} + + + + com.google.guava + listenablefuture + + + com.google.code.findbugs + jsr305 + + + org.checkerframework + checker-qual + + + com.google.errorprone + error_prone_annotations + + + com.google.j2objc + j2objc-annotations + + com.google.dagger @@ -211,7 +238,7 @@ org.apache.maven.plugins maven-dependency-plugin - 3.1.2 + 3.2.0 org.apache.maven.plugins @@ -221,7 +248,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.22.2 + 3.0.0-M5 org.codehaus.mojo @@ -314,6 +341,19 @@ org.apache.maven.plugins maven-dependency-plugin + + copy-mods + prepare-package + + copy-dependencies + + + runtime + ${project.build.directory}/mods + linux,mac,win + ${nonModularGroupIds} + + copy-libs prepare-package @@ -323,7 +363,7 @@ runtime ${project.build.directory}/libs - linux,mac,win + ${nonModularGroupIds} @@ -467,7 +507,7 @@ copy-dependencies - ${project.build.directory}/libs + ${project.build.directory}/mods org.openjfx mac @@ -529,7 +569,7 @@ copy-dependencies - ${project.build.directory}/libs + ${project.build.directory}/mods org.openjfx linux @@ -590,7 +630,7 @@ copy-dependencies - ${project.build.directory}/libs + ${project.build.directory}/mods org.openjfx win diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java new file mode 100644 index 000000000..a425c0659 --- /dev/null +++ b/src/main/java/module-info.java @@ -0,0 +1,61 @@ +import org.cryptomator.integrations.autostart.AutoStartProvider; +import org.cryptomator.integrations.keychain.KeychainAccessProvider; +import org.cryptomator.integrations.tray.TrayIntegrationProvider; +import org.cryptomator.integrations.uiappearance.UiAppearanceProvider; + +module org.cryptomator.desktop { + requires org.cryptomator.cryptofs; + requires org.cryptomator.frontend.dokany; + requires org.cryptomator.frontend.fuse; + requires org.cryptomator.frontend.webdav; + requires org.cryptomator.integrations.api; + requires java.rmi; + requires java.desktop; + requires java.net.http; + requires javafx.base; + requires javafx.graphics; + requires javafx.controls; + requires javafx.fxml; + requires com.tobiasdiez.easybind; + requires com.google.common; + requires com.google.gson; + requires com.nulabinc.zxcvbn; + requires org.slf4j; + requires org.apache.commons.lang3; + requires dagger; + requires com.auth0.jwt; + + /* TODO: filename-based modules: */ + requires static javax.inject; /* ugly dagger/guava crap */ + requires logback.classic; + requires logback.core; + + uses AutoStartProvider; + uses KeychainAccessProvider; + uses TrayIntegrationProvider; + uses UiAppearanceProvider; + + opens org.cryptomator.common.settings to com.google.gson; + + opens org.cryptomator.launcher to java.rmi; + + opens org.cryptomator.common to javafx.fxml; + opens org.cryptomator.common.vaults to javafx.fxml; + opens org.cryptomator.ui.addvaultwizard to javafx.fxml; + opens org.cryptomator.ui.changepassword to javafx.fxml; + opens org.cryptomator.ui.common to javafx.fxml; + opens org.cryptomator.ui.controls to javafx.fxml; + opens org.cryptomator.ui.forgetPassword to javafx.fxml; + opens org.cryptomator.ui.fxapp to javafx.fxml; + opens org.cryptomator.ui.keyloading.masterkeyfile to javafx.fxml; + opens org.cryptomator.ui.mainwindow to javafx.fxml; + opens org.cryptomator.ui.migration to javafx.fxml; + opens org.cryptomator.ui.preferences to javafx.fxml; + opens org.cryptomator.ui.quit to javafx.fxml; + opens org.cryptomator.ui.recoverykey to javafx.fxml; + opens org.cryptomator.ui.removevault to javafx.fxml; + opens org.cryptomator.ui.stats to javafx.fxml; + opens org.cryptomator.ui.unlock to javafx.fxml; + opens org.cryptomator.ui.vaultoptions to javafx.fxml; + opens org.cryptomator.ui.wrongfilealert to javafx.fxml; +} \ No newline at end of file diff --git a/src/main/java/org/cryptomator/common/Nullable.java b/src/main/java/org/cryptomator/common/Nullable.java new file mode 100644 index 000000000..cb0d9e887 --- /dev/null +++ b/src/main/java/org/cryptomator/common/Nullable.java @@ -0,0 +1,8 @@ +package org.cryptomator.common; + +/** + * Replacement for JSR-305 to avoid runtime dependencies. Used in Dagger components. + */ +public @interface Nullable { + +} diff --git a/src/main/java/org/cryptomator/common/settings/VaultSettings.java b/src/main/java/org/cryptomator/common/settings/VaultSettings.java index a7f366bfd..8ae20406c 100644 --- a/src/main/java/org/cryptomator/common/settings/VaultSettings.java +++ b/src/main/java/org/cryptomator/common/settings/VaultSettings.java @@ -43,7 +43,7 @@ public class VaultSettings { private static final Random RNG = new Random(); private final String id; - private final ObjectProperty path = new SimpleObjectProperty(); + private final ObjectProperty path = new SimpleObjectProperty<>(); private final StringProperty displayName = new SimpleStringProperty(); private final StringProperty winDriveLetter = new SimpleStringProperty(); private final BooleanProperty unlockAfterStartup = new SimpleBooleanProperty(DEFAULT_UNLOCK_AFTER_STARTUP); diff --git a/src/main/java/org/cryptomator/common/vaults/VaultComponent.java b/src/main/java/org/cryptomator/common/vaults/VaultComponent.java index 47be62520..588ff64cd 100644 --- a/src/main/java/org/cryptomator/common/vaults/VaultComponent.java +++ b/src/main/java/org/cryptomator/common/vaults/VaultComponent.java @@ -7,10 +7,10 @@ package org.cryptomator.common.vaults; import dagger.BindsInstance; import dagger.Subcomponent; +import org.cryptomator.common.Nullable; import org.cryptomator.common.mountpoint.MountPointChooserModule; import org.cryptomator.common.settings.VaultSettings; -import javax.annotation.Nullable; import javax.inject.Named; @PerVault diff --git a/src/main/java/org/cryptomator/common/vaults/VaultModule.java b/src/main/java/org/cryptomator/common/vaults/VaultModule.java index 4ee13a083..cc38e6933 100644 --- a/src/main/java/org/cryptomator/common/vaults/VaultModule.java +++ b/src/main/java/org/cryptomator/common/vaults/VaultModule.java @@ -8,6 +8,7 @@ package org.cryptomator.common.vaults; import dagger.Module; import dagger.Provides; import org.apache.commons.lang3.SystemUtils; +import org.cryptomator.common.Nullable; import org.cryptomator.common.settings.Settings; import org.cryptomator.common.settings.VaultSettings; import org.cryptomator.common.settings.VolumeImpl; @@ -15,7 +16,6 @@ import org.cryptomator.cryptofs.CryptoFileSystem; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nullable; import javax.inject.Named; import javafx.beans.binding.Bindings; import javafx.beans.binding.StringBinding; diff --git a/src/main/java/org/cryptomator/ui/common/ErrorComponent.java b/src/main/java/org/cryptomator/ui/common/ErrorComponent.java index 285270b4c..92276f5bd 100644 --- a/src/main/java/org/cryptomator/ui/common/ErrorComponent.java +++ b/src/main/java/org/cryptomator/ui/common/ErrorComponent.java @@ -2,8 +2,8 @@ package org.cryptomator.ui.common; import dagger.BindsInstance; import dagger.Subcomponent; +import org.cryptomator.common.Nullable; -import javax.annotation.Nullable; import javafx.application.Platform; import javafx.scene.Scene; import javafx.stage.Stage; diff --git a/src/main/java/org/cryptomator/ui/common/ErrorController.java b/src/main/java/org/cryptomator/ui/common/ErrorController.java index c7f19a9e6..85b335b15 100644 --- a/src/main/java/org/cryptomator/ui/common/ErrorController.java +++ b/src/main/java/org/cryptomator/ui/common/ErrorController.java @@ -1,6 +1,7 @@ package org.cryptomator.ui.common; -import javax.annotation.Nullable; +import org.cryptomator.common.Nullable; + import javax.inject.Inject; import javax.inject.Named; import javafx.fxml.FXML; diff --git a/src/main/java/org/cryptomator/ui/common/FxmlLoaderFactory.java b/src/main/java/org/cryptomator/ui/common/FxmlLoaderFactory.java index cbd023ce3..c10054ef4 100644 --- a/src/main/java/org/cryptomator/ui/common/FxmlLoaderFactory.java +++ b/src/main/java/org/cryptomator/ui/common/FxmlLoaderFactory.java @@ -5,7 +5,6 @@ import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import java.io.IOException; -import java.io.InputStream; import java.io.UncheckedIOException; import java.util.Map; import java.util.ResourceBundle; @@ -26,11 +25,9 @@ public class FxmlLoaderFactory { /** * @return A new FXMLLoader instance */ - public FXMLLoader construct() { - FXMLLoader loader = new FXMLLoader(); - loader.setControllerFactory(this::constructController); - loader.setResources(resourceBundle); - return loader; + private FXMLLoader construct(String fxmlResourceName) { + var url = getClass().getResource(fxmlResourceName); + return new FXMLLoader(url, resourceBundle, null, this::constructController); } /** @@ -41,10 +38,8 @@ public class FxmlLoaderFactory { * @throws IOException if an error occurs while loading the FXML file */ public FXMLLoader load(String fxmlResourceName) throws IOException { - FXMLLoader loader = construct(); - try (InputStream in = getClass().getResourceAsStream(fxmlResourceName)) { - loader.load(in); - } + FXMLLoader loader = construct(fxmlResourceName); + loader.load(); return loader; } diff --git a/src/main/resources/fxml/addvault_new_password.fxml b/src/main/resources/fxml/addvault_new_password.fxml index 4b62f9b78..0bb0a3b3f 100644 --- a/src/main/resources/fxml/addvault_new_password.fxml +++ b/src/main/resources/fxml/addvault_new_password.fxml @@ -23,7 +23,7 @@ - + diff --git a/src/main/resources/fxml/addvault_new_recoverykey.fxml b/src/main/resources/fxml/addvault_new_recoverykey.fxml index 956461fe9..b04677bc3 100644 --- a/src/main/resources/fxml/addvault_new_recoverykey.fxml +++ b/src/main/resources/fxml/addvault_new_recoverykey.fxml @@ -18,7 +18,7 @@ - + diff --git a/src/main/resources/fxml/addvault_welcome.fxml b/src/main/resources/fxml/addvault_welcome.fxml index 750a574a2..7d7244973 100644 --- a/src/main/resources/fxml/addvault_welcome.fxml +++ b/src/main/resources/fxml/addvault_welcome.fxml @@ -21,7 +21,7 @@ - + diff --git a/src/main/resources/fxml/changepassword.fxml b/src/main/resources/fxml/changepassword.fxml index 3f077df5d..eaab7b06a 100644 --- a/src/main/resources/fxml/changepassword.fxml +++ b/src/main/resources/fxml/changepassword.fxml @@ -25,7 +25,7 @@ - + diff --git a/src/main/resources/fxml/health_check_list.fxml b/src/main/resources/fxml/health_check_list.fxml index 30bf818d5..91cd02975 100644 --- a/src/main/resources/fxml/health_check_list.fxml +++ b/src/main/resources/fxml/health_check_list.fxml @@ -33,7 +33,7 @@ - + diff --git a/src/main/resources/fxml/main_window.fxml b/src/main/resources/fxml/main_window.fxml index b960f3ed1..ff8e65292 100644 --- a/src/main/resources/fxml/main_window.fxml +++ b/src/main/resources/fxml/main_window.fxml @@ -13,11 +13,11 @@ fx:controller="org.cryptomator.ui.mainwindow.MainWindowController" styleClass="main-window"> - + - - + + @@ -33,5 +33,5 @@ - + diff --git a/src/main/resources/fxml/preferences.fxml b/src/main/resources/fxml/preferences.fxml index 643b31176..4eaf3d45c 100644 --- a/src/main/resources/fxml/preferences.fxml +++ b/src/main/resources/fxml/preferences.fxml @@ -19,7 +19,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -35,7 +35,7 @@ - + @@ -43,7 +43,7 @@ - + @@ -51,7 +51,7 @@ - + diff --git a/src/main/resources/fxml/preferences_about.fxml b/src/main/resources/fxml/preferences_about.fxml index 1c2b7119f..287e91da3 100644 --- a/src/main/resources/fxml/preferences_about.fxml +++ b/src/main/resources/fxml/preferences_about.fxml @@ -18,7 +18,7 @@ - + diff --git a/src/main/resources/fxml/recoverykey_reset_password.fxml b/src/main/resources/fxml/recoverykey_reset_password.fxml index 085554965..b43706673 100644 --- a/src/main/resources/fxml/recoverykey_reset_password.fxml +++ b/src/main/resources/fxml/recoverykey_reset_password.fxml @@ -17,7 +17,7 @@ - + diff --git a/src/main/resources/fxml/recoverykey_success.fxml b/src/main/resources/fxml/recoverykey_success.fxml index 0e9cd2bce..8d9dee3ef 100644 --- a/src/main/resources/fxml/recoverykey_success.fxml +++ b/src/main/resources/fxml/recoverykey_success.fxml @@ -17,7 +17,7 @@ - + diff --git a/src/main/resources/fxml/unlock_enter_password.fxml b/src/main/resources/fxml/unlock_enter_password.fxml index 5fb55dd01..48dcf5451 100644 --- a/src/main/resources/fxml/unlock_enter_password.fxml +++ b/src/main/resources/fxml/unlock_enter_password.fxml @@ -26,23 +26,23 @@ - + - + - + - + - + diff --git a/src/main/resources/fxml/vault_detail_welcome.fxml b/src/main/resources/fxml/vault_detail_welcome.fxml index 59b2596d9..b2cbce7fa 100644 --- a/src/main/resources/fxml/vault_detail_welcome.fxml +++ b/src/main/resources/fxml/vault_detail_welcome.fxml @@ -11,7 +11,7 @@ spacing="24"> - + diff --git a/src/main/resources/fxml/vault_options.fxml b/src/main/resources/fxml/vault_options.fxml index 42a924740..1c9418052 100644 --- a/src/main/resources/fxml/vault_options.fxml +++ b/src/main/resources/fxml/vault_options.fxml @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -41,7 +41,7 @@ - + diff --git a/src/main/resources/license/THIRD-PARTY.txt b/src/main/resources/license/THIRD-PARTY.txt index 6c58b1eee..2b18cc3f1 100644 --- a/src/main/resources/license/THIRD-PARTY.txt +++ b/src/main/resources/license/THIRD-PARTY.txt @@ -11,20 +11,16 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. -Cryptomator uses 45 third-party dependencies under the following licenses: +Cryptomator uses 40 third-party dependencies under the following licenses: Apache License v2.0: - jffi (com.github.jnr:jffi:1.2.23 - http://github.com/jnr/jffi) - jnr-a64asm (com.github.jnr:jnr-a64asm:1.0.0 - http://nexus.sonatype.org/oss-repository-hosting.html/jnr-a64asm) - jnr-constants (com.github.jnr:jnr-constants:0.9.15 - http://github.com/jnr/jnr-constants) - jnr-ffi (com.github.jnr:jnr-ffi:2.1.12 - http://github.com/jnr/jnr-ffi) - - FindBugs-jsr305 (com.google.code.findbugs:jsr305:3.0.2 - http://findbugs.sourceforge.net/) - Gson (com.google.code.gson:gson:2.8.7 - https://github.com/google/gson/gson) - Dagger (com.google.dagger:dagger:2.37 - https://github.com/google/dagger) - - error-prone annotations (com.google.errorprone:error_prone_annotations:2.5.1 - http://nexus.sonatype.org/oss-repository-hosting.html/error_prone_parent/error_prone_annotations) - Guava InternalFutureFailureAccess and InternalFutures (com.google.guava:failureaccess:1.0.1 - https://github.com/google/guava/failureaccess) - Guava: Google Core Libraries for Java (com.google.guava:guava:30.1.1-jre - https://github.com/google/guava/guava) - - Guava ListenableFuture only (com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava - https://github.com/google/guava/listenablefuture) - - J2ObjC Annotations (com.google.j2objc:j2objc-annotations:1.3 - https://github.com/google/j2objc/) - Apache Commons CLI (commons-cli:commons-cli:1.4 - http://commons.apache.org/proper/commons-cli/) - javax.inject (javax.inject:javax.inject:1 - http://code.google.com/p/atinject/) - Java Native Access (net.java.dev.jna:jna:5.7.0 - https://github.com/java-native-access/jna) @@ -77,8 +73,7 @@ Cryptomator uses 45 third-party dependencies under the following licenses: - java jwt (com.auth0:java-jwt:3.18.1 - https://github.com/auth0/java-jwt) - jnr-x86asm (com.github.jnr:jnr-x86asm:1.0.2 - http://github.com/jnr/jnr-x86asm) - jnr-fuse (com.github.serceman:jnr-fuse:0.5.5 - https://github.com/SerCeMan/jnr-fuse) - - zxcvbn4j (com.nulab-inc:zxcvbn:1.3.0 - https://github.com/nulab/zxcvbn4j) - - Checker Qual (org.checkerframework:checker-qual:3.8.0 - https://checkerframework.org) + - zxcvbn4j (com.nulab-inc:zxcvbn:1.5.2 - https://github.com/nulab/zxcvbn4j) - SLF4J API Module (org.slf4j:slf4j-api:1.7.31 - http://www.slf4j.org) The BSD 2-Clause License: - EasyBind (com.tobiasdiez:easybind:2.2 - https://github.com/tobiasdiez/EasyBind) diff --git a/src/package/launcher-linux.sh b/src/package/launcher-linux.sh index 366b110dd..1980edc13 100644 --- a/src/package/launcher-linux.sh +++ b/src/package/launcher-linux.sh @@ -1,6 +1,7 @@ #!/bin/sh cd $(dirname $0) java \ + -p "mods" \ -cp "libs/*" \ -Dcryptomator.settingsPath="~/.config/Cryptomator/settings.json" \ -Dcryptomator.ipcSocketPath="~/.config/Cryptomator/ipc.socket" \ @@ -9,4 +10,4 @@ java \ -Djdk.gtk.version=2 \ -Xss2m \ -Xmx512m \ - org.cryptomator.launcher.Cryptomator + -m org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator diff --git a/src/package/launcher-mac.sh b/src/package/launcher-mac.sh index 19c8a7750..d8cc30b45 100644 --- a/src/package/launcher-mac.sh +++ b/src/package/launcher-mac.sh @@ -1,6 +1,7 @@ #!/bin/sh cd $(dirname $0) java \ + -p "mods" \ -cp "libs/*" \ -Dcryptomator.settingsPath="~/Library/Application Support/Cryptomator/settings.json" \ -Dcryptomator.ipcSocketPath="~/Library/Application Support/Cryptomator/ipc.socket" \ @@ -8,4 +9,4 @@ java \ -Dcryptomator.mountPointsDir="/Volumes" \ -Xss20m \ -Xmx512m \ - org.cryptomator.launcher.Cryptomator \ No newline at end of file + -m org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator \ No newline at end of file diff --git a/src/package/launcher-win.bat b/src/package/launcher-win.bat index b5573c80b..751a6e4fa 100644 --- a/src/package/launcher-win.bat +++ b/src/package/launcher-win.bat @@ -1,5 +1,6 @@ @echo off java ^ + -p "mods" ^ -cp "libs/*" ^ -Dcryptomator.settingsPath="~/AppData/Roaming/Cryptomator/settings.json" ^ -Dcryptomator.ipcSocketPath="~/AppData/Roaming/Cryptomator/ipc.socket" ^ @@ -8,4 +9,4 @@ java ^ -Dcryptomator.keychainPath="~/AppData/Roaming/Cryptomator/keychain.json" ^ -Xss20m ^ -Xmx512m ^ - org.cryptomator.launcher.Cryptomator \ No newline at end of file + -m org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator \ No newline at end of file