n0nexist / Fuscator

Simple string obfuscator for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fuscator

Use this simple tool to hide real string constants from decompilation.

Example

compile the code first
$ javac Fuscator.java

example input:
$ java Fuscator
> hello

Example output:

(new Object() {
    int t;
    public String toString() {
        byte[] buf = new byte[5];
        t = 1220204165; buf[0] = (byte) (t >>> 4);
        t = 1731395377; buf[1] = (byte) (t >>> 15);
        t = -1241489993; buf[2] = (byte) (t >>> 23);
        t = 56640078; buf[3] = (byte) (t >>> 19);
        t = 350056403; buf[4] = (byte) (t >>> 8);
        return new String(buf);
    }
}.toString())

Implement to your code

Before:

doSomethingWithSecret("hello");

After:

doSomethingWithSecret((new Object() {
    int t;
    public String toString() {
        byte[] buf = new byte[5];
        t = 1220204165; buf[0] = (byte) (t >>> 4);
        t = 1731395377; buf[1] = (byte) (t >>> 15);
        t = -1241489993; buf[2] = (byte) (t >>> 23);
        t = 56640078; buf[3] = (byte) (t >>> 19);
        t = 350056403; buf[4] = (byte) (t >>> 8);
        return new String(buf);
    }
}.toString()));

About

Simple string obfuscator for Java


Languages

Language:Java 100.0%