Skip to content

Commit bdc28c2

Browse files
authored
Merge branch 'cryptomator:develop' into feature/thumbnail-playground
2 parents a45edea + 739cc6c commit bdc28c2

File tree

124 files changed

+3179
-220
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+3179
-220
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- Ensure you're running the latest version of Cryptomator.
66
- Ensure the bug is related to the Android version of Cryptomator. Bugs concerning the Cryptomator desktop application and iOS app can be reported on the [Cryptomator issues list](https://github.com/cryptomator/cryptomator/issues) and [Cryptomator for iOS issues list](https://github.com/cryptomator/cryptomator-ios/issues) respectively.
7-
- Ensure the bug was not [already reported](https://github.com/cryptomator/android/issues). You can also check out our [FAQ](https://community.cryptomator.org/c/faq).
7+
- Ensure the bug was not [already reported](https://github.com/cryptomator/android/issues). You can also check out our [FAQ](https://community.cryptomator.org/c/kb/faq).
88
- If you're unable to find an open issue addressing the problem, [submit a new one](https://github.com/cryptomator/android/issues/new).
99

1010
## Code of Conduct

.github/SUPPORT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ For _everything else_, please visit our official [Cryptomator Community](https:/
1414
- Discussions about the apps
1515
- [Development discussions](https://community.cryptomator.org/c/development)
1616
- General questions
17-
- Discussions regarding our design decissions
17+
- Discussions regarding our design decisions
1818
- Our roadmap

Gemfile.lock

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@ GEM
55
base64
66
nkf
77
rexml
8-
addressable (2.8.6)
9-
public_suffix (>= 2.0.2, < 6.0)
8+
addressable (2.8.7)
9+
public_suffix (>= 2.0.2, < 7.0)
1010
apktools (0.7.5)
1111
rubyzip (~> 2.0)
1212
artifactory (3.0.17)
1313
atomos (0.1.3)
1414
aws-eventstream (1.3.0)
15-
aws-partitions (1.933.0)
16-
aws-sdk-core (3.196.1)
15+
aws-partitions (1.1027.0)
16+
aws-sdk-core (3.214.0)
1717
aws-eventstream (~> 1, >= 1.3.0)
18-
aws-partitions (~> 1, >= 1.651.0)
19-
aws-sigv4 (~> 1.8)
18+
aws-partitions (~> 1, >= 1.992.0)
19+
aws-sigv4 (~> 1.9)
2020
jmespath (~> 1, >= 1.6.1)
21-
aws-sdk-kms (1.82.0)
22-
aws-sdk-core (~> 3, >= 3.193.0)
23-
aws-sigv4 (~> 1.1)
24-
aws-sdk-s3 (1.151.0)
25-
aws-sdk-core (~> 3, >= 3.194.0)
21+
aws-sdk-kms (1.96.0)
22+
aws-sdk-core (~> 3, >= 3.210.0)
23+
aws-sigv4 (~> 1.5)
24+
aws-sdk-s3 (1.176.1)
25+
aws-sdk-core (~> 3, >= 3.210.0)
2626
aws-sdk-kms (~> 1)
27-
aws-sigv4 (~> 1.8)
28-
aws-sigv4 (1.8.0)
27+
aws-sigv4 (~> 1.5)
28+
aws-sigv4 (1.10.1)
2929
aws-eventstream (~> 1, >= 1.0.2)
3030
babosa (1.0.4)
3131
base64 (0.2.0)
@@ -42,8 +42,8 @@ GEM
4242
dotenv (2.8.1)
4343
ed25519 (1.3.0)
4444
emoji_regex (3.2.3)
45-
excon (0.110.0)
46-
faraday (1.10.3)
45+
excon (0.112.0)
46+
faraday (1.10.4)
4747
faraday-em_http (~> 1.0)
4848
faraday-em_synchrony (~> 1.0)
4949
faraday-excon (~> 1.1)
@@ -62,17 +62,17 @@ GEM
6262
faraday-em_synchrony (1.0.0)
6363
faraday-excon (1.1.0)
6464
faraday-httpclient (1.0.1)
65-
faraday-multipart (1.0.4)
66-
multipart-post (~> 2)
67-
faraday-net_http (1.0.1)
65+
faraday-multipart (1.1.0)
66+
multipart-post (~> 2.0)
67+
faraday-net_http (1.0.2)
6868
faraday-net_http_persistent (1.2.0)
6969
faraday-patron (1.0.0)
7070
faraday-rack (1.0.0)
7171
faraday-retry (1.0.3)
72-
faraday_middleware (1.2.0)
72+
faraday_middleware (1.2.1)
7373
faraday (~> 1.0)
7474
fastimage (2.3.1)
75-
fastlane (2.220.0)
75+
fastlane (2.226.0)
7676
CFPropertyList (>= 2.3, < 4.0.0)
7777
addressable (>= 2.8, < 3.0.0)
7878
artifactory (~> 3.0)
@@ -88,6 +88,7 @@ GEM
8888
faraday-cookie_jar (~> 0.0.6)
8989
faraday_middleware (~> 1.0)
9090
fastimage (>= 2.1.0, < 3.0.0)
91+
fastlane-sirp (>= 1.0.0)
9192
gh_inspector (>= 1.1.2, < 2.0.0)
9293
google-apis-androidpublisher_v3 (~> 0.3)
9394
google-apis-playcustomapp_v1 (~> 0.1)
@@ -111,13 +112,15 @@ GEM
111112
tty-spinner (>= 0.8.0, < 1.0.0)
112113
word_wrap (~> 1.0.0)
113114
xcodeproj (>= 1.13.0, < 2.0.0)
114-
xcpretty (~> 0.3.0)
115+
xcpretty (~> 0.4.0)
115116
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
116117
fastlane-plugin-aws_s3 (2.1.0)
117118
apktools (~> 0.7)
118119
aws-sdk-s3 (~> 1)
119120
mime-types (~> 3.3)
120121
fastlane-plugin-get_version_name (0.2.2)
122+
fastlane-sirp (1.0.0)
123+
sysrandom (~> 1.0)
121124
gh_inspector (1.1.3)
122125
google-apis-androidpublisher_v3 (0.54.0)
123126
google-apis-core (>= 0.11.0, < 2.a)
@@ -135,7 +138,7 @@ GEM
135138
google-apis-core (>= 0.11.0, < 2.a)
136139
google-apis-storage_v1 (0.31.0)
137140
google-apis-core (>= 0.11.0, < 2.a)
138-
google-cloud-core (1.7.0)
141+
google-cloud-core (1.7.1)
139142
google-cloud-env (>= 1.0, < 3.a)
140143
google-cloud-errors (~> 1.0)
141144
google-cloud-env (1.6.0)
@@ -156,39 +159,40 @@ GEM
156159
os (>= 0.9, < 2.0)
157160
signet (>= 0.16, < 2.a)
158161
highline (2.0.3)
159-
http-cookie (1.0.5)
162+
http-cookie (1.0.8)
160163
domain_name (~> 0.5)
161164
httpclient (2.8.3)
162165
jmespath (1.6.2)
163-
json (2.7.2)
164-
jwt (2.8.1)
166+
json (2.9.1)
167+
jwt (2.9.3)
165168
base64
166-
mime-types (3.5.2)
169+
logger (1.6.4)
170+
mime-types (3.6.0)
171+
logger
167172
mime-types-data (~> 3.2015)
168-
mime-types-data (3.2024.0507)
169-
mini_magick (4.12.0)
173+
mime-types-data (3.2024.1203)
174+
mini_magick (4.13.2)
170175
mini_mime (1.1.5)
171176
multi_json (1.15.0)
172177
multipart-post (2.4.1)
173-
nanaimo (0.3.0)
178+
nanaimo (0.4.0)
174179
naturally (2.2.1)
175180
net-sftp (4.0.0)
176181
net-ssh (>= 5.0.0, < 8.0.0)
177-
net-ssh (7.2.3)
182+
net-ssh (7.3.0)
178183
nkf (0.2.0)
179-
optparse (0.5.0)
184+
optparse (0.6.0)
180185
os (1.1.4)
181186
plist (3.7.1)
182-
public_suffix (5.0.5)
187+
public_suffix (6.0.1)
183188
rake (13.2.1)
184189
representable (3.2.0)
185190
declarative (< 0.1.0)
186191
trailblazer-option (>= 0.1.1, < 0.2.0)
187192
uber (< 0.2.0)
188193
retriable (3.1.2)
189-
rexml (3.2.8)
190-
strscan (>= 3.0.9)
191-
rouge (2.0.7)
194+
rexml (3.4.0)
195+
rouge (3.28.0)
192196
ruby2_keywords (0.0.5)
193197
rubyzip (2.3.2)
194198
security (0.1.5)
@@ -200,7 +204,7 @@ GEM
200204
simctl (1.6.10)
201205
CFPropertyList
202206
naturally
203-
strscan (3.1.0)
207+
sysrandom (1.0.5)
204208
terminal-notifier (2.0.0)
205209
terminal-table (3.0.2)
206210
unicode-display_width (>= 1.1.1, < 3)
@@ -210,17 +214,17 @@ GEM
210214
tty-spinner (0.9.3)
211215
tty-cursor (~> 0.7)
212216
uber (0.1.0)
213-
unicode-display_width (2.5.0)
217+
unicode-display_width (2.6.0)
214218
word_wrap (1.0.0)
215-
xcodeproj (1.24.0)
219+
xcodeproj (1.27.0)
216220
CFPropertyList (>= 2.3.3, < 4.0)
217221
atomos (~> 0.1.3)
218222
claide (>= 1.0.2, < 2.0)
219223
colored2 (~> 3.1)
220-
nanaimo (~> 0.3.0)
221-
rexml (~> 3.2.4)
222-
xcpretty (0.3.0)
223-
rouge (~> 2.0.7)
224+
nanaimo (~> 0.4.0)
225+
rexml (>= 3.3.6, < 4.0)
226+
xcpretty (0.4.0)
227+
rouge (~> 3.28.0)
224228
xcpretty-travis-formatter (1.0.1)
225229
xcpretty (~> 0.2, >= 0.0.7)
226230

@@ -236,4 +240,4 @@ DEPENDENCIES
236240
net-sftp
237241

238242
BUNDLED WITH
239-
2.2.5
243+
2.6.0

buildsystem/dependencies.gradle

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,18 @@ ext {
6060
rxAndroidVersion = '2.1.1'
6161
rxBindingVersion = '2.2.0'
6262

63-
daggerVersion = '2.51.1'
63+
daggerVersion = '2.54'
6464

6565
gsonVersion = '2.11.0'
6666

67+
joseJwtVersion = '9.48'
68+
69+
appauthVersion = '0.11.1'
70+
6771
okHttpVersion = '4.12.0'
68-
okHttpDigestVersion = '3.1.0'
72+
okHttpDigestVersion = '3.1.1'
6973

70-
velocityVersion = '2.3'
74+
velocityVersion = '2.4.1'
7175

7276
timberVersion = '5.0.1'
7377

@@ -81,7 +85,7 @@ ext {
8185
greenDaoVersion = '3.3.0'
8286

8387
// cloud provider libs
84-
cryptolibVersion = '2.1.2'
88+
cryptolibVersion = '2.2.0'
8589

8690
dropboxVersion = '7.0.0'
8791

@@ -93,20 +97,21 @@ ext {
9397
msgraphVersion = '5.47.0'
9498
msgraphAuthVersion = '4.0.5' // contains com.microsoft.identity:common lib which added opentelemetry in 9.0.0, do we need to fork another lib before updating to >=4.2.0 ???
9599

96-
minIoVersion = '8.5.10'
100+
minIoVersion = '8.5.14'
97101
pcloudVersion = '1.9.2-dev.0001'
98102
staxVersion = '1.2.0' // needed for minIO
99-
commonsCodecVersion = '1.17.0'
103+
commonsCodecVersion = '1.17.1'
100104

101105
recyclerViewFastScrollVersion = '2.0.1'
102106

103107
// testing dependencies
104108

105-
jUnitVersion = '5.10.2'
109+
jUnitVersion = '5.11.4'
106110
assertJVersion = '1.7.1'
107-
mockitoVersion = '5.12.0'
108-
mockitoKotlinVersion = '5.3.1'
111+
mockitoVersion = '5.14.2'
112+
mockitoKotlinVersion = '5.4.0'
109113
mockitoInlineVersion = '5.2.0'
114+
mockitoAndroidVersion = '5.14.2'
110115
hamcrestVersion = '1.3'
111116
dexmakerVersion = '1.0'
112117
espressoVersion = '3.4.0'
@@ -140,6 +145,7 @@ ext {
140145
androidxViewpager : "androidx.viewpager:viewpager:${androidxViewpagerVersion}",
141146
androidxSwiperefresh : "androidx.swiperefreshlayout:swiperefreshlayout:${androidxSwiperefreshVersion}",
142147
androidxPreference : "androidx.preference:preference:${androidxPreferenceVersion}",
148+
appauth : "net.openid:appauth:${appauthVersion}",
143149
documentFile : "androidx.documentfile:documentfile:${androidxDocumentfileVersion}",
144150
recyclerView : "androidx.recyclerview:recyclerview:${androidxRecyclerViewVersion}",
145151
androidxSplashscreen : "androidx.core:core-splashscreen:${androidxSplashscreenVersion}",
@@ -163,6 +169,7 @@ ext {
163169
gson : "com.google.code.gson:gson:${gsonVersion}",
164170
hamcrest : "org.hamcrest:hamcrest-all:${hamcrestVersion}",
165171
javaxAnnotation : "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
172+
joseJwt : "com.nimbusds:nimbus-jose-jwt:${joseJwtVersion}",
166173
junit : "org.junit.jupiter:junit-jupiter:${jUnitVersion}",
167174
junitApi : "org.junit.jupiter:junit-jupiter-api:${jUnitVersion}",
168175
junitEngine : "org.junit.jupiter:junit-jupiter-engine:${jUnitVersion}",
@@ -172,6 +179,7 @@ ext {
172179
mockito : "org.mockito:mockito-core:${mockitoVersion}",
173180
mockitoInline : "org.mockito:mockito-inline:${mockitoInlineVersion}",
174181
mockitoKotlin : "org.mockito.kotlin:mockito-kotlin:${mockitoKotlinVersion}",
182+
mockitoAndroid : "org.mockito:mockito-android:${mockitoAndroidVersion}",
175183
msgraph : "com.microsoft.graph:microsoft-graph:${msgraphVersion}",
176184
msgraphAuth : "com.microsoft.identity.client:msal:${msgraphAuthVersion}",
177185
multidex : "androidx.multidex:multidex:${multidexVersion}",

data/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ dependencies {
196196
compileOnly dependencies.javaxAnnotation
197197
implementation dependencies.gson
198198

199+
implementation dependencies.joseJwt
200+
199201
implementation dependencies.commonsCodec
200202

201203
implementation dependencies.documentFile

data/src/main/java/org/cryptomator/data/cloud/crypto/CryptoCloudFactory.java

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@
99
import org.cryptomator.domain.UnverifiedVaultConfig;
1010
import org.cryptomator.domain.Vault;
1111
import org.cryptomator.domain.exception.BackendException;
12+
import org.cryptomator.domain.exception.FatalBackendException;
1213
import org.cryptomator.domain.repository.CloudContentRepository;
1314
import org.cryptomator.domain.usecases.ProgressAware;
1415
import org.cryptomator.domain.usecases.cloud.Flag;
1516
import org.cryptomator.domain.usecases.vault.UnlockToken;
1617

1718
import java.io.ByteArrayOutputStream;
1819
import java.nio.charset.StandardCharsets;
20+
import java.security.NoSuchAlgorithmException;
1921
import java.security.SecureRandom;
2022

2123
import javax.inject.Inject;
2224
import javax.inject.Singleton;
2325

24-
import static org.cryptomator.data.cloud.crypto.CryptoConstants.MASTERKEY_SCHEME;
2526
import static org.cryptomator.data.cloud.crypto.CryptoConstants.VAULT_FILE_NAME;
2627
import static org.cryptomator.domain.Vault.aCopyOf;
2728

@@ -30,7 +31,6 @@ public class CryptoCloudFactory {
3031

3132
private final CloudContentRepository<Cloud, CloudNode, CloudFolder, CloudFile> cloudContentRepository;
3233
private final CryptoCloudContentRepositoryFactory cryptoCloudContentRepositoryFactory;
33-
private final SecureRandom secureRandom = new SecureRandom();
3434

3535
@Inject
3636
public CryptoCloudFactory(CloudContentRepository/*<Cloud, CloudNode, CloudFolder, CloudFile>*/ cloudContentRepository, //
@@ -40,7 +40,7 @@ public CryptoCloudFactory(CloudContentRepository/*<Cloud, CloudNode, CloudFolder
4040
}
4141

4242
public void create(CloudFolder location, CharSequence password) throws BackendException {
43-
cryptoCloudProvider(Optional.absent()).create(location, password);
43+
masterkeyCryptoCloudProvider().create(location, password);
4444
}
4545

4646
public Cloud decryptedViewOf(Vault vault) throws BackendException {
@@ -68,6 +68,10 @@ public Vault unlock(UnlockToken token, Optional<UnverifiedVaultConfig> unverifie
6868
return cryptoCloudProvider(unverifiedVaultConfig).unlock(token, unverifiedVaultConfig, password, cancelledFlag);
6969
}
7070

71+
public Vault unlock(Vault vault, UnverifiedVaultConfig unverifiedVaultConfig, String vaultKeyJwe, String userKeyJwe, Flag cancelledFlag) throws BackendException {
72+
return cryptoCloudProvider(unverifiedVaultConfig).unlock(vault, unverifiedVaultConfig, vaultKeyJwe, userKeyJwe, cancelledFlag);
73+
}
74+
7175
public UnlockToken createUnlockToken(Vault vault, Optional<UnverifiedVaultConfig> unverifiedVaultConfig) throws BackendException {
7276
return cryptoCloudProvider(unverifiedVaultConfig).createUnlockToken(vault, unverifiedVaultConfig);
7377
}
@@ -84,14 +88,30 @@ public void changePassword(Vault vault, Optional<UnverifiedVaultConfig> unverifi
8488
cryptoCloudProvider(unverifiedVaultConfig).changePassword(vault, unverifiedVaultConfig, oldPassword, newPassword);
8589
}
8690

91+
private CryptoCloudProvider masterkeyCryptoCloudProvider() {
92+
return cryptoCloudProvider(Optional.absent());
93+
}
94+
95+
private CryptoCloudProvider cryptoCloudProvider(UnverifiedVaultConfig unverifiedVaultConfigOptional) {
96+
return cryptoCloudProvider(Optional.of(unverifiedVaultConfigOptional));
97+
}
98+
8799
private CryptoCloudProvider cryptoCloudProvider(Optional<UnverifiedVaultConfig> unverifiedVaultConfigOptional) {
88100
if (unverifiedVaultConfigOptional.isPresent()) {
89-
if (MASTERKEY_SCHEME.equals(unverifiedVaultConfigOptional.get().getKeyId().getScheme())) {
90-
return new MasterkeyCryptoCloudProvider(cloudContentRepository, cryptoCloudContentRepositoryFactory, secureRandom);
91-
}
92-
throw new IllegalStateException(String.format("Provider with scheme %s not supported", unverifiedVaultConfigOptional.get().getKeyId().getScheme()));
101+
return switch (unverifiedVaultConfigOptional.get().keyLoadingStrategy()) {
102+
case MASTERKEY -> new MasterkeyCryptoCloudProvider(cloudContentRepository, cryptoCloudContentRepositoryFactory, secureRandom());
103+
case HUB -> new HubkeyCryptoCloudProvider(cryptoCloudContentRepositoryFactory, secureRandom());
104+
};
93105
} else {
94-
return new MasterkeyCryptoCloudProvider(cloudContentRepository, cryptoCloudContentRepositoryFactory, secureRandom);
106+
return new MasterkeyCryptoCloudProvider(cloudContentRepository, cryptoCloudContentRepositoryFactory, secureRandom());
107+
}
108+
}
109+
110+
private SecureRandom secureRandom() {
111+
try {
112+
return SecureRandom.getInstanceStrong();
113+
} catch (NoSuchAlgorithmException e) {
114+
throw new FatalBackendException("A strong algorithm must exist in every Java platform.", e);
95115
}
96116
}
97117
}

0 commit comments

Comments
 (0)