javascript-obfuscator / webpack-obfuscator

javascript-obfuscator plugin for Webpack
https://github.com/javascript-obfuscator/javascript-obfuscator
BSD 2-Clause "Simplified" License
853 stars 84 forks source link

Vue 3 project strange behaviors #126

Open Extarys opened 2 years ago

Extarys commented 2 years ago

I'm not quite sure how to structure this issue, so here it goes.

I created a Vue 3 project with webpack and typescript, then modified the vue.config.js file and tested some options. I'm not sure if there is a function name or a file I'm expected to exclude somehow.

Seed is 0, most of the time I get console errors, sometimes it works in different ways.

const WebpackObfuscator = require('webpack-obfuscator');
module.exports = {
    transpileDependencies: true,
    configureWebpack: {
        plugins: [
            new WebpackObfuscator({
                compact: true,
                rotateStringArray: true
            })
        ]

    }
};

Seed 9055: image

Seed 905555: image

Seed 221155 Page empty: Console error: Uncaught DOMException: Document.querySelector: 'style[data-vue-ssr-id~=\x22449b31f0:0\x22]' is not a valid selector

With more options:

            new WebpackObfuscator({
                compact: true,
                identifierNamesGenerator: 'mangled-shuffled',
                rotateStringArray: true,
                seed: 0,
                selfDefending: true,
                shuffleStringArray: true,
                simplify: true,
                stringArray: true,
                stringArrayIndexesType: [
                    'hexadecimal-number'
                ],
                stringArrayEncoding: ['base64'],
                stringArrayIndexShift: true,
                stringArrayWrappersCount: 1,
                stringArrayWrappersChainedCalls: true,
                stringArrayWrappersParametersMaxCount: 2,
                stringArrayWrappersType: 'variable',
                stringArrayThreshold: 0.75,
                target: 'browser',
            })

Console error Uncaught TypeError: can't access property "charAt", G is undefined

image

Am I missing something I should be doing ? Or is it an issue with webpack-obfuscator? Might be related to #123