diff --git a/News-Android-App/build.gradle b/News-Android-App/build.gradle index 9f48abb48..d6f358930 100644 --- a/News-Android-App/build.gradle +++ b/News-Android-App/build.gradle @@ -123,7 +123,7 @@ repositories { final DAGGER_VERSION = '2.57' final GLIDE_VERSION = '4.16.0' final ESPRESSO_VERSION = '3.7.0' -final OKHTTP_VERSION = '4.12.0' +final OKHTTP_VERSION = '5.3.2' final MOCKITO_VERSION = '5.18.0' final RETROFIT_VERSION = '3.0.0' @@ -135,8 +135,9 @@ dependencies { // implementation 'com.google.android.gms:play-services:4.2.42' // implementation project(path: ':MaterialShowcaseView:library', configuration: 'default') // implementation project(':Android-SingleSignOn:lib') - implementation 'com.github.nextcloud:Android-SingleSignOn:1.3.4' - implementation "androidx.core:core:1.16.0" + implementation 'com.github.nextcloud:Android-SingleSignOn:f401ec4' + // latest version which uses OKHTTP 5 + implementation "androidx.core:core:1.17.0" implementation 'androidx.annotation:annotation:1.9.1' implementation "androidx.appcompat:appcompat:1.7.1" implementation "androidx.preference:preference:1.2.1" diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/ssl/OkHttpSSLClient.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/ssl/OkHttpSSLClient.java index 36f1aac8a..5951d4113 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/ssl/OkHttpSSLClient.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/ssl/OkHttpSSLClient.java @@ -31,7 +31,6 @@ import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; -import okhttp3.internal.Util; import okhttp3.logging.HttpLoggingInterceptor; /** @@ -115,27 +114,20 @@ private static X509TrustManager systemDefaultTrustManager() { } } - private static class AuthorizationInterceptor implements Interceptor { - - private final String mCredentials; - private final HttpUrl mHostUrl; - - AuthorizationInterceptor(HttpUrl hostUrl, String credentials) { - this.mHostUrl = hostUrl; - this.mCredentials = credentials; - } + private record AuthorizationInterceptor(HttpUrl mHostUrl, + String mCredentials) implements Interceptor { @NonNull - @Override - public Response intercept(Chain chain) throws IOException { - Request request = chain.request(); - - // only add Authorization header for urls on the configured owncloud/nextcloud host - if (mHostUrl.url().getHost().equals(request.url().host())) - request = request.newBuilder() - .addHeader("Authorization", mCredentials) - .build(); - return chain.proceed(request); + @Override + public Response intercept(Chain chain) throws IOException { + Request request = chain.request(); + + // only add Authorization header for urls on the configured owncloud/nextcloud host + if (mHostUrl.url().getHost().equals(request.url().host())) + request = request.newBuilder() + .addHeader("Authorization", mCredentials) + .build(); + return chain.proceed(request); + } } - } } diff --git a/gradle.properties b/gradle.properties index f0bba37c3..d4339e584 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ ANDROID_BUILD_MIN_SDK_VERSION=21 ANDROID_BUILD_TARGET_SDK_VERSION=35 -ANDROID_BUILD_SDK_VERSION=35 +ANDROID_BUILD_SDK_VERSION=36 android.useAndroidX=true android.enableJetifier=true org.gradle.dependency.verification.console=verbose