File tree Expand file tree Collapse file tree
src/main/java/org/cryptomator/linux/keychain Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import org .freedesktop .dbus .connections .impl .DBusConnectionBuilder ;
1010import org .freedesktop .dbus .exceptions .DBusConnectionException ;
1111import org .freedesktop .dbus .exceptions .DBusException ;
12+ import org .freedesktop .dbus .exceptions .DBusExecutionException ;
1213import org .kde .KWallet ;
1314import org .kde .Static ;
1415import org .purejava .KDEWallet ;
@@ -28,7 +29,13 @@ public class KDEWalletKeychainAccess implements KeychainAccessProvider {
2829 private final Optional <ConnectedWallet > wallet ;
2930
3031 public KDEWalletKeychainAccess () {
31- this .wallet = ConnectedWallet .connect ();
32+ Optional <ConnectedWallet > tmp ;
33+ try { //TODO: remove try-catch once KDEWallet lib is fixed
34+ tmp = ConnectedWallet .connect ();
35+ } catch (DBusExecutionException e ) {
36+ tmp = Optional .empty ();
37+ }
38+ wallet = tmp ;
3239 }
3340
3441 @ Override
Original file line number Diff line number Diff line change 44import org .cryptomator .integrations .common .Priority ;
55import org .cryptomator .integrations .keychain .KeychainAccessException ;
66import org .cryptomator .integrations .keychain .KeychainAccessProvider ;
7+ import org .freedesktop .dbus .exceptions .DBusConnectionException ;
8+ import org .freedesktop .dbus .exceptions .DBusExecutionException ;
79import org .freedesktop .secret .simple .SimpleCollection ;
810
911import java .io .IOException ;
@@ -23,7 +25,16 @@ public String displayName() {
2325
2426 @ Override
2527 public boolean isSupported () {
26- return SimpleCollection .isAvailable ();
28+ try {
29+ return SimpleCollection .isAvailable ();
30+ } catch (ExceptionInInitializerError e ) {
31+ //TODO: remove try-catch once secret-service lib is fixed
32+ if (e .getException () instanceof DBusExecutionException ) {
33+ return false ;
34+ } else {
35+ throw e ;
36+ }
37+ }
2738 }
2839
2940 @ Override
You can’t perform that action at this time.
0 commit comments