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

Exposed class is still being obfuscated

opened this issue · comments

The problem:

I was able to obfuscate my API, but the obfuscated version is not working since my MainClass is also obfuscated.
Even after exposing my MainClass it´s still being obfuscated, am I doing something wrong, or is it bug?

My configuration:

I´m using Maven with the yguard plugin (In the latest version 4.0.0) to obfuscate. This is my configuration pom.xlm file.

<yguard>
  <inoutpair in="${project.build.directory}/${project.build.finalName}.jar" out="${project.build.directory}/${project.build.finalName}-obfuscated.jar" />
  <rename mainclass="com.company.Api.MainClass">
    <keep></keep>
  </rename>
</yguard>

I´m using the mainclass attribute inside the rename element which, as documentation says, should detect the MainClass used as input and avoid obfuscating it.

Here are the logs after obfuscating.

<expose>
  <class name="com.company.Api.MainClass"/>
  <method class="com.company.Api.MainClass" name="void main(java.lang.String[])"/>
</expose>

As you can see, the MainClass is marked as exposed, but it´s still being obfuscated.

I don´t know if this should be marked as a bug, or if I´m not understanding the documentation.
Any help or guidance is apreciated.

While I cannot find any errors in your configuration snippet, I am very sure that the mainclass attribute of the <rename> element works as intended. (I double-checked with the application example in the yguard 4.0.0 bundle.)

I think you need to provide a short, self-contained example that lets us reproduce your problem. Otherwise, I don't think it is possible to find a solution to your problem. Additionally, it would be great if you could provide some additional information:

  • On which operating system are you using yGuard?
  • Which distribution (vendor and version) of Java are you using?
  • Which version of Maven are you using?