55 lines
2.4 KiB
Java
Raw Normal View History

2017-01-25 04:27:05 +08:00
package com.topjohnwu.magisk;
2017-01-25 13:16:50 +08:00
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import com.topjohnwu.magisk.module.Module;
2017-01-25 04:27:05 +08:00
import com.topjohnwu.magisk.module.Repo;
import com.topjohnwu.magisk.utils.CallbackHandler;
import com.topjohnwu.magisk.utils.ValueSortedMap;
import java.util.List;
public class Global {
public static class Constant {
// No global constants now
}
public static class Info {
public static double magiskVersion;
public static double remoteMagiskVersion = -1;
public static String magiskVersionString = "(none)";
public static String magiskLink;
public static String releaseNoteLink;
public static int SNCheckResult = -1;
public static String bootBlock = null;
}
public static class Data {
public static ValueSortedMap<String, Repo> repoMap = new ValueSortedMap<>();
2017-01-25 13:16:50 +08:00
public static ValueSortedMap<String, Module> moduleMap = new ValueSortedMap<>();
2017-01-25 04:27:05 +08:00
public static List<String> blockList;
}
public static class Events {
public static final CallbackHandler.Event blockDetectionDone = new CallbackHandler.Event();
public static final CallbackHandler.Event packageLoadDone = new CallbackHandler.Event();
public static final CallbackHandler.Event reloadMainActivity = new CallbackHandler.Event();
public static final CallbackHandler.Event moduleLoadDone = new CallbackHandler.Event();
public static final CallbackHandler.Event repoLoadDone = new CallbackHandler.Event();
public static final CallbackHandler.Event updateCheckDone = new CallbackHandler.Event();
public static final CallbackHandler.Event safetyNetDone = new CallbackHandler.Event();
}
2017-01-25 13:16:50 +08:00
public static class Configs {
public static boolean isDarkTheme;
public static boolean shellLogging;
public static boolean devLogging;
public static void init(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
isDarkTheme = prefs.getString("theme", context.getString(R.string.theme_default_value)).equalsIgnoreCase(context.getString(R.string.theme_dark_value));
devLogging = prefs.getBoolean("developer_logging", false);
shellLogging = prefs.getBoolean("shell_logging", false);
}
}
2017-01-25 04:27:05 +08:00
}