diff options
| author | 2014-08-06 00:22:25 -0400 | |
|---|---|---|
| committer | 2014-08-06 00:22:25 -0400 | |
| commit | d71c0af8ed298bfb4b35b4e3e61b5678bc1c7d9f (patch) | |
| tree | 103fea72601d989d1a1bb503c6bcfe662c6dc541 /src/cuchaz/enigma/gui/GuiController.java | |
| parent | started on inheritance viewer (diff) | |
| download | enigma-fork-d71c0af8ed298bfb4b35b4e3e61b5678bc1c7d9f.tar.gz enigma-fork-d71c0af8ed298bfb4b35b4e3e61b5678bc1c7d9f.tar.xz enigma-fork-d71c0af8ed298bfb4b35b4e3e61b5678bc1c7d9f.zip | |
added simple class inheritance browsing
Diffstat (limited to '')
| -rw-r--r-- | src/cuchaz/enigma/gui/GuiController.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cuchaz/enigma/gui/GuiController.java b/src/cuchaz/enigma/gui/GuiController.java index e1ba49a..452632f 100644 --- a/src/cuchaz/enigma/gui/GuiController.java +++ b/src/cuchaz/enigma/gui/GuiController.java | |||
| @@ -26,6 +26,7 @@ import cuchaz.enigma.ClassFile; | |||
| 26 | import cuchaz.enigma.Deobfuscator; | 26 | import cuchaz.enigma.Deobfuscator; |
| 27 | import cuchaz.enigma.analysis.Analyzer; | 27 | import cuchaz.enigma.analysis.Analyzer; |
| 28 | import cuchaz.enigma.analysis.SourceIndex; | 28 | import cuchaz.enigma.analysis.SourceIndex; |
| 29 | import cuchaz.enigma.mapping.ClassEntry; | ||
| 29 | import cuchaz.enigma.mapping.Entry; | 30 | import cuchaz.enigma.mapping.Entry; |
| 30 | import cuchaz.enigma.mapping.EntryPair; | 31 | import cuchaz.enigma.mapping.EntryPair; |
| 31 | import cuchaz.enigma.mapping.MappingsReader; | 32 | import cuchaz.enigma.mapping.MappingsReader; |
| @@ -129,6 +130,27 @@ public class GuiController | |||
| 129 | return m_deobfuscator.hasMapping( pair.obf ); | 130 | return m_deobfuscator.hasMapping( pair.obf ); |
| 130 | } | 131 | } |
| 131 | 132 | ||
| 133 | public ClassInheritanceTreeNode getClassInheritance( ClassEntry classEntry ) | ||
| 134 | { | ||
| 135 | // create a node for this class | ||
| 136 | ClassInheritanceTreeNode thisNode = new ClassInheritanceTreeNode( classEntry.getName() ); | ||
| 137 | |||
| 138 | // expand all children recursively | ||
| 139 | thisNode.load( m_deobfuscator.getAncestries(), true ); | ||
| 140 | |||
| 141 | // get the ancestors too | ||
| 142 | ClassInheritanceTreeNode node = thisNode; | ||
| 143 | for( String superclassName : m_deobfuscator.getAncestries().getAncestry( classEntry.getName() ) ) | ||
| 144 | { | ||
| 145 | // add the parent node | ||
| 146 | ClassInheritanceTreeNode parentNode = new ClassInheritanceTreeNode( superclassName ); | ||
| 147 | parentNode.add( node ); | ||
| 148 | node = parentNode; | ||
| 149 | } | ||
| 150 | |||
| 151 | return thisNode; | ||
| 152 | } | ||
| 153 | |||
| 132 | public void rename( Entry obfsEntry, String newName, int lineNum ) | 154 | public void rename( Entry obfsEntry, String newName, int lineNum ) |
| 133 | { | 155 | { |
| 134 | m_deobfuscator.rename( obfsEntry, newName ); | 156 | m_deobfuscator.rename( obfsEntry, newName ); |