summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-09-01 12:42:19 +0200
committer zaaarf <zaaarf@proton.me>2023-09-01 12:42:19 +0200
commit3dd86a41872585b7cbba4f6b4e1407316bf889c3 (patch)
treeb0ab24ed775703b9126fd5c3d97d020ea7df5485 /src
parent30f8e080ae5d7bd811abb5b96bc6b85aa89350a8 (diff)
chore: updated to mapping library 0.3.0
Diffstat (limited to 'src')
-rw-r--r--src/main/java/ftbsc/lll/processor/tools/ASTUtils.java14
-rw-r--r--src/main/java/ftbsc/lll/processor/tools/ProcessorOptions.java9
2 files changed, 11 insertions, 12 deletions
diff --git a/src/main/java/ftbsc/lll/processor/tools/ASTUtils.java b/src/main/java/ftbsc/lll/processor/tools/ASTUtils.java
index 952abd1..326f52d 100644
--- a/src/main/java/ftbsc/lll/processor/tools/ASTUtils.java
+++ b/src/main/java/ftbsc/lll/processor/tools/ASTUtils.java
@@ -4,12 +4,12 @@ import ftbsc.lll.exceptions.AmbiguousDefinitionException;
import ftbsc.lll.exceptions.MappingNotFoundException;
import ftbsc.lll.exceptions.NotAProxyException;
import ftbsc.lll.exceptions.TargetNotFoundException;
+import ftbsc.lll.mapper.tools.Mapper;
import ftbsc.lll.mapper.tools.data.ClassData;
import ftbsc.lll.mapper.tools.data.FieldData;
import ftbsc.lll.mapper.tools.data.MethodData;
import ftbsc.lll.processor.annotations.Target;
import ftbsc.lll.processor.tools.containers.ClassContainer;
-import ftbsc.lll.mapper.IMapper;
import ftbsc.lll.proxies.ProxyType;
import javax.annotation.processing.ProcessingEnvironment;
@@ -216,11 +216,11 @@ public class ASTUtils {
* Gets the {@link ClassData} corresponding to the given fully-qualified name,
* or creates a false one with the same, non-obfuscated name twice.
* @param name the internal name of the class to convert
- * @param mapper the {@link IMapper} to use, may be null
+ * @param mapper the {@link Mapper} to use, may be null
* @return the fully qualified class name
* @since 0.6.1
*/
- public static ClassData getClassData(String name, IMapper mapper) {
+ public static ClassData getClassData(String name, Mapper mapper) {
try {
name = name.replace('.', '/'); //just in case
if(mapper != null)
@@ -236,11 +236,11 @@ public class ASTUtils {
* @param parent the internal name of the parent class
* @param name the name of the member
* @param descriptor the descriptor of the method
- * @param mapper the {@link IMapper} to use, may be null
+ * @param mapper the {@link Mapper} to use, may be null
* @return the fully qualified class name
* @since 0.6.1
*/
- public static MethodData getMethodData(String parent, String name, String descriptor, IMapper mapper) {
+ public static MethodData getMethodData(String parent, String name, String descriptor, Mapper mapper) {
try {
name = name.replace('.', '/'); //just in case
if(mapper != null)
@@ -255,11 +255,11 @@ public class ASTUtils {
* mapping is found.
* @param parent the internal name of the parent class
* @param name the name of the member
- * @param mapper the {@link IMapper} to use, may be null
+ * @param mapper the {@link Mapper} to use, may be null
* @return the fully qualified class name
* @since 0.6.1
*/
- public static FieldData getFieldData(String parent, String name, IMapper mapper) {
+ public static FieldData getFieldData(String parent, String name, Mapper mapper) {
try {
name = name.replace('.', '/'); //just in case
if(mapper != null)
diff --git a/src/main/java/ftbsc/lll/processor/tools/ProcessorOptions.java b/src/main/java/ftbsc/lll/processor/tools/ProcessorOptions.java
index 77d0dad..70d43cc 100644
--- a/src/main/java/ftbsc/lll/processor/tools/ProcessorOptions.java
+++ b/src/main/java/ftbsc/lll/processor/tools/ProcessorOptions.java
@@ -1,8 +1,8 @@
package ftbsc.lll.processor.tools;
import ftbsc.lll.IInjector;
-import ftbsc.lll.mapper.IMapper;
import ftbsc.lll.mapper.MapperProvider;
+import ftbsc.lll.mapper.tools.Mapper;
import javax.annotation.processing.ProcessingEnvironment;
import java.util.Arrays;
@@ -30,10 +30,10 @@ public class ProcessorOptions {
public final ProcessingEnvironment env;
/**
- * The {@link IMapper} used to convert classes and variables
+ * The {@link Mapper} used to convert classes and variables
* to their obfuscated equivalent. Will be null when no mapper is in use.
*/
- public final IMapper mapper;
+ public final Mapper mapper;
/**
* Whether the processor should issue warnings when compiling code anonymous
@@ -61,8 +61,7 @@ public class ProcessorOptions {
String location = env.getOptions().get("mappingsFile");
if(location != null) {
List<String> lines = MapperProvider.fetchFromLocalOrRemote(location);
- this.mapper = MapperProvider.getMapper(lines);
- this.mapper.populate(lines, true);
+ this.mapper = MapperProvider.getMapper(lines).getMapper(lines, true);
} else this.mapper = null;
this.anonymousClassWarning = parseBooleanArg(env.getOptions().get("anonymousClassWarning"), true);
this.obfuscateInjectorMetadata = parseBooleanArg(env.getOptions().get("obfuscateInjectorMetadata"), true);