我对Proguard遇到一些麻烦,我想混淆我的Java程序,但是当方法带有注释时,我需要具有唯一的方法名称,但是当方法具有不同的参数时,Proguard不会提供唯一的名称
我之前说过的话
Proguard配置
-obfuscationdictionary ./dictionary
-classobfuscationdictionary ./dictionary
-packageobfuscationdictionary ./dictionary
-dontshrink
-dontoptimize
-dontusemixedcaseclassnames
-useuniqueclassmembernames
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod
-dontwarn
-ignorewarnings
# 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);
}
# Also keep - Database drivers. Keep all implementations of java.sql.Driver.
-keep class * extends java.sql.Driver
# Also keep - Swing UI L&F. Keep all extensions of javax.swing.plaf.ComponentUI,
# along with the special 'createUI' method.
-keep class * extends javax.swing.plaf.ComponentUI {
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent);
}
# Keep - Native method names. Keep all native class/method names.
-keepclasseswithmembers,includedescriptorclasses,allowshrinking class * {
native <methods>;
}
所以我希望你能帮助我。
答案 0 :(得分:0)
它的工作原理如下:
-keep,allowobfuscation @interface org.springframework.messaging.simp.annotation.SubscribeEvent
-keepclassmembers class * {
@org.springframework.messaging.simp.annotation.SubscribeEvent *;
}