Merge pull request #279 from Ruin0x11/add-fernflower-ren-option

Add -ren option to Fernflower decompiler
This commit is contained in:
Kalen (Konloch) Kinloch 2020-07-17 16:37:34 -07:00 committed by GitHub
commit 4dd9d6df27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View file

@ -233,6 +233,7 @@ public class Settings {
DiskWriter.writeNewLine(BytecodeViewer.settingsName, String.valueOf(BytecodeViewer.viewer.forcePureAsciiAsText.isSelected()), false);
DiskWriter.writeNewLine(BytecodeViewer.settingsName, String.valueOf(BytecodeViewer.viewer.synchronizedViewing.isSelected()), false);
DiskWriter.writeNewLine(BytecodeViewer.settingsName, String.valueOf(BytecodeViewer.viewer.showClassMethods.isSelected()), false);
DiskWriter.writeNewLine(BytecodeViewer.settingsName, String.valueOf(BytecodeViewer.viewer.ren.isSelected()), false);
} catch (Exception e) {
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
}
@ -449,6 +450,7 @@ public class Settings {
BytecodeViewer.viewer.forcePureAsciiAsText.setSelected(Boolean.parseBoolean(DiskReader.loadString(BytecodeViewer.settingsName, 122, false)));
BytecodeViewer.viewer.synchronizedViewing.setSelected(Boolean.parseBoolean(DiskReader.loadString(BytecodeViewer.settingsName, 123, false)));
BytecodeViewer.viewer.showClassMethods.setSelected(Boolean.parseBoolean(DiskReader.loadString(BytecodeViewer.settingsName, 124, false)));
BytecodeViewer.viewer.ren.setSelected(Boolean.parseBoolean(DiskReader.loadString(BytecodeViewer.settingsName, 125, false)));
} catch (Exception e) {
//ignore because errors are expected, first start up and outdated settings.
//e.printStackTrace();

View file

@ -161,7 +161,8 @@ public class FernFlowerDecompiler extends Decompiler {
"-udv=" + r(BytecodeViewer.viewer.udv.isSelected()),
"-rer=" + r(BytecodeViewer.viewer.rer.isSelected()),
"-fdi=" + r(BytecodeViewer.viewer.fdi.isSelected()),
"-asc=" + r(BytecodeViewer.viewer.asc.isSelected()), className,
"-asc=" + r(BytecodeViewer.viewer.asc.isSelected()),
"-ren=" + r(BytecodeViewer.viewer.ren.isSelected()), className,
folder};
}

View file

@ -93,6 +93,7 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier
public JCheckBoxMenuItem rer = new JCheckBoxMenuItem("Remove empty exception ranges");
public JCheckBoxMenuItem fdi = new JCheckBoxMenuItem("Deinline finally structures");
public JCheckBoxMenuItem asc = new JCheckBoxMenuItem("Allow only ASCII characters in strings");
public JCheckBoxMenuItem ren = new JCheckBoxMenuItem("Rename ambiguous classes and class elements");
public final JMenuItem mntmNewWorkspace = new JMenuItem("New Workspace");
public JMenu mnRecentFiles = new JMenu("Recent Files");
public final JMenuItem mntmNewMenuItem = new JMenuItem("Decompile & Save All Classes..");
@ -2250,6 +2251,7 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier
udv.setSelected(true);
fdi.setSelected(true);
asc.setSelected(false);
ren.setSelected(false);
JMenu mnDecompilerSettings = new JMenu("FernFlower");
mnSettings.add(mnDecompilerSettings);
@ -2279,6 +2281,7 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier
mnDecompilerSettings.add(udv);
mnDecompilerSettings.add(fdi);
mnDecompilerSettings.add(asc);
mnDecompilerSettings.add(ren);
debugHelpers.setSelected(true);
// other
chckbxmntmAppendBrackets.setSelected(true);