From 35e4e035ef184d50cfcaca705ece0f755e411da6 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 27 Jun 2020 15:08:34 +0100 Subject: [PATCH] Rename deob-map to deob-util Signed-off-by: Graham --- deob-processor/build.gradle.kts | 2 +- .../openrs2/deob/processor/DeobfuscatorProcessorModule.kt | 2 +- .../java/dev/openrs2/deob/processor/NameMapProcessor.kt | 6 +++--- {deob-map => deob-util}/build.gradle.kts | 5 ++--- .../dev/openrs2/deob/util}/map/DeobfuscatorMapModule.kt | 2 +- .../src/main/java/dev/openrs2/deob/util}/map/Field.kt | 2 +- .../src/main/java/dev/openrs2/deob/util}/map/Method.kt | 2 +- .../src/main/java/dev/openrs2/deob/util}/map/NameMap.kt | 2 +- .../main/java/dev/openrs2/deob/util}/map/NameMapProvider.kt | 2 +- deob/build.gradle.kts | 2 +- deob/src/main/java/dev/openrs2/deob/DeobfuscatorModule.kt | 2 +- .../java/dev/openrs2/deob/remap/ClassMappingGenerator.kt | 2 +- .../java/dev/openrs2/deob/remap/FieldMappingGenerator.kt | 2 +- .../java/dev/openrs2/deob/remap/MethodMappingGenerator.kt | 2 +- .../java/dev/openrs2/deob/remap/StaticFieldUnscrambler.kt | 2 +- .../java/dev/openrs2/deob/remap/StaticMethodUnscrambler.kt | 2 +- deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt | 2 +- .../java/dev/openrs2/deob/transform/RemapTransformer.kt | 2 +- settings.gradle.kts | 2 +- 19 files changed, 22 insertions(+), 23 deletions(-) rename {deob-map => deob-util}/build.gradle.kts (69%) rename {deob-map/src/main/java/dev/openrs2/deob => deob-util/src/main/java/dev/openrs2/deob/util}/map/DeobfuscatorMapModule.kt (91%) rename {deob-map/src/main/java/dev/openrs2/deob => deob-util/src/main/java/dev/openrs2/deob/util}/map/Field.kt (61%) rename {deob-map/src/main/java/dev/openrs2/deob => deob-util/src/main/java/dev/openrs2/deob/util}/map/Method.kt (89%) rename {deob-map/src/main/java/dev/openrs2/deob => deob-util/src/main/java/dev/openrs2/deob/util}/map/NameMap.kt (98%) rename {deob-map/src/main/java/dev/openrs2/deob => deob-util/src/main/java/dev/openrs2/deob/util}/map/NameMapProvider.kt (96%) diff --git a/deob-processor/build.gradle.kts b/deob-processor/build.gradle.kts index c731842ba8..be11176047 100644 --- a/deob-processor/build.gradle.kts +++ b/deob-processor/build.gradle.kts @@ -5,7 +5,7 @@ plugins { dependencies { implementation(project(":deob-annotations")) - implementation(project(":deob-map")) + implementation(project(":deob-util")) implementation(project(":yaml")) } diff --git a/deob-processor/src/main/java/dev/openrs2/deob/processor/DeobfuscatorProcessorModule.kt b/deob-processor/src/main/java/dev/openrs2/deob/processor/DeobfuscatorProcessorModule.kt index 08318c6c97..69f70c256c 100644 --- a/deob-processor/src/main/java/dev/openrs2/deob/processor/DeobfuscatorProcessorModule.kt +++ b/deob-processor/src/main/java/dev/openrs2/deob/processor/DeobfuscatorProcessorModule.kt @@ -1,7 +1,7 @@ package dev.openrs2.deob.processor import com.google.inject.AbstractModule -import dev.openrs2.deob.map.DeobfuscatorMapModule +import dev.openrs2.deob.util.map.DeobfuscatorMapModule import dev.openrs2.yaml.YamlModule object DeobfuscatorProcessorModule : AbstractModule() { diff --git a/deob-processor/src/main/java/dev/openrs2/deob/processor/NameMapProcessor.kt b/deob-processor/src/main/java/dev/openrs2/deob/processor/NameMapProcessor.kt index 2a4ccec9bd..0ef84f2754 100644 --- a/deob-processor/src/main/java/dev/openrs2/deob/processor/NameMapProcessor.kt +++ b/deob-processor/src/main/java/dev/openrs2/deob/processor/NameMapProcessor.kt @@ -8,9 +8,9 @@ import dev.openrs2.asm.toInternalClassName import dev.openrs2.deob.annotation.OriginalArg import dev.openrs2.deob.annotation.OriginalClass import dev.openrs2.deob.annotation.OriginalMember -import dev.openrs2.deob.map.Field -import dev.openrs2.deob.map.Method -import dev.openrs2.deob.map.NameMap +import dev.openrs2.deob.util.map.Field +import dev.openrs2.deob.util.map.Method +import dev.openrs2.deob.util.map.NameMap import dev.openrs2.util.io.useAtomicBufferedWriter import java.nio.file.Files import java.nio.file.Path diff --git a/deob-map/build.gradle.kts b/deob-util/build.gradle.kts similarity index 69% rename from deob-map/build.gradle.kts rename to deob-util/build.gradle.kts index d531cb4a64..759f82a903 100644 --- a/deob-map/build.gradle.kts +++ b/deob-util/build.gradle.kts @@ -13,11 +13,10 @@ publishing { pom { packaging = "jar" - name.set("OpenRS2 Deobfuscator Map") + name.set("OpenRS2 Deobfuscator Utilities") description.set( """ - Data structures for representing a map of obfuscated to - refactored names. + Common utility code used by all deobfuscator modules. """.trimIndent() ) } diff --git a/deob-map/src/main/java/dev/openrs2/deob/map/DeobfuscatorMapModule.kt b/deob-util/src/main/java/dev/openrs2/deob/util/map/DeobfuscatorMapModule.kt similarity index 91% rename from deob-map/src/main/java/dev/openrs2/deob/map/DeobfuscatorMapModule.kt rename to deob-util/src/main/java/dev/openrs2/deob/util/map/DeobfuscatorMapModule.kt index 91117d2e7b..f63ed0a209 100644 --- a/deob-map/src/main/java/dev/openrs2/deob/map/DeobfuscatorMapModule.kt +++ b/deob-util/src/main/java/dev/openrs2/deob/util/map/DeobfuscatorMapModule.kt @@ -1,4 +1,4 @@ -package dev.openrs2.deob.map +package dev.openrs2.deob.util.map import com.google.inject.AbstractModule import com.google.inject.Scopes diff --git a/deob-map/src/main/java/dev/openrs2/deob/map/Field.kt b/deob-util/src/main/java/dev/openrs2/deob/util/map/Field.kt similarity index 61% rename from deob-map/src/main/java/dev/openrs2/deob/map/Field.kt rename to deob-util/src/main/java/dev/openrs2/deob/util/map/Field.kt index b0d88939eb..81afa0bf0a 100644 --- a/deob-map/src/main/java/dev/openrs2/deob/map/Field.kt +++ b/deob-util/src/main/java/dev/openrs2/deob/util/map/Field.kt @@ -1,3 +1,3 @@ -package dev.openrs2.deob.map +package dev.openrs2.deob.util.map data class Field(val owner: String, val name: String) diff --git a/deob-map/src/main/java/dev/openrs2/deob/map/Method.kt b/deob-util/src/main/java/dev/openrs2/deob/util/map/Method.kt similarity index 89% rename from deob-map/src/main/java/dev/openrs2/deob/map/Method.kt rename to deob-util/src/main/java/dev/openrs2/deob/util/map/Method.kt index 9a1a86c4fa..a0d023e679 100644 --- a/deob-map/src/main/java/dev/openrs2/deob/map/Method.kt +++ b/deob-util/src/main/java/dev/openrs2/deob/util/map/Method.kt @@ -1,4 +1,4 @@ -package dev.openrs2.deob.map +package dev.openrs2.deob.util.map import java.util.SortedMap diff --git a/deob-map/src/main/java/dev/openrs2/deob/map/NameMap.kt b/deob-util/src/main/java/dev/openrs2/deob/util/map/NameMap.kt similarity index 98% rename from deob-map/src/main/java/dev/openrs2/deob/map/NameMap.kt rename to deob-util/src/main/java/dev/openrs2/deob/util/map/NameMap.kt index 4ae0fe51b3..eb8d2f3dcc 100644 --- a/deob-map/src/main/java/dev/openrs2/deob/map/NameMap.kt +++ b/deob-util/src/main/java/dev/openrs2/deob/util/map/NameMap.kt @@ -1,4 +1,4 @@ -package dev.openrs2.deob.map +package dev.openrs2.deob.util.map import dev.openrs2.asm.MemberRef import dev.openrs2.util.collect.DisjointSet diff --git a/deob-map/src/main/java/dev/openrs2/deob/map/NameMapProvider.kt b/deob-util/src/main/java/dev/openrs2/deob/util/map/NameMapProvider.kt similarity index 96% rename from deob-map/src/main/java/dev/openrs2/deob/map/NameMapProvider.kt rename to deob-util/src/main/java/dev/openrs2/deob/util/map/NameMapProvider.kt index db2d7be5f7..0b9d838bb5 100644 --- a/deob-map/src/main/java/dev/openrs2/deob/map/NameMapProvider.kt +++ b/deob-util/src/main/java/dev/openrs2/deob/util/map/NameMapProvider.kt @@ -1,4 +1,4 @@ -package dev.openrs2.deob.map +package dev.openrs2.deob.util.map import com.fasterxml.jackson.databind.ObjectMapper import java.nio.file.Files diff --git a/deob/build.gradle.kts b/deob/build.gradle.kts index 2eb4f3f8a7..3db1105937 100644 --- a/deob/build.gradle.kts +++ b/deob/build.gradle.kts @@ -13,7 +13,7 @@ dependencies { implementation(project(":bundler")) implementation(project(":deob-annotations")) - implementation(project(":deob-map")) + implementation(project(":deob-util")) implementation("com.google.guava:guava:${Versions.guava}") implementation("it.unimi.dsi:fastutil:${Versions.fastutil}") implementation("org.jgrapht:jgrapht-core:${Versions.jgrapht}") diff --git a/deob/src/main/java/dev/openrs2/deob/DeobfuscatorModule.kt b/deob/src/main/java/dev/openrs2/deob/DeobfuscatorModule.kt index 454bce22d2..7c4a2d72c4 100644 --- a/deob/src/main/java/dev/openrs2/deob/DeobfuscatorModule.kt +++ b/deob/src/main/java/dev/openrs2/deob/DeobfuscatorModule.kt @@ -6,7 +6,6 @@ import com.google.inject.multibindings.Multibinder import dev.openrs2.asm.transform.Transformer import dev.openrs2.bundler.BundlerModule import dev.openrs2.bundler.transform.ResourceTransformer -import dev.openrs2.deob.map.DeobfuscatorMapModule import dev.openrs2.deob.transform.BitShiftTransformer import dev.openrs2.deob.transform.BitwiseOpTransformer import dev.openrs2.deob.transform.BundlerTransformer @@ -35,6 +34,7 @@ import dev.openrs2.deob.transform.UnusedArgTransformer import dev.openrs2.deob.transform.UnusedLocalTransformer import dev.openrs2.deob.transform.UnusedMethodTransformer import dev.openrs2.deob.transform.VisibilityTransformer +import dev.openrs2.deob.util.map.DeobfuscatorMapModule object DeobfuscatorModule : AbstractModule() { override fun configure() { diff --git a/deob/src/main/java/dev/openrs2/deob/remap/ClassMappingGenerator.kt b/deob/src/main/java/dev/openrs2/deob/remap/ClassMappingGenerator.kt index e4db83b366..f6c17cd481 100644 --- a/deob/src/main/java/dev/openrs2/deob/remap/ClassMappingGenerator.kt +++ b/deob/src/main/java/dev/openrs2/deob/remap/ClassMappingGenerator.kt @@ -3,7 +3,7 @@ package dev.openrs2.deob.remap import dev.openrs2.asm.classpath.ClassMetadata import dev.openrs2.asm.classpath.ClassPath import dev.openrs2.asm.filter.ClassFilter -import dev.openrs2.deob.map.NameMap +import dev.openrs2.deob.util.map.NameMap import org.objectweb.asm.Opcodes class ClassMappingGenerator( diff --git a/deob/src/main/java/dev/openrs2/deob/remap/FieldMappingGenerator.kt b/deob/src/main/java/dev/openrs2/deob/remap/FieldMappingGenerator.kt index 7e46b4a82b..bb10eb5580 100644 --- a/deob/src/main/java/dev/openrs2/deob/remap/FieldMappingGenerator.kt +++ b/deob/src/main/java/dev/openrs2/deob/remap/FieldMappingGenerator.kt @@ -3,7 +3,7 @@ package dev.openrs2.deob.remap import dev.openrs2.asm.MemberRef import dev.openrs2.asm.classpath.ClassPath import dev.openrs2.asm.filter.MemberFilter -import dev.openrs2.deob.map.NameMap +import dev.openrs2.deob.util.map.NameMap import dev.openrs2.util.collect.DisjointSet import dev.openrs2.util.indefiniteArticle import org.objectweb.asm.Type diff --git a/deob/src/main/java/dev/openrs2/deob/remap/MethodMappingGenerator.kt b/deob/src/main/java/dev/openrs2/deob/remap/MethodMappingGenerator.kt index de268661fb..9adc882ac6 100644 --- a/deob/src/main/java/dev/openrs2/deob/remap/MethodMappingGenerator.kt +++ b/deob/src/main/java/dev/openrs2/deob/remap/MethodMappingGenerator.kt @@ -4,7 +4,7 @@ import dev.openrs2.asm.MemberDesc import dev.openrs2.asm.MemberRef import dev.openrs2.asm.classpath.ClassPath import dev.openrs2.asm.filter.MemberFilter -import dev.openrs2.deob.map.NameMap +import dev.openrs2.deob.util.map.NameMap import dev.openrs2.util.collect.DisjointSet import org.objectweb.asm.Opcodes diff --git a/deob/src/main/java/dev/openrs2/deob/remap/StaticFieldUnscrambler.kt b/deob/src/main/java/dev/openrs2/deob/remap/StaticFieldUnscrambler.kt index 4cc2e76c07..6936670e81 100644 --- a/deob/src/main/java/dev/openrs2/deob/remap/StaticFieldUnscrambler.kt +++ b/deob/src/main/java/dev/openrs2/deob/remap/StaticFieldUnscrambler.kt @@ -6,7 +6,7 @@ import dev.openrs2.asm.classpath.ClassPath import dev.openrs2.asm.filter.MemberFilter import dev.openrs2.asm.getExpression import dev.openrs2.asm.isSequential -import dev.openrs2.deob.map.NameMap +import dev.openrs2.deob.util.map.NameMap import dev.openrs2.util.collect.DisjointSet import org.objectweb.asm.Opcodes import org.objectweb.asm.tree.AbstractInsnNode diff --git a/deob/src/main/java/dev/openrs2/deob/remap/StaticMethodUnscrambler.kt b/deob/src/main/java/dev/openrs2/deob/remap/StaticMethodUnscrambler.kt index 234de3e3f7..9d0aea461b 100644 --- a/deob/src/main/java/dev/openrs2/deob/remap/StaticMethodUnscrambler.kt +++ b/deob/src/main/java/dev/openrs2/deob/remap/StaticMethodUnscrambler.kt @@ -3,7 +3,7 @@ package dev.openrs2.deob.remap import dev.openrs2.asm.MemberRef import dev.openrs2.asm.classpath.ClassPath import dev.openrs2.asm.filter.MemberFilter -import dev.openrs2.deob.map.NameMap +import dev.openrs2.deob.util.map.NameMap import dev.openrs2.util.collect.DisjointSet import org.objectweb.asm.Opcodes diff --git a/deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt b/deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt index 81cd9bf0af..3b2a55ff9f 100644 --- a/deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt +++ b/deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt @@ -7,7 +7,7 @@ import dev.openrs2.asm.classpath.ExtendedRemapper import dev.openrs2.asm.filter.UnionMemberFilter import dev.openrs2.deob.Profile import dev.openrs2.deob.filter.BrowserControlFilter -import dev.openrs2.deob.map.NameMap +import dev.openrs2.deob.util.map.NameMap import dev.openrs2.util.collect.DisjointSet import org.objectweb.asm.tree.AbstractInsnNode diff --git a/deob/src/main/java/dev/openrs2/deob/transform/RemapTransformer.kt b/deob/src/main/java/dev/openrs2/deob/transform/RemapTransformer.kt index 5445fc092d..4f3799ae4d 100644 --- a/deob/src/main/java/dev/openrs2/deob/transform/RemapTransformer.kt +++ b/deob/src/main/java/dev/openrs2/deob/transform/RemapTransformer.kt @@ -3,8 +3,8 @@ package dev.openrs2.deob.transform import dev.openrs2.asm.classpath.ClassPath import dev.openrs2.asm.transform.Transformer import dev.openrs2.deob.Profile -import dev.openrs2.deob.map.NameMap import dev.openrs2.deob.remap.TypedRemapper +import dev.openrs2.deob.util.map.NameMap import javax.inject.Inject import javax.inject.Singleton diff --git a/settings.gradle.kts b/settings.gradle.kts index 15de302bfb..e346414f7d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -13,8 +13,8 @@ include( "deob", "deob-annotations", "deob-ast", - "deob-map", "deob-processor", + "deob-util", "game", "nonfree", "nonfree:client",