Skip to content

Col-E/CAFED00D

Repository files navigation

CAFEDOOD

Another class library with a focus on obfuscation support.

Features

Usage

Add dependency

Add CafeDude dependency (where VERSION is the latest version)

<dependency>
    <groupId>software.coley</groupId>
    <artifactId>cafedude-core</artifactId>
    <version>VERSION</version>
</dependency>
implementation 'software.coley:cafedude-core:VERSION'

Reading and writing classes

The default settings have anti-obfuscation measures enabled.

// Reading
byte[] code = ...
ClassFileReader cr = new ClassFileReader();
// cr.setDropForwardVersioned(false) - enabled by default
// cr.setDropEofAttributes(false) - enabled by default
// cr.setDropDupeAnnotations(false) - enabled by default
ClassFile cf = cr.read(code);
// Writing
code = new ClassFileWriter().write(cf);

Stripping malformed attributes and data from classes

Additional items can be removed via:

// Modifies the 'cf' instance
new IllegalStrippingTransformer(cf).transform();