I have an eclipse based application which uses YFiles library. I want to obfuscate YFiles & adjust obfuscated classes of YFiles libraries in my code.
I am executing this obfuscation via a Maven build triggering an ant script. My ant-script has the logic of obfuscation. This looks like--
<project name="obfuscate">
<target name="obf-modeler">
<taskdef name="yguard" classname="com.yworks.yguard.YGuardTask" classpath="./lib/yguard.jar" />
<yguard>
<inoutpair in="yfiles.jar" out="obfyfiles.jar" />
<inoutpair in="<my-app-jar>" out="<my-app-jar>" />
<rename replaceClassNameStrings="true">
<keep>
<class classes="private" methods="private" fields="private">
<patternset>
<include name="com.<my-company-name>." />
</patternset>
</class>
<package>
<patternset>
<include name="com.<my-company-name>." />
</patternset>
</package>
</keep>
<adjust replaceContent="true">
<include name="plugin.xml" />
</adjust>
</rename>
</yguard>
</target>
I am obfuscating Yfiles & my code together so that YFiles obfuscation is incorporated in my code as well. I also have a patternset on class & package elements to tell YGaurd that "don't obfuscate my code, only adjust the YFiles obfuscation changes"
Unfortunately, if I run the maven build, Some public YFiles methods with some return type are not getting obfuscated. For example -- y.base.NodeMap class has methods obfuscated which don't have a return type, other methods who return something are still having old method names.
Any clue what is going wrong in my patter-set. Also, if I remove this pattern-set, there is no issue in YFiles obfuscation. However, my code is getting obfuscated too in that case which I don't want.
Thanks & regards Abhinaw