Another class library with a focus on obfuscation support.
- Supports Oak classes
- Drop malformed attributes from classes added by obfuscators
- Rewrite internal jvm instructions
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'
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);
Additional items can be removed via:
// Modifies the 'cf' instance
new IllegalStrippingTransformer(cf).transform();