ClassRemapper not remapping super method calls reliably
I am trying to deobfuscate a jar file with the asm ClassRemapper. Everything is working fine for normal outer classes. But when I try to remap a method that is used in a method of an inner class, the references to this method are not remapped. I know that inner classes are not alot more than syntactic sugar and work mostly like normal classes, so I am wondering if the ClassRemapper does not handle inner classes correctly or if I am missing something.
private Map<String, ClassNode> classes;
private Map<String, byte[]> bytes;
private void applyClassMappings() {
Remapper mapper = SimpleSimpleRemapper.create(this.mappings);
this.classes.forEach(
(name, classNode) -> {
ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_MAXS);
ClassVisitor classRemapper = new ClassRemapper(classWriter, mapper);
classNode.accept(classRemapper);
this.bytes.put(
(this.mappings.containsKey(classNode.name)
? this.mappings.get(classNode.name)
: classNode.name)
+ ".class",
classWriter.toByteArray());
});
}
So this code does remap everything correctly in normal outer classes, but ignores any references to anything else in methods of inner classes. It looks like the method bodies are just not translated of inner classes.