summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/gui/GuiController.java
diff options
context:
space:
mode:
authorGravatar gegy10002019-05-10 22:21:11 +0200
committerGravatar gegy10002019-05-10 22:21:11 +0200
commit75f383a1956eb19fc838ea647a7e7b24552324cf (patch)
treed0aa11a90110b60404f40a5f7f39704598491585 /src/main/java/cuchaz/enigma/gui/GuiController.java
parentUse our procyon to fix compiler issues (#128) (diff)
downloadenigma-fork-75f383a1956eb19fc838ea647a7e7b24552324cf.tar.gz
enigma-fork-75f383a1956eb19fc838ea647a7e7b24552324cf.tar.xz
enigma-fork-75f383a1956eb19fc838ea647a7e7b24552324cf.zip
Don't remap specialized methods to their bridge partner in bytecode
Diffstat (limited to 'src/main/java/cuchaz/enigma/gui/GuiController.java')
-rw-r--r--src/main/java/cuchaz/enigma/gui/GuiController.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/cuchaz/enigma/gui/GuiController.java b/src/main/java/cuchaz/enigma/gui/GuiController.java
index e6ecc54..4155062 100644
--- a/src/main/java/cuchaz/enigma/gui/GuiController.java
+++ b/src/main/java/cuchaz/enigma/gui/GuiController.java
@@ -50,8 +50,8 @@ import java.util.stream.Collectors;
50public class GuiController { 50public class GuiController {
51 private static final ExecutorService DECOMPILER_SERVICE = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setDaemon(true).setNameFormat("decompiler-thread").build()); 51 private static final ExecutorService DECOMPILER_SERVICE = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setDaemon(true).setNameFormat("decompiler-thread").build());
52 52
53 private final Gui gui;
53 private Deobfuscator deobfuscator; 54 private Deobfuscator deobfuscator;
54 private Gui gui;
55 private DecompiledClassSource currentSource; 55 private DecompiledClassSource currentSource;
56 private Deque<EntryReference<Entry<?>, Entry<?>>> referenceStack; 56 private Deque<EntryReference<Entry<?>, Entry<?>>> referenceStack;
57 57
@@ -60,12 +60,13 @@ public class GuiController {
60 60
61 public GuiController(Gui gui) { 61 public GuiController(Gui gui) {
62 this.gui = gui; 62 this.gui = gui;
63 this.deobfuscator = null;
64 this.currentSource = null;
65 this.referenceStack = Queues.newArrayDeque(); 63 this.referenceStack = Queues.newArrayDeque();
66 } 64 }
67 65
68 public boolean isDirty() { 66 public boolean isDirty() {
67 if (deobfuscator == null) {
68 return false;
69 }
69 return deobfuscator.getMapper().isDirty(); 70 return deobfuscator.getMapper().isDirty();
70 } 71 }
71 72
@@ -82,6 +83,7 @@ public class GuiController {
82 } 83 }
83 84
84 public void openMappings(MappingFormat format, Path path) { 85 public void openMappings(MappingFormat format, Path path) {
86 if (deobfuscator == null) return;
85 ProgressDialog.runInThread(this.gui.getFrame(), progress -> { 87 ProgressDialog.runInThread(this.gui.getFrame(), progress -> {
86 try { 88 try {
87 EntryTree<EntryMapping> mappings = format.read(path, progress); 89 EntryTree<EntryMapping> mappings = format.read(path, progress);
@@ -104,6 +106,7 @@ public class GuiController {
104 } 106 }
105 107
106 public void saveMappings(MappingFormat format, Path path) { 108 public void saveMappings(MappingFormat format, Path path) {
109 if (deobfuscator == null) return;
107 EntryRemapper mapper = deobfuscator.getMapper(); 110 EntryRemapper mapper = deobfuscator.getMapper();
108 111
109 MappingDelta<EntryMapping> delta = mapper.takeMappingDelta(); 112 MappingDelta<EntryMapping> delta = mapper.takeMappingDelta();
@@ -122,6 +125,7 @@ public class GuiController {
122 } 125 }
123 126
124 public void closeMappings() { 127 public void closeMappings() {
128 if (deobfuscator == null) return;
125 this.deobfuscator.setMappings(null); 129 this.deobfuscator.setMappings(null);
126 this.gui.setMappingsFile(null); 130 this.gui.setMappingsFile(null);
127 refreshClasses(); 131 refreshClasses();
@@ -129,10 +133,12 @@ public class GuiController {
129 } 133 }
130 134
131 public void exportSource(final File dirOut) { 135 public void exportSource(final File dirOut) {
136 if (deobfuscator == null) return;
132 ProgressDialog.runInThread(this.gui.getFrame(), progress -> this.deobfuscator.writeSources(dirOut.toPath(), progress)); 137 ProgressDialog.runInThread(this.gui.getFrame(), progress -> this.deobfuscator.writeSources(dirOut.toPath(), progress));
133 } 138 }
134 139
135 public void exportJar(final File fileOut) { 140 public void exportJar(final File fileOut) {
141 if (deobfuscator == null) return;
136 ProgressDialog.runInThread(this.gui.getFrame(), progress -> this.deobfuscator.writeTransformedJar(fileOut, progress)); 142 ProgressDialog.runInThread(this.gui.getFrame(), progress -> this.deobfuscator.writeTransformedJar(fileOut, progress));
137 } 143 }
138 144
@@ -164,7 +170,7 @@ public class GuiController {
164 } 170 }
165 171
166 public boolean entryIsInJar(Entry<?> entry) { 172 public boolean entryIsInJar(Entry<?> entry) {
167 if (entry == null) return false; 173 if (entry == null || deobfuscator == null) return false;
168 return this.deobfuscator.isRenamable(entry); 174 return this.deobfuscator.isRenamable(entry);
169 } 175 }
170 176