我的proguard配置文件是这样的。
-injars E:\Workspace\Git\Sample/lib/AltifeatUI.jar
-outjars E:\Workspace\Git\Sample\lib/Feat.jar
-libraryjars C:/Program Files/Java/jre7/lib/rt.jar
-libraryjars E:\git\space-feat\src\AltiFEATUI/lib/jfxrt.jar
-libraryjars C:/Program Files/Java/jdk1.7.0_67/lib/ant-javafx.jar
-optimizationpasses 5
-allowaccessmodification
-dontpreverify
-ignorewarnings
-dontshrink
-dontoptimize
-verbose
-flattenpackagehierarchy ''
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod
-adaptresourcefilecontents **.fxml,**.properties,META-INF/MANIFEST.MF,images/*.jar,.version
-adaptclassstrings
-adaptresourcefilenames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-keepnames class com.google.gson.** {*;}
-keepclassmembernames class * {
@javafx.fxml.FXML *;
}
-keepclasseswithmembers public class com.javafx.main.Main, com.altifeat.Main {
public static *;
}
-keep public class com.altifeat.Main {
public static void main(java.lang.String[]);
}
-keep class com.google.** { *; }
-keep class com.sun.** { *; }
-keep class javafx.** { *; }
-keep class netscape.javascript.** { *; }
-keep class test.** { *; }
-keep class org.** { *; }
-keep class np.** { *; }
当我执行混淆的jar时,某些功能无法正常工作。我发现这是因为在我的代码中使用了gson.fromJson()方法。我尝试在此之前和之后添加记录器语句。之前的那个是打印而不是之后。我没有对GSON jar中的任何类进行模糊处理。请帮忙。