bb_mug a Java class obfuscator
Overview
bb_mug is a simple, tiny and fast Java class obfuscator.
This software is published under our NON COMMERCIAL LICENSE. If you plan to use any of this software in a commercial product, contact the author for conditions and permissions.
Read, understand and accept the disclaimer before download and using bb_mug.
- It is simple since there are not many options
- It is tiny because it was coded smart
- It is fast due to efficient algorithms
Download &
What does bb_mug do?
- Where applicable bb_mug replaces class, method and field names with shorter names.
- It removes all informations which are not required for execution.
- If specified, packages are renamed
This means that you MUST apply tools like a verifier to the classes created by bb_mug.
Usage of bb_mug
USAGE: java -jar bb_mug.jar [-?] [-l <logfile>] [-p <package>=<newpackage>] <inpath> <outpath>
-? display this message
-l <logfile> write mapping info into file
-p <package>=<newpackage> rename <package> to <newpackage>
bb_mug.jar $Revision: 1.6 $ (c) 2002-2011 by Stefan Bebbo Franke
- the inpath specifies where to read the classes to obfuscate
- the oupath specifies where to write the obfuscated classes to
- -l redirects the output into a logfile
- -p specifes a renamed package. This option can be used multiple times.
There are not many options since it follows the default visibility paradigm:
- public elements are not obfuscated
- protected elements are not obfuscated, since they might be visible to external derived classes
- package local and private members are always obfuscated
- specifed packages are renamed to new names.
If you believe that a public method should be obfuscated you should reconsider why it is public.
Usage from command line
My command line looks like
java -jar /tools/bb_mug.jar <inpath> <outpath>
Usage from ANT
My ANT targets look like
<target name="mug" depends="init" >
<mkdir dir="${class.final}"/>
<java classname="de.bb.mug.Main" fork="yes">
<arg value="${class.src}"/>
<arg value="${class.final}"/>
<classpath>
<pathelement path="${java.class.path}"/>
<pathelement location="tools/bb_mug.jar" />
</classpath>
</java>
</target>
Usage from BNM (or Maven)
I am using the exec-plugin to run the tool while accessing the de.bb.tools.mug artifact from the repository.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-exec-plugin</artifactId>
<dependencies>
<dependency>
<groupId>de.bb.tools</groupId>
<artifactId>mug</artifactId>
<version>1.7.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>mug</id>
<phase>compile</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<arguments>
<argument>-l</argument>
<argument>${project.build.directory}/mug.log</argument>
<argument>-p</argument>
<argument>de.bb.util=de.bb.tools.mug.u</argument>
<argument>${project.build.directory}/used</argument>
<argument>${project.build.directory}/classes</argument>
</arguments>
<includePluginDependencies>true</includePluginDependencies>
<includeProjectDependencies>false</includeProjectDependencies>
<mainClass>de.bb.tools.mug.Main</mainClass>
</configuration>
</execution>
</executions>
</plugin>
legal info
Disclaimer of Warranty
Software is provided "AS IS," without a warranty of any kind. You may use it on your own risk.
Limitation of Liability
I SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY YOU OR ANY THIRD PARTY AS A RESULT OF USING OR DISTRIBUTING SOFTWARE. IN NO EVENT WILL I BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF I HAVE ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Copyright
(c) 2002-2011 by BebboSoft, Stefan "Bebbo" Franke, all rights reserved
rev: 1.6