bugfix, version upgrade

This commit is contained in:
nuclearfog 2022-03-20 19:41:21 +01:00
parent 48288dfe05
commit 4f1f13372a
No known key found for this signature in database
GPG Key ID: AA0271FBE406DB98
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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<ConnectionSpec> 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
}