Menu

#176 Support for Scala pickled signatures

Some sunny day
open
scala (1)
5
2016-03-07
2016-02-17
No

The Scala compiler includes in some .class files @ScalaSignature or @ScalaLongSignature. The annotation is provided with class meta-data meant for introspection. Using the Scala introspection API that is. It's basically a marshalled binary blob provided as an attribute to the annotation.

This meta-data becomes invalid once the related class has been obfuscated. Because fields, methods and al have been renamed. Introspection with the Scala API fails as a result.

Unfortunatelty it is no solution to strip the classes from those annotations. Introspection will sometimes fail when it needed information from those annotations.

So the only solution is not to obfuscate the class. However, in a Scala application there are many of those classes. So there would be not much sense into obfuscating the application.

The other solution is to resync the pickled signatures to their new names.

Reference to the pickled signatures: http://www.scala-lang.org/old/sid/10

Discussion

  • Eric Lafortune

    Eric Lafortune - 2016-03-07

    The precise format is not documented in the referenced document, but it seems like a non-trivial task to process the signatures. It would be nice indeed, but I'm afraid this doesn't have a high priority at the moment.

     
  • Eric Lafortune

    Eric Lafortune - 2016-03-07
    • assigned_to: Eric Lafortune
     

Log in to post a comment.

MongoDB Logo MongoDB