Comments (11)
Check [email protected]
and new conditional comments feature.
from webpack-obfuscator.
@sanex3339 hm, looks like plugin works over bundles, not separate modules/files. I dont see clear way to obfuscate only some modules that would be part of final app bundels (e.x. common ng2 bundles app
, vendor
and polyfills
and obfuscated modules should be in one of main bundles, app
or vendor
)
from webpack-obfuscator.
Also you can use this webpack plugin
https://github.com/sanex3339/editable-sources-webpack-plugin
and temporary make this functional for yourself. This plugin allow you to access source code of each bundle as string (inside callback). You should extract code between comments, obfuscate it with node API of https://github.com/javascript-obfuscator/javascript-obfuscator and replace extracted code on obfuscated code.
from webpack-obfuscator.
@sanex3339 thx, used this plugin with simple callback, works fine
const JavaScriptObfuscator = require('javascript-obfuscator');
const commentStart = '\\/\\*\\* obfuscator\\: start \\*\\/';
const commentEnd = '\\/\\*\\* obfuscator\\: end \\*\\/';
const replaceRegExp = new RegExp(`${commentStart}(.|[\n\r])+?${commentEnd}`, '');
const obfuscatorOptions = {
controlFlowFlattening: true,
rotateStringArray: true,
stringArray: true,
};
function JavaScriptObfuscatorCallback(sourceCode) {
const updatedSourceCode = sourceCode.replace(replaceRegExp, (needToObfuscateCode) => {
const obfuscatedCode = JavaScriptObfuscator.obfuscate(needToObfuscateCode);
return obfuscatedCode;
});
return updatedSourceCode;
}
from webpack-obfuscator.
Hi, it is nice idea, when i will have time i do this.
But now you can check this option
https://github.com/javascript-obfuscator/webpack-obfuscator#excludes
from webpack-obfuscator.
Yes. I see only one way - add to obfuscator option to obfuscate only code inside comments:
var abc = 'abc;
/** obfuscator: start **/
// obfuscated code
/** obfuscator: end **/
But this feature will have low priority in development plans. I should finish control flow flattening first.
from webpack-obfuscator.
add to obfuscator option to obfuscate only code inside comments
yep, this looks enough. Waiting for it )
from webpack-obfuscator.
Also, controll flow flattening is feature of 0.9.0 version that under development and existing in NPM under dev
tag. Latest stable version 0.8.3 doesn't have this feature.
from webpack-obfuscator.
Using comments to determine the boundaries of obfuscation was a bad idea ) If obfuscation is used before UglifyJS2
than on minification a lot of obfuscated code unfolds. If after - comments are removed and boundaries lost.
Currently bypassed this via replacing comments marks with this dummy code console.time('obfuscator: start')
/ console.time('obfuscator: end')
and disable UglifyJS2 sequences
option 😶
from webpack-obfuscator.
@sanex3339 Thanks for the answers and the conditional comments feature.
Is there a way with the conditional comments to tell it where to start and stop obfuscating?
i.e
// other code
// javascript-obfuscator:enable-start
// code to obfuscate
// javascript-obfuscator:enable-end
// other code
from webpack-obfuscator.
@sanex3339 Is it possible to obfuscate only the service files folder in an Angular project?
Thanks
from webpack-obfuscator.
Related Issues (20)
- Is there any option that can output the filename matched by webpack-obfuscator loader in the console?
- does webpack-obfuscator support nuxtjs3 ?
- Obfuscate method names in objects/classes. HOT 1
- hashes are breaking chunk loading when using "split strings" or "medium" preset
- Compatibility with Module Federation plugin
- DOMException: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.
- Loader doesn't work, but plugin does HOT 2
- webpack-obfuscator is not generating sourcemaps HOT 4
- Is there a Vue framework use case?
- webpack-obfuscator not working on Firebase deployment HOT 1
- webpack > 5 it's not working
- Webpack version compatible
- cannot read property of undefined reading sourceAndMap
- Security.md file?
- how to obfuscate select multiple .vue file in nuxt2
- help with excluding a 10mb file from obfuscation
- Exclude files
- use webpack-obfuscator in Vue has a error when build the vue project
- Obfuscation doesn't work on ionic angular mobile iOS app
- Does it work with CSS?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webpack-obfuscator.