Seperate Configs

This commit is contained in:
topjohnwu
2017-01-25 13:16:50 +08:00
parent ad16a6fc1b
commit bcc695234c
12 changed files with 40 additions and 30 deletions
@@ -2,20 +2,20 @@ package com.topjohnwu.magisk.utils;
import android.util.Log;
import com.topjohnwu.magisk.Global;
public class Logger {
public static final String TAG = "Magisk";
public static final String DEV_TAG = "Magisk: DEV";
public static final String DEBUG_TAG = "Magisk: DEBUG";
public static boolean logShell, devLog;
public static void debug(String msg) {
Log.d(DEBUG_TAG, msg);
}
public static void dev(String msg, Object... args) {
if (devLog) {
if (Global.Configs.devLogging) {
if (args.length == 1 && args[0] instanceof Throwable) {
Log.d(DEV_TAG, msg, (Throwable) args[0]);
} else {
@@ -25,13 +25,13 @@ public class Logger {
}
public static void dev(String msg) {
if (devLog) {
if (Global.Configs.devLogging) {
Log.d(DEV_TAG, msg);
}
}
public static void shell(boolean root, String msg) {
if (logShell) {
if (Global.Configs.shellLogging) {
Log.d(root ? "SU" : "SH", msg);
}
}
@@ -12,6 +12,7 @@ import android.support.v4.app.ActivityCompat;
import android.text.TextUtils;
import android.widget.Toast;
import com.topjohnwu.magisk.Global;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.receivers.DownloadReceiver;
@@ -23,7 +24,6 @@ import java.util.List;
public class Utils {
public static boolean isDownloading = false;
public static boolean isDarkTheme;
public static boolean itemExist(String path) {
return itemExist(true, path);
@@ -125,7 +125,7 @@ public class Utils {
}
public static AlertDialog.Builder getAlertDialogBuilder(Context context) {
if (isDarkTheme) {
if (Global.Configs.isDarkTheme) {
return new AlertDialog.Builder(context, R.style.AlertDialog_dh);
} else {
return new AlertDialog.Builder(context);