mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-01-23 15:20:00 +01:00
adding LeakCanary
This commit is contained in:
parent
a9bb73fcaa
commit
27da8b4841
@ -19,10 +19,14 @@ 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,12 +40,19 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ext {
|
||||||
|
leakCanaryVersion = '1.5.4'
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.simplemobiletools:commons:2.38.2'
|
compile 'com.simplemobiletools:commons:2.38.2'
|
||||||
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
|
|
||||||
compile files('../libs/RootTools.jar')
|
compile files('../libs/RootTools.jar')
|
||||||
|
|
||||||
|
debugCompile "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
|
||||||
|
releaseCompile "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
|
@ -2,12 +2,20 @@ package com.simplemobiletools.filemanager
|
|||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import com.github.ajalt.reprint.core.Reprint
|
import com.github.ajalt.reprint.core.Reprint
|
||||||
|
import com.simplemobiletools.filemanager.BuildConfig.USE_LEAK_CANARY
|
||||||
import com.simplemobiletools.filemanager.extensions.config
|
import com.simplemobiletools.filemanager.extensions.config
|
||||||
|
import com.squareup.leakcanary.LeakCanary
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class App : Application() {
|
class App : Application() {
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
|
if (USE_LEAK_CANARY) {
|
||||||
|
if (LeakCanary.isInAnalyzerProcess(this)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
LeakCanary.install(this)
|
||||||
|
}
|
||||||
|
|
||||||
if (config.useEnglish) {
|
if (config.useEnglish) {
|
||||||
val conf = resources.configuration
|
val conf = resources.configuration
|
||||||
|
Loading…
Reference in New Issue
Block a user