diff --git a/build.gradle b/build.gradle index 3c7ab361f..37d3521d4 100644 --- a/build.gradle +++ b/build.gradle @@ -112,6 +112,8 @@ subprojects { ssvm = "com.github.xxdark:ssvm:$ssvmVersion" procyon_core = "org.bitbucket.mstrobel:procyon-core:$procyonVersion" procyon_compiler_tools = "org.bitbucket.mstrobel:procyon-compilertools:$procyonVersion" + string_escape_utils = "org.apache.commons:commons-text:1.10.0" + } } diff --git a/recaf-assembler/build.gradle b/recaf-assembler/build.gradle index f5142247d..75d2d1a24 100644 --- a/recaf-assembler/build.gradle +++ b/recaf-assembler/build.gradle @@ -13,7 +13,7 @@ dependencies { api asm api asm_tree - + api string_escape_utils api "com.github.Nowilltolife:Jasm:$jasmVersion" // Testing diff --git a/recaf-assembler/src/main/java/me/coley/recaf/assemble/transformer/AstToMethodTransformer.java b/recaf-assembler/src/main/java/me/coley/recaf/assemble/transformer/AstToMethodTransformer.java index 6f035f59a..79eaf6a12 100644 --- a/recaf-assembler/src/main/java/me/coley/recaf/assemble/transformer/AstToMethodTransformer.java +++ b/recaf-assembler/src/main/java/me/coley/recaf/assemble/transformer/AstToMethodTransformer.java @@ -17,6 +17,7 @@ import org.objectweb.asm.Handle; import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.*; +import org.apache.commons.text.StringEscapeUtils; import java.util.*; import java.util.stream.Collectors; @@ -353,7 +354,7 @@ private InsnList createInstructions() throws MethodCompileException { Object cst = ldc.getValue(); // TODO: We need to handle escapes better, but this works for \\u0000 escapes for now if (cst instanceof String) - cst = EscapeUtil.unescape((String) cst); + cst = StringEscapeUtils.unescapeJava((String) cst); addCode(list, instruction, new LdcInsnNode(cst)); break; case TYPE: