https://github.com/col-e/cafed00d
Obfuscation resilent Java class reader/writer
https://github.com/col-e/cafed00d
Last synced: 9 months ago
JSON representation
Obfuscation resilent Java class reader/writer
- Host: GitHub
- URL: https://github.com/col-e/cafed00d
- Owner: Col-E
- License: mit
- Created: 2020-07-22T23:31:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-02T07:50:51.000Z (11 months ago)
- Last Synced: 2025-03-29T04:09:04.080Z (10 months ago)
- Language: Java
- Homepage:
- Size: 1.63 MB
- Stars: 125
- Watchers: 6
- Forks: 14
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CAFEDOOD [](https://jitpack.io/#Col-E/CAFED00D) 
Another class library with a focus on obfuscation support.
## Features
* Supports [Oak](https://en.wikipedia.org/wiki/Oak_(programming_language)) classes
* Drop malformed attributes from classes added by obfuscators
* Rewrite [internal jvm instructions](https://github.com/openjdk/jdk/blob/769f14db847813f5a3601e9ec21e6cadbd99ee96/src/hotspot/share/interpreter/bytecodes.cpp#L491)
## Usage
### Add dependency
Add CafeDude dependency _(where `VERSION` is the latest version)_
```xml
software.coley
cafedude-core
VERSION
```
```groovy
implementation 'software.coley:cafedude-core:VERSION'
```
### Reading and writing classes
The default settings have anti-obfuscation measures enabled.
```java
// 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:
```java
// Modifies the 'cf' instance
new IllegalStrippingTransformer(cf).transform();
```