TLS 1.3 support for Android < 10
Should fix https://github.com/inorichi/tachiyomi-extensions/issues/3233 (cherry picked from commit 31015504f4d0df3d0a4b185fb754f1224dfe1c0c) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/App.kt
This commit is contained in:
parent
70246b0e02
commit
2ee0e5ee42
@ -175,6 +175,9 @@ dependencies {
|
|||||||
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version"
|
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version"
|
||||||
implementation 'com.squareup.okio:okio:2.6.0'
|
implementation 'com.squareup.okio:okio:2.6.0'
|
||||||
|
|
||||||
|
// TLS 1.3 support for Android < 10
|
||||||
|
implementation 'org.conscrypt:conscrypt-android:2.4.0'
|
||||||
|
|
||||||
// REST
|
// REST
|
||||||
final retrofit_version = '2.9.0'
|
final retrofit_version = '2.9.0'
|
||||||
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
|
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
|
||||||
|
@ -42,10 +42,12 @@ import io.realm.Realm
|
|||||||
import io.realm.RealmConfiguration
|
import io.realm.RealmConfiguration
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.security.NoSuchAlgorithmException
|
import java.security.NoSuchAlgorithmException
|
||||||
|
import java.security.Security
|
||||||
import javax.net.ssl.SSLContext
|
import javax.net.ssl.SSLContext
|
||||||
import kotlin.concurrent.thread
|
import kotlin.concurrent.thread
|
||||||
import kotlinx.coroutines.GlobalScope
|
import kotlinx.coroutines.GlobalScope
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import org.conscrypt.Conscrypt
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.InjektScope
|
import uy.kohesive.injekt.api.InjektScope
|
||||||
@ -67,6 +69,11 @@ open class App : Application(), LifecycleObserver {
|
|||||||
ForceCloseActivity.closeApp(this)
|
ForceCloseActivity.closeApp(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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 = InjektScope(DefaultRegistrar())
|
||||||
Injekt.importModule(AppModule(this))
|
Injekt.importModule(AppModule(this))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user