File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
src/main/kotlin/com/simplemobiletools/filemanager Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,14 @@ android {
1919 }
2020
2121 buildTypes {
22+ debug {
23+ buildConfigField " boolean" , " USE_LEAK_CANARY" , " true"
24+ }
2225 release {
2326 minifyEnabled true
2427 proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
2528 signingConfig signingConfigs. release
29+ buildConfigField " boolean" , " USE_LEAK_CANARY" , " false"
2630 }
2731 }
2832
@@ -36,12 +40,19 @@ android {
3640 }
3741}
3842
43+ ext {
44+ leakCanaryVersion = ' 1.5.4'
45+ }
46+
3947dependencies {
4048 compile ' com.simplemobiletools:commons:2.38.2'
4149 compile ' com.bignerdranch.android:recyclerview-multiselect:0.2'
4250 compile " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
4351
4452 compile files(' ../libs/RootTools.jar' )
53+
54+ debugCompile " com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion "
55+ releaseCompile " com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion "
4556}
4657
4758buildscript {
Original file line number Diff line number Diff line change @@ -2,12 +2,20 @@ package com.simplemobiletools.filemanager
22
33import android.app.Application
44import com.github.ajalt.reprint.core.Reprint
5+ import com.simplemobiletools.filemanager.BuildConfig.USE_LEAK_CANARY
56import com.simplemobiletools.filemanager.extensions.config
7+ import com.squareup.leakcanary.LeakCanary
68import java.util.*
79
810class App : Application () {
911 override fun onCreate () {
1012 super .onCreate()
13+ if (USE_LEAK_CANARY ) {
14+ if (LeakCanary .isInAnalyzerProcess(this )) {
15+ return
16+ }
17+ LeakCanary .install(this )
18+ }
1119
1220 if (config.useEnglish) {
1321 val conf = resources.configuration
You can’t perform that action at this time.
0 commit comments