From 6c4440ac1133bfaa7871d1049d174528a289ef30 Mon Sep 17 00:00:00 2001 From: hg Date: Sun, 17 Aug 2014 10:56:17 -0400 Subject: added support for automatic reconstruction of inner and anonymous classes also added class to restore bridge method flags taken out by the obfuscator --- src/cuchaz/enigma/gui/Gui.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/cuchaz/enigma/gui/Gui.java') diff --git a/src/cuchaz/enigma/gui/Gui.java b/src/cuchaz/enigma/gui/Gui.java index 3b67a32..9ed6dd8 100644 --- a/src/cuchaz/enigma/gui/Gui.java +++ b/src/cuchaz/enigma/gui/Gui.java @@ -78,6 +78,7 @@ import cuchaz.enigma.mapping.Entry; import cuchaz.enigma.mapping.EntryPair; import cuchaz.enigma.mapping.FieldEntry; import cuchaz.enigma.mapping.IllegalNameException; +import cuchaz.enigma.mapping.MappingParseException; import cuchaz.enigma.mapping.MethodEntry; public class Gui @@ -508,6 +509,10 @@ public class Gui { throw new Error( ex ); } + catch( MappingParseException ex ) + { + JOptionPane.showMessageDialog( m_frame, ex.getMessage() ); + } } } } ); @@ -862,9 +867,17 @@ public class Gui private void startRename( ) { + // get the class name + String className = m_selectedEntryPair.deobf.getName(); + int pos = className.lastIndexOf( '$' ); + if( pos >= 0 ) + { + className = className.substring( pos + 1 ); + } + // init the text box final JTextField text = new JTextField(); - text.setText( m_selectedEntryPair.deobf.getName() ); + text.setText( className ); text.setPreferredSize( new Dimension( 360, text.getPreferredSize().height ) ); text.addKeyListener( new KeyAdapter( ) { @@ -905,6 +918,7 @@ public class Gui } catch( IllegalNameException ex ) { + ex.printStackTrace( System.err ); text.setBorder( BorderFactory.createLineBorder( Color.red, 1 ) ); } return; -- cgit v1.2.3