简体   繁体   中英

Proguard not working in java application

I created two simple java class files and converted in to jar file.

Setup config.pro file

-injars /home/XXXX/lib/XXXX.jar
-outjars /home/XXXX/lib/XXXX-out.jar
-printmapping proguard.map
-libraryjars /usr/lib/jvm/jdk1.7.0_79/jre/lib/rt.jar
-verbose
-keep public class com.XXXX.main.Main

When I run the proguard code using these command

sudo java -jar proguard.jar @config.pro

-keep option file only showing in output jar file. That one also not working. I am newbie to proguard and doing anything wrong ? help me out

Map file output

com.XXXX.main.Main -> com.XXXX.main.Main:
    void <init>() -> <init>

In your configuration you only instruct ProGuard to keep your main class, not including any methods that might need to be kept as well.

For a working sample, you need to extend this to the following:

-keep public class com.XXXX.main.Main {
    public static void main(java.lang.String[]);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM