Remove TachiEH Android 7 SSL Workaround, no idea why it was used
This commit is contained in:
parent
cafce0ed5f
commit
78d2881b4b
@ -274,9 +274,6 @@ dependencies {
|
|||||||
// debugImplementation("com.squareup.leakcanary:leakcanary-android:2.7")
|
// debugImplementation("com.squareup.leakcanary:leakcanary-android:2.7")
|
||||||
|
|
||||||
// SY -->
|
// SY -->
|
||||||
// [EXH] Android 7 SSL Workaround
|
|
||||||
implementation("com.google.android.gms:play-services-safetynet:17.0.0")
|
|
||||||
|
|
||||||
// Changelog
|
// Changelog
|
||||||
implementation("com.github.gabrielemariotti.changeloglib:changelog:2.1.0")
|
implementation("com.github.gabrielemariotti.changeloglib:changelog:2.1.0")
|
||||||
|
|
||||||
|
@ -32,9 +32,6 @@ import com.elvishew.xlog.printer.Printer
|
|||||||
import com.elvishew.xlog.printer.file.backup.NeverBackupStrategy
|
import com.elvishew.xlog.printer.file.backup.NeverBackupStrategy
|
||||||
import com.elvishew.xlog.printer.file.clean.FileLastModifiedCleanStrategy
|
import com.elvishew.xlog.printer.file.clean.FileLastModifiedCleanStrategy
|
||||||
import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator
|
import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator
|
||||||
import com.google.android.gms.common.GooglePlayServicesNotAvailableException
|
|
||||||
import com.google.android.gms.common.GooglePlayServicesRepairableException
|
|
||||||
import com.google.android.gms.security.ProviderInstaller
|
|
||||||
import com.google.firebase.analytics.ktx.analytics
|
import com.google.firebase.analytics.ktx.analytics
|
||||||
import com.google.firebase.ktx.Firebase
|
import com.google.firebase.ktx.Firebase
|
||||||
import com.ms_square.debugoverlay.DebugOverlay
|
import com.ms_square.debugoverlay.DebugOverlay
|
||||||
@ -66,11 +63,9 @@ import uy.kohesive.injekt.Injekt
|
|||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
import uy.kohesive.injekt.injectLazy
|
import uy.kohesive.injekt.injectLazy
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.security.NoSuchAlgorithmException
|
|
||||||
import java.security.Security
|
import java.security.Security
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import javax.net.ssl.SSLContext
|
|
||||||
|
|
||||||
open class App : Application(), LifecycleObserver, ImageLoaderFactory {
|
open class App : Application(), LifecycleObserver, ImageLoaderFactory {
|
||||||
|
|
||||||
@ -85,8 +80,6 @@ open class App : Application(), LifecycleObserver, ImageLoaderFactory {
|
|||||||
Timber.plant(XLogTree()) // SY Redirect Timber to XLog
|
Timber.plant(XLogTree()) // SY Redirect Timber to XLog
|
||||||
if (!BuildConfig.DEBUG) addAnalytics()
|
if (!BuildConfig.DEBUG) addAnalytics()
|
||||||
|
|
||||||
workaroundAndroid7BrokenSSL()
|
|
||||||
|
|
||||||
// TLS 1.3 support for Android < 10
|
// TLS 1.3 support for Android < 10
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
|
||||||
Security.insertProviderAt(Conscrypt.newProvider(), 1)
|
Security.insertProviderAt(Conscrypt.newProvider(), 1)
|
||||||
@ -166,26 +159,6 @@ open class App : Application(), LifecycleObserver, ImageLoaderFactory {
|
|||||||
}.build()
|
}.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun workaroundAndroid7BrokenSSL() {
|
|
||||||
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.N ||
|
|
||||||
Build.VERSION.SDK_INT == Build.VERSION_CODES.N_MR1
|
|
||||||
) {
|
|
||||||
try {
|
|
||||||
SSLContext.getInstance("TLSv1.2")
|
|
||||||
} catch (e: NoSuchAlgorithmException) {
|
|
||||||
xLogE("Could not install Android 7 broken SSL workaround!", e)
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
ProviderInstaller.installIfNeeded(applicationContext)
|
|
||||||
} catch (e: GooglePlayServicesRepairableException) {
|
|
||||||
xLogE("Could not install Android 7 broken SSL workaround!", e)
|
|
||||||
} catch (e: GooglePlayServicesNotAvailableException) {
|
|
||||||
xLogE("Could not install Android 7 broken SSL workaround!", e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun addAnalytics() {
|
private fun addAnalytics() {
|
||||||
if (syDebugVersion != "0") {
|
if (syDebugVersion != "0") {
|
||||||
Firebase.analytics.setUserProperty("preview_version", syDebugVersion)
|
Firebase.analytics.setUserProperty("preview_version", syDebugVersion)
|
||||||
@ -259,15 +232,17 @@ open class App : Application(), LifecycleObserver, ImageLoaderFactory {
|
|||||||
|
|
||||||
xLogD("Application booting...")
|
xLogD("Application booting...")
|
||||||
xLogD(
|
xLogD(
|
||||||
"App version: ${BuildConfig.VERSION_NAME} (${BuildConfig.FLAVOR}, ${BuildConfig.COMMIT_SHA}, ${BuildConfig.VERSION_CODE})\n" +
|
"""
|
||||||
"Preview build: $syDebugVersion\n" +
|
App version: ${BuildConfig.VERSION_NAME} (${BuildConfig.FLAVOR}, ${BuildConfig.COMMIT_SHA}, ${BuildConfig.VERSION_CODE})
|
||||||
"Android version: ${Build.VERSION.RELEASE} (SDK ${Build.VERSION.SDK_INT}) \n" +
|
Preview build: $syDebugVersion
|
||||||
"Android build ID: ${Build.DISPLAY}\n" +
|
Android version: ${Build.VERSION.RELEASE} (SDK ${Build.VERSION.SDK_INT})
|
||||||
"Device brand: ${Build.BRAND}\n" +
|
Android build ID: ${Build.DISPLAY}
|
||||||
"Device manufacturer: ${Build.MANUFACTURER}\n" +
|
Device brand: ${Build.BRAND}
|
||||||
"Device name: ${Build.DEVICE}\n" +
|
Device manufacturer: ${Build.MANUFACTURER}
|
||||||
"Device model: ${Build.MODEL}\n" +
|
Device name: ${Build.DEVICE}
|
||||||
"Device product name: ${Build.PRODUCT}"
|
Device model: ${Build.MODEL}
|
||||||
|
Device product name: ${Build.PRODUCT}
|
||||||
|
""".trimIndent()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user