mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
initialize leak canary in debug build
This commit is contained in:
parent
add3760ed2
commit
54dca20bdb
2 changed files with 7 additions and 2 deletions
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue