From 9308df5bb783a9456bcf82e356744f3db3c3cafd Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Wed, 15 May 2019 17:03:12 +0100 Subject: [PATCH 1/6] 0.4.4: Prep for next dev cycle --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index e3e9209..1bad987 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ subprojects { group = 'me.jamiemansfield' archivesBaseName = project.name.toLowerCase() - version = '0.4.3' + version = '0.4.4-SNAPSHOT' repositories { mavenCentral() From a78bdab9a772da67ecf9918ed36b306ddb1cbb17 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sat, 27 Oct 2018 18:25:28 +0100 Subject: [PATCH 2/6] bug-fix(tsrg): don't write class line for empty parents --- changelogs/0.4.4.md | 11 +++++++++++ .../jamiemansfield/lorenz/io/srg/tsrg/TSrgWriter.java | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 changelogs/0.4.4.md diff --git a/changelogs/0.4.4.md b/changelogs/0.4.4.md new file mode 100644 index 0000000..2db3217 --- /dev/null +++ b/changelogs/0.4.4.md @@ -0,0 +1,11 @@ +Lorenz 0.4.4 +============ + +Lorenz 0.4.4 is the combination of bugs identified in the development of Lorenz 0.5.0, specifically +with regards to the mapping format implementations, in addition to a faulty mapping model method. + +## IO + +- TSRG: Don't write empty class line for parents + +## Mapping Model diff --git a/lorenz/src/main/java/me/jamiemansfield/lorenz/io/srg/tsrg/TSrgWriter.java b/lorenz/src/main/java/me/jamiemansfield/lorenz/io/srg/tsrg/TSrgWriter.java index 48059cc..d16e0e5 100644 --- a/lorenz/src/main/java/me/jamiemansfield/lorenz/io/srg/tsrg/TSrgWriter.java +++ b/lorenz/src/main/java/me/jamiemansfield/lorenz/io/srg/tsrg/TSrgWriter.java @@ -67,7 +67,12 @@ public void write(final MappingSet mappings) { * @param mapping The class mapping */ protected void writeClassMapping(final ClassMapping mapping) { - this.writer.println(String.format("%s %s", mapping.getFullObfuscatedName(), mapping.getFullDeobfuscatedName())); + // Effectively ClassMapping#hasMappings() without the inner class check + if (mapping.hasDeobfuscatedName() || + mapping.getFieldMappings().stream().anyMatch(Mapping::hasDeobfuscatedName) || + mapping.getMethodMappings().stream().anyMatch(MethodMapping::hasMappings)) { + this.writer.println(String.format("%s %s", mapping.getFullObfuscatedName(), mapping.getFullDeobfuscatedName())); + } // Write field mappings mapping.getFieldsByName().values().stream() From 3381162798d5164a60ff384b2a14951ac18d49c7 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sat, 27 Oct 2018 15:53:17 +0100 Subject: [PATCH 3/6] bug-fix: Consider argument mappings in ClassMapping::hasMappings --- changelogs/0.4.4.md | 3 +++ .../main/java/me/jamiemansfield/lorenz/model/ClassMapping.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changelogs/0.4.4.md b/changelogs/0.4.4.md index 2db3217..9982f05 100644 --- a/changelogs/0.4.4.md +++ b/changelogs/0.4.4.md @@ -9,3 +9,6 @@ with regards to the mapping format implementations, in addition to a faulty mapp - TSRG: Don't write empty class line for parents ## Mapping Model + +- Fix the faulty implementation of `ClassMapping::hasMappings`, specifically it did'nt consider method + argument mappings diff --git a/lorenz/src/main/java/me/jamiemansfield/lorenz/model/ClassMapping.java b/lorenz/src/main/java/me/jamiemansfield/lorenz/model/ClassMapping.java index c827fc0..af8252a 100644 --- a/lorenz/src/main/java/me/jamiemansfield/lorenz/model/ClassMapping.java +++ b/lorenz/src/main/java/me/jamiemansfield/lorenz/model/ClassMapping.java @@ -415,7 +415,7 @@ default InnerClassMapping getOrCreateInnerClassMapping(final String obfuscatedNa default boolean hasMappings() { return this.hasDeobfuscatedName() || this.getFieldMappings().stream().anyMatch(Mapping::hasDeobfuscatedName) || - this.getMethodMappings().stream().anyMatch(Mapping::hasDeobfuscatedName) || + this.getMethodMappings().stream().anyMatch(MethodMapping::hasMappings) || this.getInnerClassMappings().stream().anyMatch(ClassMapping::hasMappings); } From daad9a60ede5f573ac6ec9ec822f7abffa4de47c Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sat, 27 Oct 2018 15:45:04 +0100 Subject: [PATCH 4/6] bug-fix: Correct Enigma writer The de-obfuscated type was written, that was wrong... --- changelogs/0.4.4.md | 1 + .../java/me/jamiemansfield/lorenz/io/enigma/EnigmaWriter.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelogs/0.4.4.md b/changelogs/0.4.4.md index 9982f05..7112020 100644 --- a/changelogs/0.4.4.md +++ b/changelogs/0.4.4.md @@ -7,6 +7,7 @@ with regards to the mapping format implementations, in addition to a faulty mapp ## IO - TSRG: Don't write empty class line for parents +- Enigma: Output field types properly, using the *obfuscated* type ## Mapping Model diff --git a/lorenz/src/main/java/me/jamiemansfield/lorenz/io/enigma/EnigmaWriter.java b/lorenz/src/main/java/me/jamiemansfield/lorenz/io/enigma/EnigmaWriter.java index 4d55a83..295513f 100644 --- a/lorenz/src/main/java/me/jamiemansfield/lorenz/io/enigma/EnigmaWriter.java +++ b/lorenz/src/main/java/me/jamiemansfield/lorenz/io/enigma/EnigmaWriter.java @@ -137,7 +137,7 @@ private void writeFieldMapping(final FieldMapping field, final int indent) { this.printIndentedLine(indent, String.format("FIELD %s %s %s", field.getObfuscatedName(), field.getDeobfuscatedName(), - field.getMappings().deobfuscate(type) + handleNonePrefix(type) )); }); // TODO: throw an exception if the type is unknown / WriterResult container From 8f477f3cf521a6352c996d6331c0304dbdf4d25d Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Fri, 2 Nov 2018 17:56:52 +0000 Subject: [PATCH 5/6] bug-fix(tsrg): fix fault length check All the length checks throughout Lorenz probably ought to be checked. --- changelogs/0.4.4.md | 1 + .../java/me/jamiemansfield/lorenz/io/srg/tsrg/TSrgReader.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelogs/0.4.4.md b/changelogs/0.4.4.md index 7112020..d27aba1 100644 --- a/changelogs/0.4.4.md +++ b/changelogs/0.4.4.md @@ -7,6 +7,7 @@ with regards to the mapping format implementations, in addition to a faulty mapp ## IO - TSRG: Don't write empty class line for parents +- TSRG: Correct a length check, preventing some **valid** mappings from being read - Enigma: Output field types properly, using the *obfuscated* type ## Mapping Model diff --git a/lorenz/src/main/java/me/jamiemansfield/lorenz/io/srg/tsrg/TSrgReader.java b/lorenz/src/main/java/me/jamiemansfield/lorenz/io/srg/tsrg/TSrgReader.java index 6b08887..69a51c4 100644 --- a/lorenz/src/main/java/me/jamiemansfield/lorenz/io/srg/tsrg/TSrgReader.java +++ b/lorenz/src/main/java/me/jamiemansfield/lorenz/io/srg/tsrg/TSrgReader.java @@ -82,7 +82,7 @@ public void accept(final String rawLine) { final String line = SrgConstants.removeComments(rawLine); if (line.isEmpty()) return; - if (line.length() < 4) { + if (line.length() < 3) { throw new IllegalArgumentException("Faulty TSRG mapping encountered: `" + line + "`!"); } From e4034cc68f81c331b862ad4532e1778a8b48734a Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Wed, 15 May 2019 17:38:40 +0100 Subject: [PATCH 6/6] 0.4.4: Release Time --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 1bad987..70fe9a5 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ subprojects { group = 'me.jamiemansfield' archivesBaseName = project.name.toLowerCase() - version = '0.4.4-SNAPSHOT' + version = '0.4.4' repositories { mavenCentral()