simplify Leak Canary initialization
This commit is contained in:
parent
76e94d2bab
commit
a56bbbd54a
|
@ -21,14 +21,10 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
debug {
|
|
||||||
buildConfigField "boolean", "USE_LEAK_CANARY", "true"
|
|
||||||
}
|
|
||||||
release {
|
release {
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
buildConfigField "boolean", "USE_LEAK_CANARY", "false"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +43,7 @@ ext {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.simplemobiletools:commons:3.0.20'
|
implementation 'com.simplemobiletools:commons:3.0.21'
|
||||||
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.8.0'
|
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.8.0'
|
||||||
implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.0'
|
implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.0'
|
||||||
implementation 'com.android.support:multidex:1.0.2'
|
implementation 'com.android.support:multidex:1.0.2'
|
||||||
|
|
|
@ -3,13 +3,12 @@ package com.simplemobiletools.gallery
|
||||||
import android.support.multidex.MultiDexApplication
|
import android.support.multidex.MultiDexApplication
|
||||||
import com.github.ajalt.reprint.core.Reprint
|
import com.github.ajalt.reprint.core.Reprint
|
||||||
import com.simplemobiletools.commons.extensions.checkUseEnglish
|
import com.simplemobiletools.commons.extensions.checkUseEnglish
|
||||||
import com.simplemobiletools.gallery.BuildConfig.USE_LEAK_CANARY
|
|
||||||
import com.squareup.leakcanary.LeakCanary
|
import com.squareup.leakcanary.LeakCanary
|
||||||
|
|
||||||
class App : MultiDexApplication() {
|
class App : MultiDexApplication() {
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
if (USE_LEAK_CANARY) {
|
if (BuildConfig.DEBUG) {
|
||||||
if (LeakCanary.isInAnalyzerProcess(this)) {
|
if (LeakCanary.isInAnalyzerProcess(this)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue