TLS 1.3 support for Android < 10 (#519)

This commit is contained in:
Yu Xiao 2020-07-31 08:12:25 +08:00 committed by GitHub
parent 5eb5042622
commit 45eab517d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -248,6 +248,9 @@ dependencies {
implementation("info.debatty:java-string-similarity:1.2.1")
implementation("com.google.android.gms:play-services-oss-licenses:${Versions.OSS_LICENSE}")
// TLS 1.3 support for Android < 10
implementation("org.conscrypt:conscrypt-android:2.4.0")
}

View File

@ -3,6 +3,7 @@ package eu.kanade.tachiyomi
import android.app.Application
import android.content.Context
import android.content.res.Configuration
import android.os.Build
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent
@ -16,11 +17,13 @@ import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate
import eu.kanade.tachiyomi.util.system.LocaleHelper
import org.acra.ACRA
import org.acra.annotation.ReportsCrashes
import org.conscrypt.Conscrypt
import timber.log.Timber
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.InjektScope
import uy.kohesive.injekt.injectLazy
import uy.kohesive.injekt.registry.default.DefaultRegistrar
import java.security.Security
@ReportsCrashes(
formUri = "https://collector.tracepot.com/e90773ff",
@ -35,6 +38,11 @@ open class App : Application(), LifecycleObserver {
super.onCreate()
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())
// TLS 1.3 support for Android 10 and below
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
Security.insertProviderAt(Conscrypt.newProvider(), 1)
}
Injekt = InjektScope(DefaultRegistrar())
Injekt.importModule(AppModule(this))