Vin*_*vin 5 java eclipse obfuscation jar proguard
我有一个引用库的项目(即 Apache POI)。因此,在 Eclipse 中,项目属性 -> Java 构建路径 -> 添加外部 JAR,我从库中包含了 4 个 jar(poi、poi-ooxml、poi-ooxml-schemas、xmlbeans)
当我构建 jar 时,我选择了 File -> Export,Runnable JAR 文件,将所需的库提取到生成的 JAR 中。我已经验证这个未混淆的 jar 工作正常。
在 Proguard GUI 中,我添加了输入文件(Eclipse 生成的 JAR)和输出文件,我希望在其中保存输出。
由于它是一个 javaFX 项目并使用 javax.crypto 库,因此我也必须在 Proguard 中手动添加库 jar:jfxrt.jar 和 jce.jar。这可能是问题所在。也许我还需要从 Apache POI 库中添加 jars?但是这样做给了我“库类的重复定义......”警告,并没有解决无法找到引用的类警告。
我尝试忽略警告,但混淆的 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
Run Code Online (Sandbox Code Playgroud)
什么是以及如何解决这个问题以便我可以混淆我的 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.
Run Code Online (Sandbox Code Playgroud)