From 8e79af0bd4e9bb1ab3ac491680c57ffa6d06948c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Mon, 29 Nov 2021 12:11:25 +0100 Subject: [PATCH] Fixed AS1/2 - on keypress key escaping --- CHANGELOG.md | 1 + .../com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java | 2 +- .../src/com/jpexs/decompiler/flash/types/CLIPEVENTFLAGS.java | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9050ed66a..59e0e0b4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ All notable changes to this project will be documented in this file. - AS2 - obfuscated extends, implements - AS1/2 - chained assignments with obfuscated/slash variables - AS - direct editation - long integer values +- AS1/2 - on keypress key escaping ## [14.6.0] - 2021-11-22 ### Added diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java index 5e4b2b58b..88270eb32 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java @@ -306,7 +306,7 @@ public class BUTTONCONDACTION implements ASMSource, Serializable { if (asFilename) { events.add("keyPress " + Helper.makeFileName(CLIPACTIONRECORD.keyToString(condKeyPress).replace("<", "").replace(">", "")) + ""); } else { - events.add("keyPress \"" + CLIPACTIONRECORD.keyToString(condKeyPress) + "\""); + events.add("keyPress \"" + Helper.escapeActionScriptString(CLIPACTIONRECORD.keyToString(condKeyPress)) + "\""); } } String onStr = ""; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPEVENTFLAGS.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPEVENTFLAGS.java index 4208acb59..5dc6bfa0d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPEVENTFLAGS.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPEVENTFLAGS.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.types; import com.jpexs.decompiler.flash.types.annotations.Conditional; @@ -204,7 +205,7 @@ public class CLIPEVENTFLAGS implements Serializable { if (asFileName) { onList.add("keyPress " + Helper.makeFileName(CLIPACTIONRECORD.keyToString(key).replace("<", "").replace(">", "")) + ""); } else { - onList.add("keyPress \"" + CLIPACTIONRECORD.keyToString(key) + "\""); + onList.add("keyPress \"" + Helper.escapeActionScriptString(CLIPACTIONRECORD.keyToString(key)) + "\""); } } if (clipEventDragOut) {