diff --git a/main/ant-kit/assembly.xml b/main/ant-kit/assembly.xml index afea7ec94..4ca4dfd66 100644 --- a/main/ant-kit/assembly.xml +++ b/main/ant-kit/assembly.xml @@ -14,6 +14,12 @@ libs + + target/fixed-binaries + false + fixed-binaries + 755 + target/package false diff --git a/main/ant-kit/pom.xml b/main/ant-kit/pom.xml index c694cedc2..3753d71d9 100644 --- a/main/ant-kit/pom.xml +++ b/main/ant-kit/pom.xml @@ -60,6 +60,16 @@ src/main/resources true + + fixed-binaries/** + + + + src/main/resources + false + + fixed-binaries/** + diff --git a/main/ant-kit/src/main/resources/build.xml b/main/ant-kit/src/main/resources/build.xml index 0ca9be55e..06dcfc257 100644 --- a/main/ant-kit/src/main/resources/build.xml +++ b/main/ant-kit/src/main/resources/build.xml @@ -50,6 +50,7 @@ + diff --git a/main/ant-kit/src/main/resources/fixed-binaries/linux-launcher-x64 b/main/ant-kit/src/main/resources/fixed-binaries/linux-launcher-x64 new file mode 100644 index 000000000..bffda959a Binary files /dev/null and b/main/ant-kit/src/main/resources/fixed-binaries/linux-launcher-x64 differ diff --git a/main/ant-kit/src/main/resources/fixed-binaries/linux-launcher-x86 b/main/ant-kit/src/main/resources/fixed-binaries/linux-launcher-x86 new file mode 100644 index 000000000..805062d62 Binary files /dev/null and b/main/ant-kit/src/main/resources/fixed-binaries/linux-launcher-x86 differ diff --git a/main/ant-kit/src/main/resources/package/linux/postinst b/main/ant-kit/src/main/resources/package/linux/postinst new file mode 100644 index 000000000..e77fa6366 --- /dev/null +++ b/main/ant-kit/src/main/resources/package/linux/postinst @@ -0,0 +1,50 @@ +#!/bin/sh +# postinst script for APPLICATION_NAME +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + configure) + echo Adding shortcut to the menu +SECONDARY_LAUNCHERS_INSTALL +APP_CDS_CACHE + xdg-desktop-menu install --novendor /opt/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop +FILE_ASSOCIATION_INSTALL + + rm /opt/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME + if [ $(uname -m) = "x86_64" ]; then + mv /opt/APPLICATION_FS_NAME/app/linux-launcher-x64 /opt/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME + else + mv /opt/APPLICATION_FS_NAME/app/linux-launcher-x86 /opt/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/main/ant-kit/src/main/resources/package/linux/spec b/main/ant-kit/src/main/resources/package/linux/spec new file mode 100644 index 000000000..b40f9224e --- /dev/null +++ b/main/ant-kit/src/main/resources/package/linux/spec @@ -0,0 +1,54 @@ +Summary: APPLICATION_SUMMARY +Name: APPLICATION_PACKAGE +Version: APPLICATION_VERSION +Release: 1 +License: APPLICATION_LICENSE_TYPE +Vendor: APPLICATION_VENDOR +Prefix: /opt +Provides: APPLICATION_PACKAGE +Requires: ld-linux.so.2 libX11.so.6 libXext.so.6 libXi.so.6 libXrender.so.1 libXtst.so.6 libasound.so.2 libc.so.6 libdl.so.2 libgcc_s.so.1 libm.so.6 libpthread.so.0 libthread_db.so.1 +Autoprov: 0 +Autoreq: 0 + +#avoid ARCH subfolder +%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm + +#comment line below to enable effective jar compression +#it could easily get your package size from 40 to 15Mb but +#build time will substantially increase and it may require unpack200/system java to install +%define __jar_repack %{nil} + +%description +APPLICATION_DESCRIPTION + +%prep + +%build + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}/opt +cp -r %{_sourcedir}/APPLICATION_FS_NAME %{buildroot}/opt + +%files +APPLICATION_LICENSE_FILE +/opt/APPLICATION_FS_NAME + +%post +SECONDARY_LAUNCHERS_INSTALL +APP_CDS_CACHE +xdg-desktop-menu install --novendor /opt/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop +FILE_ASSOCIATION_INSTALL +rm /opt/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME +if [ $(uname -m) = "x86_64" ]; then + mv /opt/APPLICATION_FS_NAME/app/linux-launcher-x64 /opt/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME +else + mv /opt/APPLICATION_FS_NAME/app/linux-launcher-x86 /opt/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME +fi + +%preun +SECONDARY_LAUNCHERS_REMOVE +xdg-desktop-menu uninstall --novendor /opt/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop +FILE_ASSOCIATION_REMOVE + +%clean diff --git a/main/commons-test/pom.xml b/main/commons-test/pom.xml index 8ae85edf0..c7fe991e3 100644 --- a/main/commons-test/pom.xml +++ b/main/commons-test/pom.xml @@ -17,19 +17,10 @@ Shared utilities for tests - - org.cryptomator - commons - - junit junit - - org.mockito - mockito-core - de.bechte.junit junit-hierarchicalcontextrunner @@ -38,6 +29,11 @@ org.hamcrest hamcrest-all + + + org.cryptomator + commons + diff --git a/main/commons/pom.xml b/main/commons/pom.xml index 5603f36b5..194123564 100644 --- a/main/commons/pom.xml +++ b/main/commons/pom.xml @@ -44,11 +44,6 @@ junit test - - org.mockito - mockito-core - test - de.bechte.junit junit-hierarchicalcontextrunner diff --git a/main/pom.xml b/main/pom.xml index 75ba59663..414017f36 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -275,6 +275,14 @@ org.apache.logging.log4j log4j-jul + + junit + junit + + + org.mockito + mockito-core + diff --git a/main/ui/src/main/java/org/cryptomator/ui/controllers/SettingsController.java b/main/ui/src/main/java/org/cryptomator/ui/controllers/SettingsController.java index 80cd60cab..7c1532775 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/controllers/SettingsController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/controllers/SettingsController.java @@ -43,6 +43,9 @@ public class SettingsController extends LocalizedFXMLViewController { @FXML private TextField portField; + @FXML + private Label useIpv6Label; + @FXML private CheckBox useIpv6Checkbox; @@ -55,7 +58,8 @@ public class SettingsController extends LocalizedFXMLViewController { checkForUpdatesCheckbox.setSelected(settings.isCheckForUpdatesEnabled() && !areUpdatesManagedExternally()); portField.setText(String.valueOf(settings.getPort())); portField.addEventFilter(KeyEvent.KEY_TYPED, this::filterNumericKeyEvents); - useIpv6Checkbox.setDisable(!SystemUtils.IS_OS_WINDOWS); + useIpv6Label.setVisible(SystemUtils.IS_OS_WINDOWS); + useIpv6Checkbox.setVisible(SystemUtils.IS_OS_WINDOWS); useIpv6Checkbox.setSelected(SystemUtils.IS_OS_WINDOWS && settings.shouldUseIpv6()); versionLabel.setText(String.format(localization.getString("settings.version.label"), applicationVersion().orElse("SNAPSHOT"))); @@ -81,7 +85,7 @@ public class SettingsController extends LocalizedFXMLViewController { private void portDidChange(String newValue) { try { int port = Integer.parseInt(newValue); - if (port < Settings.MIN_PORT || port > Settings.MAX_PORT) { + if (!settings.isPortValid(port)) { settings.setPort(Settings.DEFAULT_PORT); } else { settings.setPort(port); diff --git a/main/ui/src/main/java/org/cryptomator/ui/settings/Settings.java b/main/ui/src/main/java/org/cryptomator/ui/settings/Settings.java index 17f7c5b25..6b00aeb41 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/settings/Settings.java +++ b/main/ui/src/main/java/org/cryptomator/ui/settings/Settings.java @@ -93,8 +93,8 @@ public class Settings implements Serializable { } } - private boolean isPortValid(int port) { - return port == DEFAULT_PORT || port >= MIN_PORT && port <= MAX_PORT; + public boolean isPortValid(int port) { + return port == DEFAULT_PORT || port >= MIN_PORT && port <= MAX_PORT || port == 0; } public boolean shouldUseIpv6() { diff --git a/main/ui/src/main/resources/fxml/settings.fxml b/main/ui/src/main/resources/fxml/settings.fxml index eebe54528..73f26630f 100644 --- a/main/ui/src/main/resources/fxml/settings.fxml +++ b/main/ui/src/main/resources/fxml/settings.fxml @@ -38,7 +38,7 @@ -