diff options
| author | 2018-07-17 19:14:08 +0200 | |
|---|---|---|
| committer | 2018-07-17 19:14:08 +0200 | |
| commit | a88175ffc95792b88a8724f66db6dda2b8cc32ee (patch) | |
| tree | 65895bbc6cf1766f4ca01e1257619ab1993e71dc /src/main/java/cuchaz/enigma/mapping/LocalVariableMapping.java | |
| parent | Merge pull request #3 from thiakil/src-jar (diff) | |
| download | enigma-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/LocalVariableMapping.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/mapping/LocalVariableMapping.java | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/main/java/cuchaz/enigma/mapping/LocalVariableMapping.java b/src/main/java/cuchaz/enigma/mapping/LocalVariableMapping.java new file mode 100644 index 0000000..62dbcf3 --- /dev/null +++ b/src/main/java/cuchaz/enigma/mapping/LocalVariableMapping.java | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2015 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 4 | * are made available under the terms of the GNU Lesser General Public | ||
| 5 | * License v3.0 which accompanies this distribution, and is available at | ||
| 6 | * http://www.gnu.org/licenses/lgpl.html | ||
| 7 | * <p> | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | |||
| 12 | package cuchaz.enigma.mapping; | ||
| 13 | |||
| 14 | import cuchaz.enigma.mapping.entry.LocalVariableEntry; | ||
| 15 | import cuchaz.enigma.mapping.entry.MethodEntry; | ||
| 16 | |||
| 17 | public class LocalVariableMapping implements Comparable<LocalVariableMapping> { | ||
| 18 | |||
| 19 | private int index; | ||
| 20 | private String name; | ||
| 21 | |||
| 22 | // NOTE: this argument order is important for the MethodReader/MethodWriter | ||
| 23 | public LocalVariableMapping(int index, String name) { | ||
| 24 | this.index = index; | ||
| 25 | this.name = NameValidator.validateArgumentName(name); | ||
| 26 | } | ||
| 27 | |||
| 28 | public LocalVariableMapping(LocalVariableMapping other) { | ||
| 29 | this.index = other.index; | ||
| 30 | this.name = other.name; | ||
| 31 | } | ||
| 32 | |||
| 33 | public int getIndex() { | ||
| 34 | return this.index; | ||
| 35 | } | ||
| 36 | |||
| 37 | public String getName() { | ||
| 38 | return this.name; | ||
| 39 | } | ||
| 40 | |||
| 41 | public void setName(String val) { | ||
| 42 | this.name = NameValidator.validateArgumentName(val); | ||
| 43 | } | ||
| 44 | |||
| 45 | public LocalVariableEntry getObfEntry(MethodEntry methodEntry) { | ||
| 46 | return new LocalVariableEntry(methodEntry, index, name); | ||
| 47 | } | ||
| 48 | |||
| 49 | @Override | ||
| 50 | public int compareTo(LocalVariableMapping other) { | ||
| 51 | return Integer.compare(this.index, other.index); | ||
| 52 | } | ||
| 53 | } | ||