summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/mapping/LocalVariableEntry.java
diff options
context:
space:
mode:
authorGravatar gegy10002018-07-17 19:14:08 +0200
committerGravatar GitHub2018-07-17 19:14:08 +0200
commita88175ffc95792b88a8724f66db6dda2b8cc32ee (patch)
tree65895bbc6cf1766f4ca01e1257619ab1993e71dc /src/main/java/cuchaz/enigma/mapping/LocalVariableEntry.java
parentMerge pull request #3 from thiakil/src-jar (diff)
downloadenigma-fork-a88175ffc95792b88a8724f66db6dda2b8cc32ee.tar.gz
enigma-fork-a88175ffc95792b88a8724f66db6dda2b8cc32ee.tar.xz
enigma-fork-a88175ffc95792b88a8724f66db6dda2b8cc32ee.zip
ASM Based Class Translator (#1)
* Initial port to ASM * Package updates * Annotation + inner class translation * Fix inner class mapping * More bytecode translation * Signature refactoring * Fix highlighting of mapped names * Fix parameter name offset * Fix anonymous class generation * Fix issues with inner class signature transformation * Fix bridged method detection * Fix compile issues * Resolve all failed tests * Apply deobfuscated name to transformed classes * Fix class signatures not being translated * Fix frame array type translation * Fix frame array type translation * Fix array translation in method calls * Fix method reference and bridge detection * Fix handling of null deobf mappings * Parameter translation in interfaces * Fix enum parameter index offset * Fix parsed local variable indexing * Fix stackoverflow on rebuilding method names * Ignore invalid decompiled variable indices * basic source jar * Output directly to file on source export * Make decompile parallel * fix incorrect super calls * Use previous save state to delete old mapping files * Fix old mappings not properly being removed * Fix old mappings not properly being removed * make isMethodProvider public (cherry picked from commit ebad6a9) * speed up Deobfuscator's getSources by using a single TranslatingTypeloader and caching the ClassLoaderTypeloader * ignore .idea project folders * move SynchronizedTypeLoader to a non-inner * fix signature remap of inners for now * index & resolve method/field references for usages view * Allow reader/writer subclasses to provide the underlying file operations * fix giving obf classes a name not removing them from the panel * buffer the ParsedJar class entry inputstream, allow use with a jarinputstream * make CachingClasspathTypeLoader public * make CachingClasspathTypeLoader public * support enum switches with obfuscated SwitchMaps
Diffstat (limited to 'src/main/java/cuchaz/enigma/mapping/LocalVariableEntry.java')
-rw-r--r--src/main/java/cuchaz/enigma/mapping/LocalVariableEntry.java102
1 files changed, 0 insertions, 102 deletions
diff --git a/src/main/java/cuchaz/enigma/mapping/LocalVariableEntry.java b/src/main/java/cuchaz/enigma/mapping/LocalVariableEntry.java
deleted file mode 100644
index 2bb5e3f..0000000
--- a/src/main/java/cuchaz/enigma/mapping/LocalVariableEntry.java
+++ /dev/null
@@ -1,102 +0,0 @@
1package cuchaz.enigma.mapping;
2
3import cuchaz.enigma.utils.Utils;
4
5/**
6 * Desc...
7 * Created by Thog
8 * 19/10/2016
9 */
10public class LocalVariableEntry implements Entry {
11
12 protected final BehaviorEntry behaviorEntry;
13 protected final String name;
14 protected final Type type;
15 protected final int index;
16
17 public LocalVariableEntry(BehaviorEntry behaviorEntry, int index, String name, Type type) {
18 if (behaviorEntry == null) {
19 throw new IllegalArgumentException("Behavior cannot be null!");
20 }
21 if (index < 0) {
22 throw new IllegalArgumentException("Index must be non-negative!");
23 }
24 if (name == null) {
25 throw new IllegalArgumentException("Variable name cannot be null!");
26 }
27 if (type == null) {
28 throw new IllegalArgumentException("Variable type cannot be null!");
29 }
30
31 this.behaviorEntry = behaviorEntry;
32 this.name = name;
33 this.type = type;
34 this.index = index;
35 }
36
37 public LocalVariableEntry(LocalVariableEntry other, ClassEntry newClassEntry) {
38 this.behaviorEntry = (BehaviorEntry) other.behaviorEntry.cloneToNewClass(newClassEntry);
39 this.name = other.name;
40 this.type = other.type;
41 this.index = other.index;
42 }
43
44 public BehaviorEntry getBehaviorEntry() {
45 return this.behaviorEntry;
46 }
47
48 public Type getType() {
49 return type;
50 }
51
52 public int getIndex() {
53 return index;
54 }
55
56 @Override
57 public String getName() {
58 return this.name;
59 }
60
61 @Override
62 public ClassEntry getClassEntry() {
63 return this.behaviorEntry.getClassEntry();
64 }
65
66 @Override
67 public String getClassName() {
68 return this.behaviorEntry.getClassName();
69 }
70
71 @Override
72 public LocalVariableEntry cloneToNewClass(ClassEntry classEntry) {
73 return new LocalVariableEntry(this, classEntry);
74 }
75
76 public String getMethodName() {
77 return this.behaviorEntry.getName();
78 }
79
80 public Signature getMethodSignature() {
81 return this.behaviorEntry.getSignature();
82 }
83
84 @Override
85 public int hashCode() {
86 return Utils.combineHashesOrdered(this.behaviorEntry, this.type.hashCode(), this.name.hashCode(), Integer.hashCode(this.index));
87 }
88
89 @Override
90 public boolean equals(Object other) {
91 return other instanceof LocalVariableEntry && equals((LocalVariableEntry) other);
92 }
93
94 public boolean equals(LocalVariableEntry other) {
95 return this.behaviorEntry.equals(other.behaviorEntry) && this.type.equals(other.type) && this.name.equals(other.name) && this.index == other.index;
96 }
97
98 @Override
99 public String toString() {
100 return this.behaviorEntry + "(" + this.index + ":" + this.name + ":" + this.type + ")";
101 }
102}