Add -ren option to Fernflower decompiler

This commit is contained in:
Ruin0x11 2020-07-17 13:25:37 -07:00
parent 2f65241269
commit 1f0f5fc65c
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.forcePureAsciiAsText.isSelected()), false);
DiskWriter.writeNewLine(BytecodeViewer.settingsName, String.valueOf(BytecodeViewer.viewer.synchronizedViewing.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.showClassMethods.isSelected()), false);
DiskWriter.writeNewLine(BytecodeViewer.settingsName, String.valueOf(BytecodeViewer.viewer.ren.isSelected()), false);
} catch (Exception e) { } catch (Exception e) {
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(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.forcePureAsciiAsText.setSelected(Boolean.parseBoolean(DiskReader.loadString(BytecodeViewer.settingsName, 122, false)));
BytecodeViewer.viewer.synchronizedViewing.setSelected(Boolean.parseBoolean(DiskReader.loadString(BytecodeViewer.settingsName, 123, 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.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) { } catch (Exception e) {
//ignore because errors are expected, first start up and outdated settings. //ignore because errors are expected, first start up and outdated settings.
//e.printStackTrace(); //e.printStackTrace();

View file

@ -161,7 +161,8 @@ public class FernFlowerDecompiler extends Decompiler {
"-udv=" + r(BytecodeViewer.viewer.udv.isSelected()), "-udv=" + r(BytecodeViewer.viewer.udv.isSelected()),
"-rer=" + r(BytecodeViewer.viewer.rer.isSelected()), "-rer=" + r(BytecodeViewer.viewer.rer.isSelected()),
"-fdi=" + r(BytecodeViewer.viewer.fdi.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}; 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 rer = new JCheckBoxMenuItem("Remove empty exception ranges");
public JCheckBoxMenuItem fdi = new JCheckBoxMenuItem("Deinline finally structures"); public JCheckBoxMenuItem fdi = new JCheckBoxMenuItem("Deinline finally structures");
public JCheckBoxMenuItem asc = new JCheckBoxMenuItem("Allow only ASCII characters in strings"); 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 final JMenuItem mntmNewWorkspace = new JMenuItem("New Workspace");
public JMenu mnRecentFiles = new JMenu("Recent Files"); public JMenu mnRecentFiles = new JMenu("Recent Files");
public final JMenuItem mntmNewMenuItem = new JMenuItem("Decompile & Save All Classes.."); public final JMenuItem mntmNewMenuItem = new JMenuItem("Decompile & Save All Classes..");
@ -2250,6 +2251,7 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier
udv.setSelected(true); udv.setSelected(true);
fdi.setSelected(true); fdi.setSelected(true);
asc.setSelected(false); asc.setSelected(false);
ren.setSelected(false);
JMenu mnDecompilerSettings = new JMenu("FernFlower"); JMenu mnDecompilerSettings = new JMenu("FernFlower");
mnSettings.add(mnDecompilerSettings); mnSettings.add(mnDecompilerSettings);
@ -2279,6 +2281,7 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier
mnDecompilerSettings.add(udv); mnDecompilerSettings.add(udv);
mnDecompilerSettings.add(fdi); mnDecompilerSettings.add(fdi);
mnDecompilerSettings.add(asc); mnDecompilerSettings.add(asc);
mnDecompilerSettings.add(ren);
debugHelpers.setSelected(true); debugHelpers.setSelected(true);
// other // other
chckbxmntmAppendBrackets.setSelected(true); chckbxmntmAppendBrackets.setSelected(true);