diff --git a/app/build.gradle b/app/build.gradle index a57ee27c..b0cd3071 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { applicationId 'org.nuclearfog.twidda' minSdkVersion 16 targetSdkVersion 31 - versionCode 56 - versionName '2.0.3' + versionCode 57 + versionName '2.0.4' // limiting language support for smaller APK size resConfigs 'en', 'de-rDE', 'zh-rCN' vectorDrawables.useSupportLibrary true diff --git a/app/src/main/java/org/nuclearfog/twidda/backend/api/Twitter.java b/app/src/main/java/org/nuclearfog/twidda/backend/api/Twitter.java index 0e337e15..52ad7d86 100644 --- a/app/src/main/java/org/nuclearfog/twidda/backend/api/Twitter.java +++ b/app/src/main/java/org/nuclearfog/twidda/backend/api/Twitter.java @@ -43,6 +43,7 @@ import java.util.concurrent.TimeUnit; import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.X509TrustManager; +import okhttp3.ConnectionSpec; import okhttp3.MediaType; import okhttp3.MultipartBody; import okhttp3.OkHttpClient; @@ -160,6 +161,11 @@ public class Twitter implements GlobalSettings.SettingsListener { factory.init((KeyStore) null); X509TrustManager manager = (X509TrustManager) factory.getTrustManagers()[0]; builder.sslSocketFactory(new TLSSocketFactory(), manager); + + // quick fix because of handshake error on pre lollipop devices + List supportTls = new ArrayList<>(); + supportTls.add(new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS).allEnabledTlsVersions().allEnabledCipherSuites().build()); + builder.connectionSpecs(supportTls); } catch (Exception e) { // ignore, try with default setting }