diff options
| author | 2015-03-16 19:22:22 -0400 | |
|---|---|---|
| committer | 2015-03-16 19:22:22 -0400 | |
| commit | 5e3743a0aca3529eacf9be400c8b8d7547f66e7f (patch) | |
| tree | ea601747547f78e1b83ab828650932126440e221 /src/cuchaz/enigma/mapping/EntryFactory.java | |
| parent | update to new javassist version to (hopefully) get bug fixes (diff) | |
| download | enigma-fork-5e3743a0aca3529eacf9be400c8b8d7547f66e7f.tar.gz enigma-fork-5e3743a0aca3529eacf9be400c8b8d7547f66e7f.tar.xz enigma-fork-5e3743a0aca3529eacf9be400c8b8d7547f66e7f.zip | |
started adding minimal support for generics
fixed mark-as-deobfuscated issue
Diffstat (limited to 'src/cuchaz/enigma/mapping/EntryFactory.java')
| -rw-r--r-- | src/cuchaz/enigma/mapping/EntryFactory.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/cuchaz/enigma/mapping/EntryFactory.java b/src/cuchaz/enigma/mapping/EntryFactory.java index 7bc6183..4898e6d 100644 --- a/src/cuchaz/enigma/mapping/EntryFactory.java +++ b/src/cuchaz/enigma/mapping/EntryFactory.java | |||
| @@ -11,6 +11,7 @@ import javassist.expr.FieldAccess; | |||
| 11 | import javassist.expr.MethodCall; | 11 | import javassist.expr.MethodCall; |
| 12 | import javassist.expr.NewExpr; | 12 | import javassist.expr.NewExpr; |
| 13 | 13 | ||
| 14 | import com.strobel.assembler.metadata.FieldDefinition; | ||
| 14 | import com.strobel.assembler.metadata.MethodDefinition; | 15 | import com.strobel.assembler.metadata.MethodDefinition; |
| 15 | 16 | ||
| 16 | import cuchaz.enigma.analysis.JarIndex; | 17 | import cuchaz.enigma.analysis.JarIndex; |
| @@ -54,6 +55,18 @@ public class EntryFactory { | |||
| 54 | ); | 55 | ); |
| 55 | } | 56 | } |
| 56 | 57 | ||
| 58 | public static FieldEntry getFieldEntry(FieldDefinition def) { | ||
| 59 | return new FieldEntry( | ||
| 60 | new ClassEntry(def.getDeclaringType().getInternalName()), | ||
| 61 | def.getName(), | ||
| 62 | new Type(def.getErasedSignature()) | ||
| 63 | ); | ||
| 64 | } | ||
| 65 | |||
| 66 | public static FieldEntry getFieldEntry(String className, String name, String type) { | ||
| 67 | return new FieldEntry(new ClassEntry(className), name, new Type(type)); | ||
| 68 | } | ||
| 69 | |||
| 57 | public static FieldEntry getObfFieldEntry(ClassMapping classMapping, FieldMapping fieldMapping) { | 70 | public static FieldEntry getObfFieldEntry(ClassMapping classMapping, FieldMapping fieldMapping) { |
| 58 | return new FieldEntry( | 71 | return new FieldEntry( |
| 59 | getObfClassEntry(classMapping), | 72 | getObfClassEntry(classMapping), |
| @@ -82,7 +95,7 @@ public class EntryFactory { | |||
| 82 | return new MethodEntry( | 95 | return new MethodEntry( |
| 83 | new ClassEntry(def.getDeclaringType().getInternalName()), | 96 | new ClassEntry(def.getDeclaringType().getInternalName()), |
| 84 | def.getName(), | 97 | def.getName(), |
| 85 | new Signature(def.getSignature()) | 98 | new Signature(def.getErasedSignature()) |
| 86 | ); | 99 | ); |
| 87 | } | 100 | } |
| 88 | 101 | ||
| @@ -121,7 +134,7 @@ public class EntryFactory { | |||
| 121 | } else { | 134 | } else { |
| 122 | return new ConstructorEntry( | 135 | return new ConstructorEntry( |
| 123 | new ClassEntry(def.getDeclaringType().getInternalName()), | 136 | new ClassEntry(def.getDeclaringType().getInternalName()), |
| 124 | new Signature(def.getSignature()) | 137 | new Signature(def.getErasedSignature()) |
| 125 | ); | 138 | ); |
| 126 | } | 139 | } |
| 127 | } | 140 | } |