Manual install leak canary

pull/207/head
M66B 3 years ago
parent 0ea320d4fa
commit 11c696e3b4

@ -590,5 +590,5 @@ dependencies {
// https://github.com/square/leakcanary
// https://square.github.io/leakcanary/getting_started/
// https://mvnrepository.com/artifact/com.squareup.leakcanary/leakcanary-android
debugImplementation "com.squareup.leakcanary:leakcanary-android-startup:$canary_version"
debugImplementation "com.squareup.leakcanary:leakcanary-android:$canary_version"
}

@ -19,6 +19,7 @@ package eu.faircode.email;
Copyright 2018-2022 by Marcel Bokhorst (M66B)
*/
import android.app.Application;
import android.content.Intent;
import androidx.annotation.NonNull;
@ -37,6 +38,10 @@ import shark.ObjectInspector;
import shark.ObjectReporter;
public class CoalMine {
static void install(@NonNull Application app) {
AppWatcher.INSTANCE.manualInstall(app, 10000);
}
static void setup(boolean enabled) {
List<ObjectInspector> inspectors = new ArrayList<>(LeakCanary.getConfig().getObjectInspectors());
@ -89,6 +94,7 @@ public class CoalMine {
.objectInspectors(inspectors)
.build();
LeakCanary.setConfig(config);
LeakCanary.INSTANCE.showLeakDisplayActivityLauncherIcon(true);
}

@ -113,6 +113,8 @@ public class ApplicationEx extends Application
" process=" + android.os.Process.myPid());
Log.logMemory(this, "App");
CoalMine.install(this);
registerActivityLifecycleCallbacks(lifecycleCallbacks);
getMainLooper().setMessageLogging(new Printer() {

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="leak_canary_watcher_auto_install">false</bool>
</resources>

@ -19,11 +19,15 @@ package eu.faircode.email;
Copyright 2018-2022 by Marcel Bokhorst (M66B)
*/
import android.app.Application;
import android.content.Intent;
import androidx.annotation.NonNull;
public class CoalMine {
static void install(@NonNull Application app) {
}
static void setup(boolean enabled) {
}

Loading…
Cancel
Save