From 3319ccfd41a75b5c80a4b05aa2a9f41e1739a50f Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 17 Jan 2021 11:09:29 -0500 Subject: [PATCH] Move ACRA endpoint config to build.gradle.kts --- app/build.gradle.kts | 23 ++++++++++---------- app/src/main/java/eu/kanade/tachiyomi/App.kt | 14 +++--------- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index dfca3ae3b..6089d9a36 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -20,17 +20,6 @@ if (gradle.startParameter.taskRequests.toString().contains("Standard")) { shortcutHelper.setFilePath("./shortcuts.xml") - -fun runCommand(command: String): String { - val byteOut = ByteArrayOutputStream() - project.exec { - commandLine = command.split(" ") - standardOutput = byteOut - } - return String(byteOut.toByteArray()).trim() -} - - android { compileSdkVersion(AndroidConfig.compileSdk) buildToolsVersion(AndroidConfig.buildTools) @@ -49,6 +38,9 @@ android { buildConfigField("String", "BUILD_TIME", "\"${getBuildTime()}\"") buildConfigField("boolean", "INCLUDE_UPDATER", "false") + // Please disable ACRA or use your own instance in forked versions of the project + buildConfigField("String", "ACRA_URI", "\"https://tachiyomi.kanade.eu/crash_report\"") + multiDexEnabled = true ndk { @@ -334,3 +326,12 @@ fun getBuildTime(): String { df.timeZone = TimeZone.getTimeZone("UTC") return df.format(Date()) } + +fun runCommand(command: String): String { + val byteOut = ByteArrayOutputStream() + project.exec { + commandLine = command.split(" ") + standardOutput = byteOut + } + return String(byteOut.toByteArray()).trim() +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/App.kt b/app/src/main/java/eu/kanade/tachiyomi/App.kt index eac817e07..16c4ddfd0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/App.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/App.kt @@ -28,24 +28,17 @@ import java.security.Security excludeMatchingSharedPreferencesKeys = [".*username.*", ".*password.*", ".*token.*"] ) @AcraHttpSender( - uri = "https://tachiyomi.kanade.eu/crash_report", + uri = BuildConfig.ACRA_URI, httpMethod = HttpSender.Method.PUT ) open class App : Application(), LifecycleObserver { + private val preferences: PreferencesHelper by injectLazy() + override fun onCreate() { super.onCreate() if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree()) - // Debug tool; see https://fbflipper.com/ - // SoLoader.init(this, false) - // if (BuildConfig.DEBUG && FlipperUtils.shouldEnableFlipper(this)) { - // val client = AndroidFlipperClient.getInstance(this) - // client.addPlugin(InspectorFlipperPlugin(this, DescriptorMapping.withDefaults())) - // client.addPlugin(DatabasesFlipperPlugin(this)) - // client.start() - // } - // TLS 1.3 support for Android < 10 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { Security.insertProviderAt(Conscrypt.newProvider(), 1) @@ -74,7 +67,6 @@ open class App : Application(), LifecycleObserver { @OnLifecycleEvent(Lifecycle.Event.ON_STOP) @Suppress("unused") fun onAppBackgrounded() { - val preferences: PreferencesHelper by injectLazy() if (preferences.lockAppAfter().get() >= 0) { SecureActivityDelegate.locked = true }