From afcb4a1c369ec5ea5233194b2b0ddb943c56d29d Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 27 Mar 2016 18:43:41 -0400 Subject: [PATCH] Fix annotation mapper to map annotations on methods. Also fix lookup by constant classname. Theres more fields that i thought that aren't mapped, 4 --- .../deobfuscators/rename/AnnotationMapper.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/runelite/deob/deobfuscators/rename/AnnotationMapper.java b/src/main/java/net/runelite/deob/deobfuscators/rename/AnnotationMapper.java index 8a8f3e7189..cb4b26e7b7 100644 --- a/src/main/java/net/runelite/deob/deobfuscators/rename/AnnotationMapper.java +++ b/src/main/java/net/runelite/deob/deobfuscators/rename/AnnotationMapper.java @@ -32,10 +32,13 @@ public class AnnotationMapper for (ClassFile c : source.getClasses()) { - ClassFile other = target.findClass(c.getName()); + ClassFile other = (ClassFile) mapping.get(c); if (other == null) + { + System.out.println("Unable to map class " + c); // XXX if this has any mappings it won't be reported below. continue; + } count += run(c, other); } @@ -57,13 +60,15 @@ public class AnnotationMapper Field other = (Field) mapping.get(f); if (other == null) { - assert false; + System.out.println("UNABLE TO MAP " + f); + continue; + //assert false; } count += copyAnnotations(f.getAttributes(), other.getAttributes()); } - for (Method m : to.getMethods().getMethods()) + for (Method m : from.getMethods().getMethods()) { if (!hasCopyableAnnotation(m.getAttributes())) continue; @@ -71,7 +76,9 @@ public class AnnotationMapper Method other = (Method) mapping.get(m); if (other == null) { - assert false; + System.out.println("UNABLE TO MAP " + m); + continue; + //assert false; } count += copyAnnotations(m.getAttributes(), other.getAttributes());