我试图混淆包装到SINGEL jar中的java应用程序。该应用程序使用SWT gui库等。我已经通过-libraryjars在Proguard配置文件中正确地列出了它们,但是我仍然得到太多相同类型的警告,即: “警告:库类org.eclipse.swt.accessibility.Accessible $ 10扩展或实现程序类org.eclipse.swt.internal.ole.win32.COMObject”
这里有什么问题?
以下是我的Proguard配置的样子:
-injars 'D:\Tasks\Deployment\NEW - 30.06.2011\proguard4.6\lib\fevflex.jar'
-outjars 'D:\Tasks\Deployment\NEW - 30.06.2011\proguard4.6\lib\fevflex_out.jar'
-libraryjars 'C:\Program Files\Java\jre6\lib\rt.jar'
-libraryjars 'C:\Program Files\Java\jre6\lib\resources.jar'
-libraryjars 'C:\Program Files\Java\jre6\lib\jsse.jar'
-libraryjars 'C:\Program Files\Java\jre6\lib\jce.jar'
-libraryjars 'C:\Program Files\Java\jre6\lib\charsets.jar'
-libraryjars 'C:\Program Files\Java\jre6\lib\ext\dnsns.jar'
-libraryjars 'C:\Program Files\Java\jre6\lib\ext\localedata.jar'
-libraryjars 'C:\Program Files\Java\jre6\lib\ext\sunjce_provider.jar'
-libraryjars 'C:\Program Files\Java\jre6\lib\ext\sunmscapi.jar'
-libraryjars 'C:\Program Files\Java\jre6\lib\ext\sunpkcs11.jar'
-libraryjars 'D:\eclipse\workspace\main\Code\demo\lib\commons-collections-3.2.1.jar'
-libraryjars 'D:\eclipse\workspace\main\Code\demo\lib\commons-io-2.0.jar'
-libraryjars 'D:\eclipse\workspace\main\Code\demo\lib\mysql-connector-java-5.1.7-bin.jar'
-libraryjars 'D:\eclipse\workspace\main\Code\demo\lib\org.eclipse.core.commands_3.4.0.I20080509-2000.jar'
-libraryjars 'D:\eclipse\workspace\main\Code\demo\lib\org.eclipse.equinox.common_3.4.0.v20080421-2006.jar'
-libraryjars 'D:\eclipse\workspace\main\Code\demo\lib\org.eclipse.jface_3.4.2.M20090107-0800.jar'
-libraryjars 'D:\eclipse\workspace\main\Code\demo\lib\org.eclipse.nebula.widgets.grid-1.0.0-SNAPSHOT.jar'
-libraryjars 'D:\eclipse\workspace\main\Code\demo\lib\org.swtchart_0.6.0.v20090801.jar'
-libraryjars 'D:\eclipse\workspace\main\Code\demo\lib\swt.jar'
-libraryjars 'D:\eclipse\workspace\main\Code\demo\lib\swt_64bit.jar'
-libraryjars 'D:\eclipse\workspace\main\Code\demo\lib\swtgraphics2d.jar'
-libraryjars 'D:\eclipse\workspace\main\Code\demo\lib\testng.jar'
-libraryjars 'D:\eclipse\workspace\main\Code\demo\lib\xom-1.2.6.jar'
-libraryjars 'D:\eclipse\eclipse\morelibs\c3p0-0.9.1.1.jar'
-libraryjars 'D:\eclipse\eclipse\morelibs\jboss-common-jdbc-wrapper.jar'
-libraryjars 'D:\eclipse\eclipse\morelibs\log4j-1.2.6.jar'
-libraryjars 'D:\eclipse\eclipse\morelibs\org.eclipse.swt.win32.win32.x86_3.3.0.v3346.jar'
-libraryjars 'D:\eclipse\eclipse\morelibs\xml-apis.jar'
-libraryjars 'D:\eclipse\eclipse\plugins\org.eclipse.osgi_3.6.1.R36x_v20100806.jar'
-libraryjars 'D:\eclipse\eclipse\plugins\org.eclipse.osgi.services_3.2.100.v20100503.jar'
-libraryjars 'D:\eclipse\eclipse\morelibs\eclipseAdaptor.jar'
-libraryjars 'D:\eclipse\eclipse\morelibs\org.eclipse.osgi_3.3.0.v20070530.jar'
-libraryjars 'D:\eclipse\eclipse\morelibs\xerces-2.2.1.jar'
-libraryjars 'D:\eclipse\eclipse\plugins\org.apache.commons.logging_1.0.4.v201005080501.jar'
-dontskipnonpubliclibraryclassmembers
-dontshrink
-dontoptimize
-dontusemixedcaseclassnames
-adaptresourcefilenames **.properties
-adaptresourcefilecontents **.properties,META-INF/MANIFEST.MF
-dontpreverify
-dontnote
-ignorewarnings
-printconfiguration 'D:\Tasks\Deployment\NEW - 30.06.2011\proguard4.6\lib\FLEX.pro'
-keep public class main.FEVFlex {
public static void main(java.lang.String[]);
}
-keep class nu.** {
<fields>;
<methods>;
}
-keep class org.** {
<fields>;
<methods>;
}
-keep class com.** {
<fields>;
<methods>;
}
# Also keep - Enumerations. Keep the special static methods that are required in
# enumeration classes.
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
# Keep names - Native method names. Keep all native class/method names.
-keepclasseswithmembers,allowshrinking class * {
native <methods>;
}
答案 0 :(得分:1)
ProGuard manual > Troubleshooting > Warning: library class ... depends on program class ...
在这种情况下,您的输入jar org.eclipse.swt.internal.ole.win32.COMObject
中显示fevflex.jar
。您应该将其删除,或者至少将其作为库jar的一部分包含在内。
答案 1 :(得分:0)
我注意到你在库中包含swt.jar和swt_64bit.jar,而一次只能使用其中一个。也许这就是为什么你会收到很多警告的原因之一。