package edu.rpi.cs.yacs.core;

import android.app.Application;

import com.squareup.leakcanary.LeakCanary;

import edu.rpi.cs.yacs.retrofit.ServiceHelper;
import io.realm.Realm;
import io.realm.RealmConfiguration;

/**
 * Created by Mark Robinson on 10/4/16.
 */
public class YACSApplication extends Application {
    private static YACSApplication instance;

    private ServiceHelper serviceHelper = null;
    private Realm realm = null;

    public static YACSApplication getInstance() {
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;

        if (LeakCanary.isInAnalyzerProcess(this)) {
            // This process is dedicated to LeakCanary for heap analysis.
            return;
        }

        LeakCanary.install(this);

        serviceHelper = new ServiceHelper(getApplicationContext());

        RealmConfiguration realmConfiguration = new RealmConfiguration.Builder(this).build();
        Realm.setDefaultConfiguration(realmConfiguration);

        realm = Realm.getDefaultInstance();
    }

    public ServiceHelper getServiceHelper() {
        return serviceHelper;
    }

    public Realm getRealm() {
        return realm;
    }
}
@@ -57,16 +57,60 @@
 ation;%0A%0A
+import com.crashlytics.android.Crashlytics;%0A
 import c
@@ -192,16 +192,53 @@
 Helper;%0A
+import io.fabric.sdk.android.Fabric;%0A
 import i
@@ -669,33 +669,8 @@
 e();
-%0A        instance = this;
 %0A%0A  
@@ -820,24 +820,97 @@
 %0A        %7D%0A%0A
+        Fabric.with(this, new Crashlytics());%0A%0A        instance = this;%0A%0A
         Leak

Modify YACSApplication, Fabric SDK