From 883205a7ff076a68977eb773c103fd038b0a92df Mon Sep 17 00:00:00 2001 From: NekoInverter <7741672-NekoInverter@users.noreply.gitlab.com> Date: Sat, 19 Dec 2020 15:49:08 +0800 Subject: [PATCH] Update okhttp to 4.9 --- app/build.gradle | 14 ++++++++++++-- .../hippo/ehviewer/client/EhSSLSocketFactory.java | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0dd965d04..f2eec22d7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -45,6 +45,16 @@ android { checkReleaseBuilds true } + packagingOptions { + exclude 'META-INF/**' + exclude 'kotlin/**' + exclude 'org/**' + exclude '**.properties' + exclude '**.bin' + } + + dependenciesInfo.includeInApk false + buildTypes { release { minifyEnabled true @@ -105,8 +115,8 @@ dependencies { implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}" implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}" implementation "com.microsoft.appcenter:appcenter-distribute:${appCenterSdkVersion}" - implementation 'com.squareup.okhttp3:okhttp:3.14.7' - implementation 'com.squareup.okhttp3:okhttp-dnsoverhttps:3.14.7' + implementation 'com.squareup.okhttp3:okhttp:4.9.0' + implementation 'com.squareup.okhttp3:okhttp-dnsoverhttps:4.9.0' implementation 'com.takisoft.preferencex:preferencex:1.1.0' implementation 'com.github.NekoInverter:DrawerLayout:6ba992f8d4' implementation 'com.github.NekoInverter:Image:8fd6c1e1df' diff --git a/app/src/main/java/com/hippo/ehviewer/client/EhSSLSocketFactory.java b/app/src/main/java/com/hippo/ehviewer/client/EhSSLSocketFactory.java index d06cec122..62b3c6711 100644 --- a/app/src/main/java/com/hippo/ehviewer/client/EhSSLSocketFactory.java +++ b/app/src/main/java/com/hippo/ehviewer/client/EhSSLSocketFactory.java @@ -29,7 +29,8 @@ public class EhSSLSocketFactory extends SSLSocketFactory { return ((SSLSocketFactory) getDefault()).createSocket(s, host, port, autoClose); } InetAddress address = s.getInetAddress(); - if (autoClose) s.close(); + // okhttp 4.9 don't like this + //if (autoClose) s.close(); SSLSocket socket = (SSLSocket) getDefault().createSocket(address, port); SSLSession sslSession = socket.getSession(); Log.d("EhSSLSocketFactory", "Host: " + host + " Address: " + address.getHostAddress() + " Protocol:" + sslSession.getProtocol() + " CipherSuite:" + sslSession.getCipherSuite());