Эх сурвалжийг харах

Move ACRA endpoint config to build.gradle.kts

arkon 4 жил өмнө
parent
commit
3319ccfd41

+ 12 - 11
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()
+}

+ 3 - 11
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
         }