Skip to content

Commit

Permalink
Fix #69: Cannot remap descriptors of no-arg methods returning array t…
Browse files Browse the repository at this point in the history
…ypes
  • Loading branch information
XiaoPangxie732 committed May 30, 2022
1 parent 669c941 commit 0c9d222
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public ClassifiedDeobfuscator(ClassifiedMappingReader<NamespacedMapping> reader,
this.mappingRemapper = new ClassifiedMappingRemapper(reader.mappings, sourceNamespace, targetNamespace);
}

@SuppressWarnings("unchecked")
public ClassifiedDeobfuscator deobfuscate(Path source, Path target) throws IOException {
LOGGER.info("Deobfuscating...");
Files.deleteIfExists(target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public String mapToUnmapped(@NotNull final Type mappedType) {
}

public String getUnmappedDescByMappedDesc(@Subst("()V") @NotNull @Pattern(Info.METHOD_DESC_PATTERN) String mappedDescriptor) {
if(mappedDescriptor.startsWith("()") && mappedDescriptor.charAt(2) != 'L') {
if(mappedDescriptor.startsWith("()") && mappedDescriptor.charAt(2) != 'L' && mappedDescriptor.charAt(2) != '[') {
return mappedDescriptor;
}
StringBuilder stringBuilder = new StringBuilder("(");
Expand All @@ -121,7 +121,7 @@ public String mapToMapped(@NotNull final Type unmappedType) {
}

public String getMappedDescByUnmappedDesc(@Subst("()V") @NotNull @Pattern(Info.METHOD_DESC_PATTERN) String unmappedDescriptor) {
if (unmappedDescriptor.startsWith("()") && unmappedDescriptor.charAt(2) != 'L') {
if (unmappedDescriptor.startsWith("()") && unmappedDescriptor.charAt(2) != 'L' && unmappedDescriptor.charAt(2) != '[') {
return unmappedDescriptor;
}
StringBuilder stringBuilder = new StringBuilder("(");
Expand Down

0 comments on commit 0c9d222

Please sign in to comment.