Git Product home page Git Product logo

Comments (16)

sanex3339 avatar sanex3339 commented on June 7, 2024

seems like it is a bug with [email protected] which will be fixed in javascript-obfuscator@beta (webpack-obfuscator intalls stable release 0.7.3).

You can try to npm i javascript-obfuscator@beta.

Anyway i very recommend to exclude all vendors and polyfills assets from obfuscation by adding following array as second plugin argument.

 new JavaScriptObfuscator ({
    rotateUnicodeArray: true
  }, ['vendor.*.js', 'polyfills.*.js']),

from webpack-obfuscator.

LanderBeeuwsaert avatar LanderBeeuwsaert commented on June 7, 2024

Thanks, however, seems after following your advice I still get an error:

main.5901d2c….bundle.js:1 Uncaught SyntaxError: Undefined label '0x39aca5'
at webpack_require (http://127.0.0.1:8080/polyfills.6aacd2a7ce9d29ab76f3.bundle.js:1:119)
at Object. (http://127.0.0.1:8080/main.5901d2ce226c3fb0c5c8.bundle.js:1:1774155)
at webpack_require (http://127.0.0.1:8080/polyfills.6aacd2a7ce9d29ab76f3.bundle.js:1:119)
at Object. (http://127.0.0.1:8080/main.5901d2ce226c3fb0c5c8.bundle.js:1:1709558)
at webpack_require (http://127.0.0.1:8080/polyfills.6aacd2a7ce9d29ab76f3.bundle.js:1:119)
at Object. (http://127.0.0.1:8080/main.5901d2ce226c3fb0c5c8.bundle.js:1:1705643)
at webpack_require (http://127.0.0.1:8080/polyfills.6aacd2a7ce9d29ab76f3.bundle.js:1:119)
at Object. (http://127.0.0.1:8080/main.5901d2ce226c3fb0c5c8.bundle.js:1:1674853)
at webpack_require (http://127.0.0.1:8080/polyfills.6aacd2a7ce9d29ab76f3.bundle.js:1:119)
at Object. (http://127.0.0.1:8080/main.5901d2ce226c3fb0c5c8.bundle.js:1:3018755)__webpack_require
_ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1__webpack_require__ @ polyfills.6aacd2a….bundle.js:1window.webpackJsonp @ polyfills.6aacd2a….bundle.js:1(anonymous function) @ main.5901d2c….bundle.js:1

When I look in node_modules/javascript-obfuscator, I got:
"_from": "javascript-obfuscator@beta",
"_id": "[email protected]",

So I suppose it installed and executed the beta...

from webpack-obfuscator.

LanderBeeuwsaert avatar LanderBeeuwsaert commented on June 7, 2024

By the way, thanks for the crazy fast replies ;-)

from webpack-obfuscator.

sanex3339 avatar sanex3339 commented on June 7, 2024

Look. Syntax for excludes bundles array (['vendor.*.js', 'polyfills.*.js']) is syntax for minimatch package: https://www.npmjs.com/package/minimatch

Value - filepath of each bundle and this filepath is combination of entry name and output.filename pattern.

So. array value should match webpack config output name for any entry. For example if your webpack.config.js looks like

{
   entry: {
        main: './resources/assets/typescript/main.ts',
        vendor: './resources/assets/typescript/vendor.ts',
        styles: './resources/assets/less/app.less'
  },
  // config
 output: {
    path: './public',
    filename: 'js/[name].[chunkhash].js'
}
}

and you want to exclude vendor and styles entries you should add following values to array:

new JavaScriptObfuscator ({
    rotateUnicodeArray: true
  }, ['**/vendor.*.js', '**/styles.*.js']),

because filepath for vendor bundle was like `js/vendor.6aacd2a.js'

so
**/ matches filename: js/[name].[chunkhash].js
vendor. matches js/[name].[chunkhash].js
* matches js/[name].[chunkhash].js
.js matches js/[name].[chunkhash].js

from webpack-obfuscator.

sanex3339 avatar sanex3339 commented on June 7, 2024

I updated my previous comment with more detailed explanation.

from webpack-obfuscator.

sanex3339 avatar sanex3339 commented on June 7, 2024

Also can you upload your project or source code of this file without obfuscation? I will look at error. It very strange, because i testing obfuscator on my angular repo https://github.com/sanex3339/laravel-5-angular-2-example and have no errors.

from webpack-obfuscator.

LanderBeeuwsaert avatar LanderBeeuwsaert commented on June 7, 2024

Seems it is indeed not working specifically for me:
if I do:

  new JavaScriptObfuscator ({
    rotateUnicodeArray: true
  }, [
    '**/vendor.*.js',
    '**/polyfills.*.js',
    '**/assets/**',
    //'**/main.*.js'
  ]),

it works.
However, if I remove the comment for main (so enable obfuscation for it), I get the error I mentioned earlier.

I'm sorry, I cannot upload the project as it is proprietary. (which is why I have to obfuscate it...)

Thanks however for all the help.

from webpack-obfuscator.

sanex3339 avatar sanex3339 commented on June 7, 2024

Show me error when you obfuscate only main.js please. Can you remove all important code from main.js bundle and left only small placeholder class and if after that error will be still exist - sent it to me? I should reproduce error.

from webpack-obfuscator.

LanderBeeuwsaert avatar LanderBeeuwsaert commented on June 7, 2024

Hey Sanex, I've sent you a mail.

greetz

from webpack-obfuscator.

sanex3339 avatar sanex3339 commented on June 7, 2024

I didn't recieve your mail

from webpack-obfuscator.

LanderBeeuwsaert avatar LanderBeeuwsaert commented on June 7, 2024

ok, I tried again, to [email protected] , changed .js to .js.txt

from webpack-obfuscator.

sanex3339 avatar sanex3339 commented on June 7, 2024

can you send this files without obfuscation?

from webpack-obfuscator.

sanex3339 avatar sanex3339 commented on June 7, 2024

Looks wrong

from webpack-obfuscator.

sanex3339 avatar sanex3339 commented on June 7, 2024

Fixed in javascript-obfuscator@beta and webpack-obfuscator@beta.

Commit: javascript-obfuscator/javascript-obfuscator@d444195

Installation npm i webpack-obfuscator@beta

webpack-obfuscator@beta - special version with javascript-obfuscator@beta dependency.
When [email protected] will be ready, you should install webpack-obfuscator@latest

from webpack-obfuscator.

LanderBeeuwsaert avatar LanderBeeuwsaert commented on June 7, 2024

Ok, cool thanks

From: Timofey Kachalov [mailto:[email protected]]
Sent: maandag 14 november 2016 19:21
To: javascript-obfuscator/webpack-obfuscator [email protected]
Cc: LanderBeeuwsaert [email protected]; State change [email protected]
Subject: Re: [javascript-obfuscator/webpack-obfuscator] angular2-webpack-starter issue? (#8)

Fixed javascript-obfuscator/javascript-obfuscator@ javascript-obfuscator/javascript-obfuscator@d444195 d444195 in javascript-obfuscator@beta and webpack-obfuscator@beta

Installation npm i webpack-obfuscator@beta

webpack-obfuscator@beta - special version with javascript-obfuscator@beta dependency.
When [email protected] mailto:[email protected] will be ready, you should install webpack-obfuscator@latest


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub #8 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/ABDCAxijhoa194YstD4EdOl79tXnhtndks5q-KaOgaJpZM4Kvnum . https://github.com/notifications/beacon/ABDCA-jARFm9LedzW0F37mGfnezRdxcAks5q-KaOgaJpZM4Kvnum.gif

from webpack-obfuscator.

sanex3339 avatar sanex3339 commented on June 7, 2024

0.8.0 is ready

from webpack-obfuscator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.