Obfuscation Netbeans

I am very new to obfuscation and do not have much experience with ant. Come on someone provide me with a way to confuse a regular Java application using ProGuard (or any other open source lens). I am currently using NetBeans 6.5.1 and only see the ability to obfuscate if I create JAVA ME and not a Java application like mine. I looked at http://wiki.netbeans.org/DevFaqModuleObfuscation but don't understand what they say.

Thanks for any input.

+3
source share
2 answers

The questions you point out are for obfuscating NetBeans modules. This is a pretty complicated precedent, so I assume that this is not an ordinary application that interests you.

In short: the obfuscation process changes the names of classes, methods, and fields to make it difficult to reverse engineer your application.

This causes some problems:

  • The JVM requires that your application have an open static void main (String args []) in the public class, so you must tell proguard not to change this name
  • If you use any kind of introspection, you need to protect the corresponding names from changes.
  • other cases as described in the manual

In addition, proguard deletes unused code. If you have any classes that are used but not specified directly, you also need -keepthem.

proguard example, . , ( ):

-injars       application.jar        # obfuscate all the classes in the named jars
-outjars      obfuscated.jar         # save all the obfuscated classes to the named jar
-libraryjars  <java.home>/lib/rt.jar # these are all the libraries that the application uses
-printmapping obfuscation.map        # save a file linking the original names to the obfuscated ones
                                     # this helps understanding stack traces from the obfuscated application

# we need to keep our main class and the application entry point
-keep public class com.mycompany.Application {
    public static void main(java.lang.String[]);
}

-dontshrink, proguard , . , , () , .

Proguard Ant, NetBeans. , Ant, . NetBeans, ( ). , . , proguard, Ant NetBeans.

+9

, -dontskipnonpubliclibraryclasses, JDK proguard, JAR .

, java -jar../proguard3.8/lib/proguard.jar

/usr/local/jdk 1.5.0/bin/java -jar../proguard3.8/lib/proguard.jar

Jacob

+2

Source: https://habr.com/ru/post/1710185/


All Articles