File tree Expand file tree Collapse file tree 4 files changed +22
-5
lines changed
src/main/java/org/cryptomator/linux/keychain Expand file tree Collapse file tree 4 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <module type =" JAVA_MODULE" version =" 4" />
2+ <module type =" JAVA_MODULE" version =" 4" />
Original file line number Diff line number Diff line change 55 <modelVersion >4.0.0</modelVersion >
66 <groupId >org.cryptomator</groupId >
77 <artifactId >integrations-linux</artifactId >
8- <version >0.1.1 </version >
8+ <version >0.2.0-SNAPSHOT </version >
99
1010 <name >integrations-linux</name >
1111 <description >Provides optional Linux services used by Cryptomator</description >
3838 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
3939
4040 <!-- runtime dependencies -->
41- <api .version>0.1.3 </api .version>
42- <secret-service .version>1.2.1 </secret-service .version>
43- <kdewallet .version>1.1.1 </kdewallet .version>
41+ <api .version>1.0.0-beta2 </api .version>
42+ <secret-service .version>1.5.0 </secret-service .version>
43+ <kdewallet .version>1.2.0 </kdewallet .version>
4444 <guava .version>30.0-jre</guava .version>
4545 <slf4j .version>1.7.30</slf4j .version>
4646 <junit .version>5.7.0</junit .version>
Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ public boolean isSupported() {
4747 return wallet .map (ConnectedWallet ::isSupported ).orElse (false );
4848 }
4949
50+ @ Override
51+ public boolean isLocked () {
52+ return wallet .map (ConnectedWallet ::isLocked ).orElse (false );
53+ }
54+
5055 @ Override
5156 public void storePassphrase (String key , CharSequence passphrase ) throws KeychainAccessException {
5257 Preconditions .checkState (wallet .isPresent (), "Keychain not supported." );
@@ -84,6 +89,8 @@ public boolean isSupported() {
8489 return wallet .isEnabled ();
8590 }
8691
92+ public boolean isLocked () { return !wallet .isOpen (Static .DEFAULT_WALLET ); }
93+
8794 public void storePassphrase (String key , CharSequence passphrase ) throws KeychainAccessException {
8895 try {
8996 if (walletIsOpen () &&
Original file line number Diff line number Diff line change @@ -23,6 +23,16 @@ public boolean isSupported() {
2323 }
2424 }
2525
26+ @ Override
27+ public boolean isLocked () {
28+ try (@ SuppressWarnings ("unused" ) SimpleCollection keyring = new SimpleCollection ()) {
29+ // seems like we're able to access the keyring.
30+ return keyring .isLocked ();
31+ } catch (IOException | ExceptionInInitializerError | RuntimeException e ) {
32+ return true ;
33+ }
34+ }
35+
2636 @ Override
2737 public void storePassphrase (String key , CharSequence passphrase ) throws KeychainAccessException {
2838 try (SimpleCollection keyring = new SimpleCollection ()) {
You can’t perform that action at this time.
0 commit comments