mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2024-12-28 09:11:44 +01:00
initialize leak canary in debug build
This commit is contained in:
parent
add3760ed2
commit
54dca20bdb
@ -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 New Issue
Block a user