How do I use ProGuard?

前端 未结 3 1177
再見小時候
再見小時候 2021-01-12 13:28

I was trying to learn how to use ProGuard, and it is no way as easy as I thought. At first I found a simple Java code to try it, a simple two class Swing calculator.

3条回答
  •  旧时难觅i
    2021-01-12 14:02

    I got it to work using the following configuration file:

    -injars       calc.jar
    -outjars      calc_obf.jar
    -libraryjars  /lib/rt.jar
    -keep class Calc {
      public static void main(java.lang.String[]);
    }
    

    Most notably, I ditched the public in front of class Calc.

提交回复
热议问题