diff --git a/app/build.gradle b/app/build.gradle index 9e9ca81a2..9fe78e00f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,10 +19,14 @@ android { } buildTypes { + debug { + buildConfigField "boolean", "USE_LEAK_CANARY", "true" + } release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release + buildConfigField "boolean", "USE_LEAK_CANARY", "false" } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt index 48ef23b19..6141c6c76 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt @@ -2,18 +2,19 @@ package com.simplemobiletools.gallery import android.app.Application import com.github.ajalt.reprint.core.Reprint +import com.simplemobiletools.gallery.BuildConfig.USE_LEAK_CANARY import com.squareup.leakcanary.LeakCanary class App : Application() { - val USE_LEAK_CANARY = false override fun onCreate() { super.onCreate() - Reprint.initialize(this) if (USE_LEAK_CANARY) { if (LeakCanary.isInAnalyzerProcess(this)) { return } LeakCanary.install(this) } + + Reprint.initialize(this) } }