diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/mapping/EntryFactory.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/mapping/EntryFactory.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/cuchaz/enigma/mapping/EntryFactory.java b/src/main/java/cuchaz/enigma/mapping/EntryFactory.java index 2351dcfb..ce4b948a 100644 --- a/src/main/java/cuchaz/enigma/mapping/EntryFactory.java +++ b/src/main/java/cuchaz/enigma/mapping/EntryFactory.java | |||
| @@ -33,6 +33,10 @@ public class EntryFactory { | |||
| 33 | return new ClassEntry(classMapping.getObfFullName()); | 33 | return new ClassEntry(classMapping.getObfFullName()); |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | public static ClassEntry getDeobfClassEntry(ClassMapping classMapping) { | ||
| 37 | return new ClassEntry(classMapping.getDeobfName()); | ||
| 38 | } | ||
| 39 | |||
| 36 | public static ClassEntry getSuperclassEntry(CtClass c) { | 40 | public static ClassEntry getSuperclassEntry(CtClass c) { |
| 37 | return new ClassEntry(Descriptor.toJvmName(c.getClassFile().getSuperclass())); | 41 | return new ClassEntry(Descriptor.toJvmName(c.getClassFile().getSuperclass())); |
| 38 | } | 42 | } |
| @@ -90,6 +94,10 @@ public class EntryFactory { | |||
| 90 | return getBehaviorEntry(new ClassEntry(className), behaviorName, new Signature(behaviorSignature)); | 94 | return getBehaviorEntry(new ClassEntry(className), behaviorName, new Signature(behaviorSignature)); |
| 91 | } | 95 | } |
| 92 | 96 | ||
| 97 | public static BehaviorEntry getBehaviorEntry(String className, String behaviorName) { | ||
| 98 | return getBehaviorEntry(new ClassEntry(className), behaviorName); | ||
| 99 | } | ||
| 100 | |||
| 93 | public static BehaviorEntry getBehaviorEntry(String className) { | 101 | public static BehaviorEntry getBehaviorEntry(String className) { |
| 94 | return new ConstructorEntry(new ClassEntry(className)); | 102 | return new ConstructorEntry(new ClassEntry(className)); |
| 95 | } | 103 | } |
| @@ -105,7 +113,19 @@ public class EntryFactory { | |||
| 105 | } | 113 | } |
| 106 | } | 114 | } |
| 107 | 115 | ||
| 116 | public static BehaviorEntry getBehaviorEntry(ClassEntry classEntry, String behaviorName) { | ||
| 117 | if(behaviorName.equals("<clinit>")) { | ||
| 118 | return new ConstructorEntry(classEntry); | ||
| 119 | } else { | ||
| 120 | throw new IllegalArgumentException("Only class initializers don't have signatures"); | ||
| 121 | } | ||
| 122 | } | ||
| 123 | |||
| 108 | public static BehaviorEntry getObfBehaviorEntry(ClassEntry classEntry, MethodMapping methodMapping) { | 124 | public static BehaviorEntry getObfBehaviorEntry(ClassEntry classEntry, MethodMapping methodMapping) { |
| 109 | return getBehaviorEntry(classEntry, methodMapping.getObfName(), methodMapping.getObfSignature()); | 125 | return getBehaviorEntry(classEntry, methodMapping.getObfName(), methodMapping.getObfSignature()); |
| 110 | } | 126 | } |
| 127 | |||
| 128 | public static BehaviorEntry getObfBehaviorEntry(ClassMapping classMapping, MethodMapping methodMapping) { | ||
| 129 | return getObfBehaviorEntry(getObfClassEntry(classMapping), methodMapping); | ||
| 130 | } | ||
| 111 | } | 131 | } |