我有一个引用库的项目(Apache POI)。所以在Eclipse中,Project Properties - > Java构建路径 - >添加外部JAR,我从库中包含4个罐子(poi,poi-ooxml,poi-ooxml-schemas,xmlbeans)
当我制作我的jar时,我选择了File - >导出,可运行的JAR文件,将所需的库提取到生成的JAR中。我已经证实这个未经过模糊处理的jar工作正常。
在Proguard GUI中,我添加了输入文件(Eclipse生成的JAR)和输出文件,我希望保存输出。
由于它是一个javaFX项目并使用javax.crypto库,我还必须手动在Proguard中添加库jar:jfxrt.jar和jce.jar。这可能是问题所在。也许我需要从Apache POI库中添加jar?但这样做会让我对库类的重复定义...'警告并且无法解决无法找到引用的类警告。
我已经尝试忽略警告,但混淆的JAR不起作用。
确实有很多警告,但这里是前五个:
Note: org.apache.xmlbeans.impl.jam.internal.reflect.ReflectClassBuilder calls 'Field.getType'
Warning: org.apache.xmlbeans.impl.jam.internal.javadoc.JavadocRunner: can't find superclass or interface com.sun.javadoc.Doclet
Warning: org.apache.xmlbeans.impl.tool.XMLBean: can't find superclass or interface org.apache.tools.ant.taskdefs.MatchingTask
Warning: com.microsoft.schemas.office.excel.CTClientData: can't find referenced class com.microsoft.schemas.office.excel.STCF
Warning: com.microsoft.schemas.office.excel.CTClientData: can't find referenced class com.microsoft.schemas.office.excel.STCF
是什么以及如何解决这个问题,以便我可以混淆我的JAR?
编辑:
以下是Proguard处理控制台的最后一行:
Maybe this is program field 'org.openxmlformats.schemas.wordprocessingml.x2006.main.STThemeColor$Enum { org.apache.xmlbeans.StringEnumAbstractBase$Table table; }'
Maybe this is program field 'org.openxmlformats.schemas.wordprocessingml.x2006.main.STUnderline$Enum { org.apache.xmlbeans.StringEnumAbstractBase$Table table; }'
Maybe this is program field 'org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalAlignRun$Enum { org.apache.xmlbeans.StringEnumAbstractBase$Table table; }'
Maybe this is program field 'org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalJc$Enum { org.apache.xmlbeans.StringEnumAbstractBase$Table table; }'
Maybe this is program field 'org.openxmlformats.schemas.wordprocessingml.x2006.main.STZoom$Enum { org.apache.xmlbeans.StringEnumAbstractBase$Table table; }'
Maybe this is program field 'org.openxmlformats.schemas.xpackage.x2006.relationships.STTargetMode$Enum { org.apache.xmlbeans.StringEnumAbstractBase$Table table; }'
Maybe this is library field 'com.sun.xml.internal.fastinfoset.alphabet.BuiltInRestrictedAlphabets { char[][] table; }'
Maybe this is library field 'javax.swing.plaf.basic.BasicTableUI { javax.swing.JTable table; }'
Maybe this is library field 'javax.swing.table.JTableHeader { javax.swing.JTable table; }'
Note: org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl accesses a field 'typeSystem' dynamically
Maybe this is program field 'schemaorg_apache_xmlbeans.system.s0B482D0B338CC9641C1543C3510577FE.TypeSystemHolder { org.apache.xmlbeans.SchemaTypeSystem typeSystem; }'
Maybe this is program field 'schemaorg_apache_xmlbeans.system.sF1327CCA741569E70F9CA8C9AF9B44B2.TypeSystemHolder { org.apache.xmlbeans.SchemaTypeSystem typeSystem; }'
Maybe this is program field 'schemaorg_apache_xmlbeans.system.sXMLCONFIG.TypeSystemHolder { org.apache.xmlbeans.SchemaTypeSystem typeSystem; }'
Maybe this is program field 'schemaorg_apache_xmlbeans.system.sXMLLANG.TypeSystemHolder { org.apache.xmlbeans.SchemaTypeSystem typeSystem; }'
Maybe this is program field 'schemaorg_apache_xmlbeans.system.sXMLSCHEMA.TypeSystemHolder { org.apache.xmlbeans.SchemaTypeSystem typeSystem; }'
Maybe this is program field 'schemaorg_apache_xmlbeans.system.sXMLTOOLS.TypeSystemHolder { org.apache.xmlbeans.SchemaTypeSystem typeSystem; }'
Note: there were 1 classes trying to access generic signatures using reflection.
You should consider keeping the signature attributes
(using '-keepattributes Signature').
(http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)
Note: there were 14 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 2 class casts of dynamically created class instances.
You might consider explicitly keeping the mentioned classes and/or
their implementations (using '-keep').
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclasscast)
Note: there were 12 accesses to class members by means of introspection.
You should consider explicitly keeping the mentioned class members
(using '-keep' or '-keepclassmembers').
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember)
Warning: there were 13088 unresolved references to classes or interfaces.
You may need to add missing library jars or update their versions.
If your code works fine without the missing classes, you can suppress
the warnings with '-dontwarn' options.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning: there were 7 unresolved references to program class members.
Your input classes appear to be inconsistent.
You may need to recompile the code.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)
Please correct the above warnings first.