diff options
| author | 2016-07-02 22:05:28 +1000 | |
|---|---|---|
| committer | 2016-07-02 22:05:28 +1000 | |
| commit | 4dbf0ef6561e8b5d591281ae82ee9a94766e99a7 (patch) | |
| tree | 7203313d3d350f04e8d0469ca98e76db036ef123 | |
| parent | Removed unused methods (diff) | |
| download | enigma-4dbf0ef6561e8b5d591281ae82ee9a94766e99a7.tar.gz enigma-4dbf0ef6561e8b5d591281ae82ee9a94766e99a7.tar.xz enigma-4dbf0ef6561e8b5d591281ae82ee9a94766e99a7.zip | |
Fixed build.gradle
| -rw-r--r-- | build.gradle | 2 | ||||
| -rw-r--r-- | src/main/java/cuchaz/enigma/mapping/EntryFactory.java | 25 | ||||
| -rw-r--r-- | src/main/java/cuchaz/enigma/mapping/MethodMapping.java | 17 |
3 files changed, 6 insertions, 38 deletions
diff --git a/build.gradle b/build.gradle index 6c621f69..2332c815 100644 --- a/build.gradle +++ b/build.gradle | |||
| @@ -61,7 +61,7 @@ configurations { | |||
| 61 | dependencies { | 61 | dependencies { |
| 62 | compile 'com.google.guava:guava:17.+' | 62 | compile 'com.google.guava:guava:17.+' |
| 63 | compile 'org.javassist:javassist:3.+' | 63 | compile 'org.javassist:javassist:3.+' |
| 64 | compile 'org.bitbucket.mstrobel:procyon-compilertools:0.5.32' | 64 | compile 'org.bitbucket.mstrobel:procyon-decompiler:0.5.28-enigma' |
| 65 | compile 'org.javassist:javassist:3.20.0-GA' | 65 | compile 'org.javassist:javassist:3.20.0-GA' |
| 66 | 66 | ||
| 67 | compile 'com.google.code.gson:gson:2.3.1' | 67 | compile 'com.google.code.gson:gson:2.3.1' |
diff --git a/src/main/java/cuchaz/enigma/mapping/EntryFactory.java b/src/main/java/cuchaz/enigma/mapping/EntryFactory.java index 0ac739c1..3584ebbf 100644 --- a/src/main/java/cuchaz/enigma/mapping/EntryFactory.java +++ b/src/main/java/cuchaz/enigma/mapping/EntryFactory.java | |||
| @@ -74,38 +74,23 @@ public class EntryFactory { | |||
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | public static MethodEntry getMethodEntry(MethodCall call) { | 76 | public static MethodEntry getMethodEntry(MethodCall call) { |
| 77 | return new MethodEntry( | 77 | return new MethodEntry(new ClassEntry(Descriptor.toJvmName(call.getClassName())), call.getMethodName(), new Signature(call.getSignature())); |
| 78 | new ClassEntry(Descriptor.toJvmName(call.getClassName())), | ||
| 79 | call.getMethodName(), | ||
| 80 | new Signature(call.getSignature()) | ||
| 81 | ); | ||
| 82 | } | 78 | } |
| 83 | 79 | ||
| 84 | public static ConstructorEntry getConstructorEntry(CtConstructor constructor) { | 80 | public static ConstructorEntry getConstructorEntry(CtConstructor constructor) { |
| 85 | if (constructor.isClassInitializer()) { | 81 | if (constructor.isClassInitializer()) { |
| 86 | return new ConstructorEntry( | 82 | return new ConstructorEntry(getClassEntry(constructor.getDeclaringClass())); |
| 87 | getClassEntry(constructor.getDeclaringClass()) | ||
| 88 | ); | ||
| 89 | } else { | 83 | } else { |
| 90 | return new ConstructorEntry( | 84 | return new ConstructorEntry(getClassEntry(constructor.getDeclaringClass()), new Signature(constructor.getMethodInfo().getDescriptor())); |
| 91 | getClassEntry(constructor.getDeclaringClass()), | ||
| 92 | new Signature(constructor.getMethodInfo().getDescriptor()) | ||
| 93 | ); | ||
| 94 | } | 85 | } |
| 95 | } | 86 | } |
| 96 | 87 | ||
| 97 | public static ConstructorEntry getConstructorEntry(ConstructorCall call) { | 88 | public static ConstructorEntry getConstructorEntry(ConstructorCall call) { |
| 98 | return new ConstructorEntry( | 89 | return new ConstructorEntry(new ClassEntry(Descriptor.toJvmName(call.getClassName())), new Signature(call.getSignature())); |
| 99 | new ClassEntry(Descriptor.toJvmName(call.getClassName())), | ||
| 100 | new Signature(call.getSignature()) | ||
| 101 | ); | ||
| 102 | } | 90 | } |
| 103 | 91 | ||
| 104 | public static ConstructorEntry getConstructorEntry(NewExpr call) { | 92 | public static ConstructorEntry getConstructorEntry(NewExpr call) { |
| 105 | return new ConstructorEntry( | 93 | return new ConstructorEntry(new ClassEntry(Descriptor.toJvmName(call.getClassName())), new Signature(call.getSignature())); |
| 106 | new ClassEntry(Descriptor.toJvmName(call.getClassName())), | ||
| 107 | new Signature(call.getSignature()) | ||
| 108 | ); | ||
| 109 | } | 94 | } |
| 110 | 95 | ||
| 111 | public static BehaviorEntry getBehaviorEntry(CtBehavior behavior) { | 96 | public static BehaviorEntry getBehaviorEntry(CtBehavior behavior) { |
diff --git a/src/main/java/cuchaz/enigma/mapping/MethodMapping.java b/src/main/java/cuchaz/enigma/mapping/MethodMapping.java index ff14ccd3..fbd97bd1 100644 --- a/src/main/java/cuchaz/enigma/mapping/MethodMapping.java +++ b/src/main/java/cuchaz/enigma/mapping/MethodMapping.java | |||
| @@ -151,23 +151,6 @@ public class MethodMapping implements Serializable, Comparable<MethodMapping>, M | |||
| 151 | return (this.m_obfName + this.m_obfSignature).compareTo(other.m_obfName + other.m_obfSignature); | 151 | return (this.m_obfName + this.m_obfSignature).compareTo(other.m_obfName + other.m_obfSignature); |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | public boolean renameObfClass(final String oldObfClassName, final String newObfClassName) { | ||
| 155 | |||
| 156 | // rename obf classes in the signature | ||
| 157 | Signature newSignature = new Signature(this.m_obfSignature, className -> { | ||
| 158 | if (className.equals(oldObfClassName)) { | ||
| 159 | return newObfClassName; | ||
| 160 | } | ||
| 161 | return null; | ||
| 162 | }); | ||
| 163 | |||
| 164 | if (!newSignature.equals(this.m_obfSignature)) { | ||
| 165 | this.m_obfSignature = newSignature; | ||
| 166 | return true; | ||
| 167 | } | ||
| 168 | return false; | ||
| 169 | } | ||
| 170 | |||
| 171 | public boolean containsArgument(String name) { | 154 | public boolean containsArgument(String name) { |
| 172 | for (ArgumentMapping argumentMapping : this.m_arguments.values()) { | 155 | for (ArgumentMapping argumentMapping : this.m_arguments.values()) { |
| 173 | if (argumentMapping.getName().equals(name)) { | 156 | if (argumentMapping.getName().equals(name)) { |