// Path: app/src/main/java/org/polaric/cluttr/io/ExtSdHelper.java
// public class ExtSdHelper {
//     public static final String PATH_KEY="extsdpath";
//     private static File sd;
//     public static final int SAF_REQUEST=93;
// 
//     private static String sdPath=null;
// 
//     public static void init() {
//         sdPath = PreferenceManager.getDefaultSharedPreferences(Cluttr.getApplication()).getString(PATH_KEY, null);
//         if (sdPath!=null) {
//             sd = new File(FileUtil.getFullPathFromTreeUri(getSdUri()));
//         }
//     }
// 
//     public static void clear() {
//         PreferenceManager.getDefaultSharedPreferences(Cluttr.getApplication()).edit().putString(PATH_KEY, null).apply();
//         sdPath=null;
//         sd=null;
//         //TODO: CLEAR CACHE
//     }
// 
//     public static boolean hasExtSd() {
//         return sdPath!=null;
//     }
// 
//     public static void setSdPath(String path) {
//         sdPath=path;
//         PreferenceManager.getDefaultSharedPreferences(Cluttr.getApplication()).edit().putString(PATH_KEY, path).apply();
//         sd = new File(FileUtil.getFullPathFromTreeUri(getSdUri()));
//         Log.d(Util.LOG_TAG, "SAF External SD Directory set to " + path);
//         //TODO: CLEAR CACHE
//     }
// 
//     public static String getSdPath() {
//         return sdPath;
//     }
// 
//     public static Uri getSdUri() {
//         return Uri.parse(getSdPath());
//     }
// 
//     public static File getRootFile() {
//         return sd;
//     }
// }


import android.app.Application;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.preference.PreferenceManager;
import android.util.Log;
import org.polaric.cluttr.io.ExtSdHelper;
import org.polaric.colorful.Colorful;
import io.realm.Realm;
import io.realm.RealmConfiguration;
package org.polaric.cluttr;




public class Cluttr extends Application {
    private static Cluttr cluttr;
    private SharedPreferences prefs;
    private boolean newRelease=false;
    private Thread.UncaughtExceptionHandler defaultUEH;

    public Cluttr() {
        defaultUEH = Thread.getDefaultUncaughtExceptionHandler();
        Thread.setDefaultUncaughtExceptionHandler (new Thread.UncaughtExceptionHandler() {
            @Override
            public void uncaughtException (Thread thread, Throwable e) {
                handleUncaughtException (thread, e);
            }
        });
    }

    @Override
    public void onCreate() {
        super.onCreate();
        cluttr=this;
        Colorful.defaults().translucent(true);
        Colorful.init(this);
// Path: app/src/main/java/org/polaric/cluttr/io/ExtSdHelper.java
// public class ExtSdHelper {
//     public static final String PATH_KEY="extsdpath";
//     private static File sd;
//     public static final int SAF_REQUEST=93;
// 
//     private static String sdPath=null;
// 
//     public static void init() {
//         sdPath = PreferenceManager.getDefaultSharedPreferences(Cluttr.getApplication()).getString(PATH_KEY, null);
//         if (sdPath!=null) {
//             sd = new File(FileUtil.getFullPathFromTreeUri(getSdUri()));
//         }
//     }
// 
//     public static void clear() {
//         PreferenceManager.getDefaultSharedPreferences(Cluttr.getApplication()).edit().putString(PATH_KEY, null).apply();
//         sdPath=null;
//         sd=null;
//         //TODO: CLEAR CACHE
//     }
// 
//     public static boolean hasExtSd() {
//         return sdPath!=null;
//     }
// 
//     public static void setSdPath(String path) {
//         sdPath=path;
//         PreferenceManager.getDefaultSharedPreferences(Cluttr.getApplication()).edit().putString(PATH_KEY, path).apply();
//         sd = new File(FileUtil.getFullPathFromTreeUri(getSdUri()));
//         Log.d(Util.LOG_TAG, "SAF External SD Directory set to " + path);
//         //TODO: CLEAR CACHE
//     }
// 
//     public static String getSdPath() {
//         return sdPath;
//     }
// 
//     public static Uri getSdUri() {
//         return Uri.parse(getSdPath());
//     }
// 
//     public static File getRootFile() {
//         return sd;
//     }
// }


// Path: app/src/main/java/org/polaric/cluttr/Cluttr.java
import android.app.Application;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.preference.PreferenceManager;
import android.util.Log;
import org.polaric.cluttr.io.ExtSdHelper;
import org.polaric.colorful.Colorful;
import io.realm.Realm;
import io.realm.RealmConfiguration;

package org.polaric.cluttr;




public class Cluttr extends Application {
    private static Cluttr cluttr;
    private SharedPreferences prefs;
    private boolean newRelease=false;
    private Thread.UncaughtExceptionHandler defaultUEH;

    public Cluttr() {
        defaultUEH = Thread.getDefaultUncaughtExceptionHandler();
        Thread.setDefaultUncaughtExceptionHandler (new Thread.UncaughtExceptionHandler() {
            @Override
            public void uncaughtException (Thread thread, Throwable e) {
                handleUncaughtException (thread, e);
            }
        });
    }

    @Override
    public void onCreate() {
        super.onCreate();
        cluttr=this;
        Colorful.defaults().translucent(true);
        Colorful.init(this);
        ExtSdHelper.init();