Amrmsmb
Amrmsmb

Reputation: 1

how to obfuscate using proGuard

I created a class FMSHandler and i exported it as a runnable jar named FMSCtrl_02.jar and the project has no main method, and there is a method inside the FMSHandler class called process(String fms). In the lib directory of the proGuard I created a myconfig.pro file containing the following:

-injars       FMSCtrl_02.jar
-outjars      FMSCtrl_02_out.jar
-libraryjars  <java.home>/lib/rt.jar
-printmapping FMSCtrl_02.map

-keep public class com.example.FMSHandler {

}

now when I imported the FMSCtrl_02_out.jar in another project, I found that method process(String fms) is not accessible!

How to obfuscate the code correctly?

Upvotes: 1

Views: 344

Answers (1)

Alexander Bollaert
Alexander Bollaert

Reputation: 804

You should also specify the method you want to keep (with the correct signature).

-keep public class com.example.FMSHandler {
    public void process(java.lang.String);
}

Upvotes: 1

Related Questions