You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Final fix for flash zip
This commit is contained in:
@@ -7,9 +7,9 @@ import android.util.Log;
|
||||
|
||||
public class Logger {
|
||||
|
||||
private static final String LOG_TAG = "Magisk: DH";
|
||||
private static final String LOG_TAG = "Magisk: DEV";
|
||||
|
||||
public static void dh(String msg, Object... args) {
|
||||
public static void dev(String msg, Object... args) {
|
||||
Context context = null;
|
||||
try {
|
||||
context = getApplicationUsingReflection();
|
||||
@@ -25,6 +25,18 @@ public class Logger {
|
||||
}
|
||||
}
|
||||
|
||||
public static void dev(String msg) {
|
||||
Context context = null;
|
||||
try {
|
||||
context = getApplicationUsingReflection();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean("developer_logging", false)) {
|
||||
Log.d(LOG_TAG, msg);
|
||||
}
|
||||
}
|
||||
|
||||
private static Application getApplicationUsingReflection() throws Exception {
|
||||
return (Application) Class.forName("android.app.AppGlobals")
|
||||
.getMethod("getInitialApplication").invoke(null, (Object[]) null);
|
||||
|
||||
Reference in New Issue
Block a user