Remove deob.gson which isn't used
This commit is contained in:
@@ -6,7 +6,6 @@ import java.io.FileWriter;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import net.runelite.deob.gson.GsonFactory;
|
|
||||||
import net.runelite.asm.pool.Field;
|
import net.runelite.asm.pool.Field;
|
||||||
|
|
||||||
public class Encryption
|
public class Encryption
|
||||||
@@ -32,15 +31,4 @@ public class Encryption
|
|||||||
{
|
{
|
||||||
return fields.get(field);
|
return fields.get(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save(File file) throws IOException
|
|
||||||
{
|
|
||||||
Gson g = GsonFactory.gson;
|
|
||||||
String str = g.toJson(fields);
|
|
||||||
|
|
||||||
try (FileWriter fw = new FileWriter(file))
|
|
||||||
{
|
|
||||||
fw.write(str);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
package net.runelite.deob.gson;
|
|
||||||
|
|
||||||
import com.google.gson.JsonElement;
|
|
||||||
import com.google.gson.JsonObject;
|
|
||||||
import com.google.gson.JsonSerializationContext;
|
|
||||||
import com.google.gson.JsonSerializer;
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import net.runelite.asm.pool.Class;
|
|
||||||
|
|
||||||
public class ClassSerializer implements JsonSerializer<Class>
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public JsonElement serialize(Class src, Type typeOfSrc, JsonSerializationContext context)
|
|
||||||
{
|
|
||||||
JsonObject object = new JsonObject();
|
|
||||||
object.addProperty("name", src.getName());
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package net.runelite.deob.gson;
|
|
||||||
|
|
||||||
import com.google.gson.JsonElement;
|
|
||||||
import com.google.gson.JsonObject;
|
|
||||||
import com.google.gson.JsonSerializationContext;
|
|
||||||
import com.google.gson.JsonSerializer;
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import net.runelite.asm.pool.Field;
|
|
||||||
|
|
||||||
public class FieldSerializer implements JsonSerializer<Field>
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public JsonElement serialize(Field src, Type typeOfSrc, JsonSerializationContext context)
|
|
||||||
{
|
|
||||||
JsonObject object = new JsonObject();
|
|
||||||
object.addProperty("class", src.getClassEntry().getName());
|
|
||||||
object.addProperty("name", src.getNameAndType().getName());
|
|
||||||
object.add("type", context.serialize(src.getNameAndType().getDescriptorType()));
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package net.runelite.deob.gson;
|
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import com.google.gson.GsonBuilder;
|
|
||||||
import net.runelite.asm.pool.Field;
|
|
||||||
import net.runelite.asm.pool.Method;
|
|
||||||
import net.runelite.asm.pool.Class;
|
|
||||||
|
|
||||||
public class GsonFactory
|
|
||||||
{
|
|
||||||
public static final Gson gson = new GsonBuilder()
|
|
||||||
.registerTypeAdapter(Field.class, new FieldSerializer())
|
|
||||||
.registerTypeAdapter(Method.class, new MethodSerializer())
|
|
||||||
.registerTypeAdapter(Class.class, new ClassSerializer())
|
|
||||||
.enableComplexMapKeySerialization()
|
|
||||||
.setPrettyPrinting()
|
|
||||||
.create();
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
package net.runelite.deob.gson;
|
|
||||||
|
|
||||||
import com.google.gson.JsonElement;
|
|
||||||
import com.google.gson.JsonObject;
|
|
||||||
import com.google.gson.JsonSerializationContext;
|
|
||||||
import com.google.gson.JsonSerializer;
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import net.runelite.asm.pool.Method;
|
|
||||||
|
|
||||||
|
|
||||||
public class MethodSerializer implements JsonSerializer<Method>
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public JsonElement serialize(Method src, Type typeOfSrc, JsonSerializationContext context)
|
|
||||||
{
|
|
||||||
JsonObject object = new JsonObject();
|
|
||||||
object.addProperty("class", src.getClassEntry().getName());
|
|
||||||
object.addProperty("name", src.getNameAndType().getName());
|
|
||||||
object.add("type", context.serialize(src.getNameAndType().getDescriptor()));
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,7 @@
|
|||||||
package net.runelite.deob.util;
|
package net.runelite.deob.util;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import com.google.gson.GsonBuilder;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import net.runelite.deob.gson.GsonFactory;
|
|
||||||
import net.runelite.asm.pool.Class;
|
import net.runelite.asm.pool.Class;
|
||||||
import net.runelite.asm.pool.Field;
|
import net.runelite.asm.pool.Field;
|
||||||
import net.runelite.asm.pool.Method;
|
import net.runelite.asm.pool.Method;
|
||||||
@@ -40,15 +34,4 @@ public class NameMappings
|
|||||||
{
|
{
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save(File file) throws IOException
|
|
||||||
{
|
|
||||||
Gson g = GsonFactory.gson;
|
|
||||||
String str = g.toJson(map);
|
|
||||||
|
|
||||||
try (FileWriter fw = new FileWriter(file))
|
|
||||||
{
|
|
||||||
fw.write(str);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user