From a625c398b2fe2c9f4010cca1c006191054a2eb4a Mon Sep 17 00:00:00 2001 From: Konloch Date: Wed, 2 Oct 2024 18:45:40 -0600 Subject: [PATCH] Start of Decompilers Automatically Reformatting Syntax --- src/main/java/the/bytecode/club/bytecodeviewer/Constants.java | 3 --- src/main/java/the/bytecode/club/bytecodeviewer/Settings.java | 4 ++++ .../java/the/bytecode/club/bytecodeviewer/util/TempFile.java | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java b/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java index 46f71ce1..ad5d2603 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java @@ -94,9 +94,6 @@ public class Constants //Nothing here is meant for user level production, only development level production. public static final boolean DEV_FLAG_DECOMPILERS_SIMULATED_ERRORS = DEV_MODE && false; //enable true / false to disable - //decompilers will automatically delete their temp files, useful to turn off if you want to quickly debug a decompilers results - public static boolean DECOMPILERS_AUTOMATICALLY_CLEANUP = true; - public static final PrintStream ERR = System.err; public static final PrintStream OUT = System.out; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/Settings.java b/src/main/java/the/bytecode/club/bytecodeviewer/Settings.java index 94374584..cee5038c 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/Settings.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/Settings.java @@ -43,6 +43,10 @@ public class Settings private static List recentPlugins; private static List recentFiles; + //decompilers will automatically delete their temp files, useful to turn off if you want to quickly debug a decompilers results + public static boolean DECOMPILERS_AUTOMATICALLY_CLEANUP = true; + public static boolean DECOMPILERS_UNIFORM_SYNTAX_FORMATTING = false; //TODO + static { try diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/TempFile.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/TempFile.java index d2d78683..dc126703 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/TempFile.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/TempFile.java @@ -1,6 +1,7 @@ package the.bytecode.club.bytecodeviewer.util; import the.bytecode.club.bytecodeviewer.Constants; +import the.bytecode.club.bytecodeviewer.Settings; import java.io.File; import java.util.HashSet; @@ -63,7 +64,7 @@ public class TempFile public void cleanup() { - if(!Constants.DECOMPILERS_AUTOMATICALLY_CLEANUP) + if(!Settings.DECOMPILERS_AUTOMATICALLY_CLEANUP) return; //delete all the items