package cat.xojan.random1;

import com.crashlytics.android.Crashlytics;
import com.crashlytics.android.answers.Answers;
import com.squareup.leakcanary.LeakCanary;

import cat.xojan.random1.injection.component.AppComponent;
import cat.xojan.random1.injection.component.DaggerAppComponent;
import cat.xojan.random1.injection.module.AppModule;
import io.fabric.sdk.android.Fabric;

public class Application extends android.app.Application {

    private AppComponent mComponent;

    @Override
    public void onCreate() {
        super.onCreate();
        Fabric.with(this, new Answers(), new Crashlytics());
        initInjector();
        initLeakDetection();
    }

    public AppComponent getAppComponent() {
        return mComponent;
    }

    private void initInjector() {
        mComponent = DaggerAppComponent.builder()
                .appModule(new AppModule(this))
                .build();
    }

    private void initLeakDetection() {
        if (BuildConfig.DEBUG) {
            LeakCanary.install(this);
        }
    }
}

@@ -551,45 +551,12 @@
     
-Fabric.with(this, new Answers(), new 
+init
 Cras
@@ -564,17 +564,16 @@
 lytics()
-)
 ;%0A      
@@ -994,11 +994,164 @@
  %7D%0A    %7D
+%0A%0A    private void initCrashlytics() %7B%0A        if (!BuildConfig.DEBUG) %7B%0A            Fabric.with(this, new Answers(), new Crashlytics());%0A        %7D%0A    %7D
 %0A%7D%0A

enable Crashlytics only for non debug builds