javascript-obfuscator / javascript-obfuscator

A powerful obfuscator for JavaScript and Node.js
https://obfuscator.io
BSD 2-Clause "Simplified" License
13.51k stars 1.48k forks source link

CLI option --options-preset <string> does nothing. #1221

Open DeivAstra opened 9 months ago

DeivAstra commented 9 months ago

--options-preset [default, low-obfuscation, medium-obfuscation, high-obfuscation]

Expected Behavior

When I changes the option to different values the obfuscation result data size must grow.

Current Behavior

When I changes the option to different values the obfuscation result is remains the same.

Steps to Reproduce

#!/bin/bash

proj_home=/home/user/project

in_dir=$proj_home/obf-in
out_dir=$proj_home/obf-out

function compile {
    javascript-obfuscator \
        --options-preset high-obfuscation \
        --target browser-no-eval \
        --compact true \
        $in_dir --output $out_dir
}

rm -rf $out_dir
mkdir -p $out_dir

compile

Your Environment

Alpine Linux 3.18.5

Log

[javascript-obfuscator-cli] Obfuscating file: /home/user/obf-in/test.js...

Minimal working example that will help to reproduce issue

Any js file, but for test I used:

class A {
    foo;
    bar = 1;
    #p = 'Private';
    static test() {
        foo.a = 5;
    }
}

Obfuscated files attached! obf-bug-test.zip

shpuryk commented 7 months ago

observe the same issue

chanchangame commented 7 months ago

Same problem when I installed this library in Windows using npm.