yWorks / yGuard

The open-source Java obfuscation tool working with Ant and Gradle by yWorks - the diagramming experts

Home Page:https://yworks.github.io/yGuard/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove Kotlin Metadata annotations

ctadlock opened this issue · comments

Kotlin adds a Metadata annotationto every class which includes the class name and all function names; mostly defeating the purpose of renaming. There in an unmeta plugin, but it would be better if it was incorporated into this one so didnt have to deal with both.

IIRC, by default yGuard already removes annotations that are not marked as runtime visible annotations. Can you please provide more information about how these annotations work (are annotated) and how they are used? Because if they don't get removed, then these should be runtime visible annotations which again would indicate that Kotlin might need them at runtime. Pointing to relevant documentation would be helpful to decide on how to proceed. Thanks

There's a comprehensive blog article from the R8 team here. The Gist is that:

  • removing the annotations breaks Kotlin support
  • the annotation references superclass names (these need to be adjusted)

To correctly support Kotlin we should therefore adjust superclass references in Kotlin annotations