diff options
| author | 2014-08-17 10:56:17 -0400 | |
|---|---|---|
| committer | 2014-08-17 10:56:17 -0400 | |
| commit | 6c4440ac1133bfaa7871d1049d174528a289ef30 (patch) | |
| tree | fe1142b285c5e43dbd3afe8dd3eb0189f027c6a6 /src/cuchaz/enigma/mapping/ClassEntry.java | |
| parent | trying to get inner/anonymous classes working... I have a working heuristic i... (diff) | |
| download | enigma-fork-6c4440ac1133bfaa7871d1049d174528a289ef30.tar.gz enigma-fork-6c4440ac1133bfaa7871d1049d174528a289ef30.tar.xz enigma-fork-6c4440ac1133bfaa7871d1049d174528a289ef30.zip | |
added support for automatic reconstruction of inner and anonymous classes
also added class to restore bridge method flags taken out by the obfuscator
Diffstat (limited to '')
| -rw-r--r-- | src/cuchaz/enigma/mapping/ClassEntry.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/cuchaz/enigma/mapping/ClassEntry.java b/src/cuchaz/enigma/mapping/ClassEntry.java index 738e8e3..dad6da9 100644 --- a/src/cuchaz/enigma/mapping/ClassEntry.java +++ b/src/cuchaz/enigma/mapping/ClassEntry.java | |||
| @@ -82,4 +82,32 @@ public class ClassEntry implements Entry, Serializable | |||
| 82 | { | 82 | { |
| 83 | return m_name; | 83 | return m_name; |
| 84 | } | 84 | } |
| 85 | |||
| 86 | public boolean isInnerClass( ) | ||
| 87 | { | ||
| 88 | return m_name.lastIndexOf( '$' ) >= 0; | ||
| 89 | } | ||
| 90 | |||
| 91 | public String getOuterClassName( ) | ||
| 92 | { | ||
| 93 | if( isInnerClass() ) | ||
| 94 | { | ||
| 95 | return m_name.substring( 0, m_name.lastIndexOf( '$' ) ); | ||
| 96 | } | ||
| 97 | return m_name; | ||
| 98 | } | ||
| 99 | |||
| 100 | public String getInnerClassName( ) | ||
| 101 | { | ||
| 102 | if( !isInnerClass() ) | ||
| 103 | { | ||
| 104 | throw new Error( "This is not an inner class!" ); | ||
| 105 | } | ||
| 106 | return m_name.substring( m_name.lastIndexOf( '$' ) + 1 ); | ||
| 107 | } | ||
| 108 | |||
| 109 | public ClassEntry getOuterClassEntry( ) | ||
| 110 | { | ||
| 111 | return new ClassEntry( getOuterClassName() ); | ||
| 112 | } | ||
| 85 | } | 113 | } |