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

('Unrecognized bootstrap method: scala/runtime/LambdaDeserialize#bootstrap(...)') occured during the remapping

magicbyte-fe opened this issue · comments

Hi, trying to obfuscate scala app, here is my gradle snippet:

rename(mainclass: 'org.SearchAgentServer', logfile: "${buildDir}/yguard.log.xml") {
                keep {
                    'package' {
                        patternset {
                            include(name: "scala.*")
                            include(name: "org.*")
                        }
                    }
                }
                property(name: "error-checking", value: "pedantic")
            }

the idea is to obfuscate only app classes and do nothing with the rest.
I get exception. Why does yGuard tries to do smth with class from scala package? It's marked as 'keep"

Caused by: : yGuard encountered an IO problem!
        at com.yworks.yguard.ObfuscatorTask.execute(ObfuscatorTask.java:1093)
        at com.yworks.yguard.YGuardTask.execute(YGuardTask.java:118)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
        at org.gradle.api.internal.project.ant.BasicAntBuilder.nodeCompleted(BasicAntBuilder.java:80)
        at org.gradle.api.internal.project.ant.BasicAntBuilder.doInvokeMethod(BasicAntBuilder.java:107)

Caused by: java.io.IOException: An error ('Unrecognized bootstrap method: scala/runtime/LambdaDeserialize#bootstrap(...)') occured during the remapping! See the log!)
        at com.yworks.yguard.obf.GuardDB.remapTo(GuardDB.java:547)
        at com.yworks.yguard.ObfuscatorTask.execute(ObfuscatorTask.java:1064)


Hey @serega-upgini this issue happens because you are trying to remap a invokedynamic structure that is not included in the JRE. This is most likely caused because Scala includes such instructions. Please see our documentation on how invokedynamic is handled in yGuard. Currently Scala features are not supported, because we do not have someone with in-depth Scala experience in our team. If you would like to contribute Scala support, please let us know (we might also implement it for your corporation if you can cover development costs).

Hi @Fohlen , thanks for your response. We need to think about your proposals. For now Im' a bit puzzled. Config excludes all scala and org classes. Why does yGuard still try to do smth with scala classes?

Thanks for your explanation.