forked from openrs2/openrs2
I'm going to use it in multiple places, so I think it makes sense to share it (at the expense of the asm module depending on the yaml module). Signed-off-by: Graham <gpe@openrs2.dev>
parent
2a4d607d96
commit
3dcf91cfef
@ -1,11 +1,10 @@ |
|||||||
package dev.openrs2.deob.map |
package dev.openrs2.asm |
||||||
|
|
||||||
import com.fasterxml.jackson.databind.module.SimpleModule |
import com.fasterxml.jackson.databind.module.SimpleModule |
||||||
import dev.openrs2.asm.MemberRef |
|
||||||
import javax.inject.Singleton |
import javax.inject.Singleton |
||||||
|
|
||||||
@Singleton |
@Singleton |
||||||
class DeobfuscatorMapJacksonModule : SimpleModule() { |
class AsmJacksonModule : SimpleModule() { |
||||||
init { |
init { |
||||||
addKeyDeserializer(MemberRef::class.java, MemberRefKeyDeserializer) |
addKeyDeserializer(MemberRef::class.java, MemberRefKeyDeserializer) |
||||||
} |
} |
@ -0,0 +1,15 @@ |
|||||||
|
package dev.openrs2.asm |
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.Module |
||||||
|
import com.google.inject.AbstractModule |
||||||
|
import com.google.inject.multibindings.Multibinder |
||||||
|
import dev.openrs2.yaml.YamlModule |
||||||
|
|
||||||
|
object AsmModule : AbstractModule() { |
||||||
|
override fun configure() { |
||||||
|
install(YamlModule) |
||||||
|
|
||||||
|
Multibinder.newSetBinder(binder(), Module::class.java) |
||||||
|
.addBinding().to(AsmJacksonModule::class.java) |
||||||
|
} |
||||||
|
} |
@ -1,8 +1,7 @@ |
|||||||
package dev.openrs2.deob.map |
package dev.openrs2.asm |
||||||
|
|
||||||
import com.fasterxml.jackson.databind.DeserializationContext |
import com.fasterxml.jackson.databind.DeserializationContext |
||||||
import com.fasterxml.jackson.databind.KeyDeserializer |
import com.fasterxml.jackson.databind.KeyDeserializer |
||||||
import dev.openrs2.asm.MemberRef |
|
||||||
|
|
||||||
object MemberRefKeyDeserializer : KeyDeserializer() { |
object MemberRefKeyDeserializer : KeyDeserializer() { |
||||||
override fun deserializeKey(key: String, ctx: DeserializationContext): Any { |
override fun deserializeKey(key: String, ctx: DeserializationContext): Any { |
Loading…
Reference in new issue