Swing Problems Resulting from yGuard's Obfuscation Levels
Applies to: yGuard 1.5, 1.3 print article email article

Type: Troubleshooting

Categories this article belongs to:
yGuard

Using yGuard's highest level of obfuscation can lead to problems with Java Swing.

The yGuard obfuscation process can be invoked with different settings for the 'naming-scheme' property. Using 'best', i.e., yGuard's highest level of name obfuscation, as the value for this property can generate very long names. In some cases, e.g., when such a long name replaces the name of a JFrame descendant, Java Swing crashes.

To avoid this problem, you can use yGuard's mapping feature to exclude certain classes from the obfuscation process, and give them predefined names instead.

 xmlns:xalan="http://xml.apache.org/xslt"><map>
  <class name="com.yourcompany.yourapp.yourpackage.YourFrame" map="SillyNewNameForYourFrame"/>
</map>

Note that the package names might have to be fixed, too.

<package name="com" map="com"/>
<package name="com.yourcompany" map="mycompany"/>
<package name="com.yourcompany.yourapplication" map="myapplication"/>
<package name="com.yourcompany.yourapplication.yourpackage" map="dont/look/into/this/package"/>

Keywords: Swing - JFrame - obfuscation - level

Provide feedback:
How useful was this article?    less 1 2 3 4 5 more
Email address (optional):
COPYRIGHT © 2012 yWorks · ALL RIGHTS RESERVED imprint | terms of use | privacy policy | home