Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit e5e226d

Browse files
authored
Merge pull request #325 from owncloud/feature/android10
Upgrade target version to v29
2 parents d157c10 + 76a808c commit e5e226d

File tree

4 files changed

+20
-15
lines changed

4 files changed

+20
-15
lines changed

owncloudComLibrary/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ allOpen {
2323
}
2424

2525
android {
26-
compileSdkVersion 28
26+
compileSdkVersion 29
2727

2828
defaultConfig {
2929
minSdkVersion 21
30-
targetSdkVersion 28
30+
targetSdkVersion 29
3131

3232
versionCode = 10000500
3333
versionName = "1.0.5"

owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpClient.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,21 @@ public static OkHttpClient getOkHttpClient() {
7171
SSLContext sslContext;
7272

7373
try {
74-
sslContext = SSLContext.getInstance("TLSv1.2");
75-
} catch (NoSuchAlgorithmException tlsv12Exception) {
74+
sslContext = SSLContext.getInstance("TLSv1.3");
75+
} catch (NoSuchAlgorithmException tlsv13Exception) {
7676
try {
77-
Timber.w("TLSv1.2 is not supported in this device; falling through TLSv1.1");
78-
sslContext = SSLContext.getInstance("TLSv1.1");
79-
} catch (NoSuchAlgorithmException tlsv11Exception) {
80-
Timber.w("TLSv1.1 is not supported in this device; falling through TLSv1.0");
81-
sslContext = SSLContext.getInstance("TLSv1");
82-
// should be available in any device; see reference of supported protocols in
83-
// http://developer.android.com/reference/javax/net/ssl/SSLSocket.html
77+
Timber.w("TLSv1.3 is not supported in this device; falling through TLSv1.2");
78+
sslContext = SSLContext.getInstance("TLSv1.2");
79+
} catch (NoSuchAlgorithmException tlsv12Exception) {
80+
try {
81+
Timber.w("TLSv1.2 is not supported in this device; falling through TLSv1.1");
82+
sslContext = SSLContext.getInstance("TLSv1.1");
83+
} catch (NoSuchAlgorithmException tlsv11Exception) {
84+
Timber.w("TLSv1.1 is not supported in this device; falling through TLSv1.0");
85+
sslContext = SSLContext.getInstance("TLSv1");
86+
// should be available in any device; see reference of supported protocols in
87+
// http://developer.android.com/reference/javax/net/ssl/SSLSocket.html
88+
}
8489
}
8590
}
8691

owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/TLSSocketFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public Socket createSocket(InetAddress address, int port, InetAddress localAddre
7474
}
7575

7676
private Socket enableTLSOnSocket(Socket socket) {
77-
if(socket != null && (socket instanceof SSLSocket)) {
78-
((SSLSocket)socket).setEnabledProtocols(new String[] {"TLSv1.1", "TLSv1.2"});
77+
if((socket instanceof SSLSocket)) {
78+
((SSLSocket)socket).setEnabledProtocols(new String[] {"TLSv1.1", "TLSv1.2", "TLSv1.3"});
7979
}
8080
return socket;
8181
}

sample_client/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ dependencies {
55
}
66

77
android {
8-
compileSdkVersion 28
8+
compileSdkVersion 29
99

1010
defaultConfig {
1111
minSdkVersion 21
12-
targetSdkVersion 28
12+
targetSdkVersion 29
1313

1414
// This is pretty ugly but manifest placeholders don't seem to work very well when using different modules
1515
// See https://github.com/openid/AppAuth-Android/issues/325

0 commit comments

Comments
 (0)