javascript-obfuscator / javascript-obfuscator/webpack-obfuscator
using electron outside of /main.js
- Dominant language
- TypeScript
- Stars
- 928
- Forks
- 92
- PR merge metrics
- No merged PRs in 30d
Description
Currently obfuscating my electron app using webpack-obfuscator - my config file is as follows:
**// webpack.config.js
'use strict';
const nodeExternals = require('webpack-node-externals');
const path = require('path'),
Obfuscate = require('webpack-obfuscator');
// const ObfuscateOption = require('../obfuscation_config.js');
module.exports = {
entry: {
electron: './main.js',
script: './scripts/index.js',
},
output: {
path: path.resolve(__dirname, '..', 'build'),
filename: '[name].js', // output: abc.js, cde.js
},
target: 'electron-main',
plugins: [
new Obfuscate({
compact: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 0.75,
deadCodeInjection: true,
deadCodeInjectionThreshold: 0.4,
debugProtection: false,
debugProtectionInterval: false,
disableConsoleOutput: false,
identifierNamesGenerator: 'hexadecimal',
log: false,
numbersToExpressions: true,
renameGlobals: false,
rotateStringArray: true,
selfDefending: true,
shuffleStringArray: true,
simplify: true,
splitStrings: true,
splitStringsChunkLength: 10,
stringArray: true,
stringArrayEncoding: ['base64'],
stringArrayWrappersCount: 2,
stringArrayWrappersChainedCalls: true,
stringArrayWrappersType: 'variable',
stringArrayThreshold: 0.75,
/*transformObjectKeys: true,*/
unicodeEscapeSequence: false,
}),
],
externals: [nodeExternals({ modulesFromFile: true })],
};
**
however, i now need to use the electron net api in another file, not in the /build folder the obfuscation creates -
how would i go about this? thanks
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with webpack.config.js and compare the electron entry at main.js with scripts/index.js and the generated files in build. Check how the webpack-obfuscator configuration handles code that uses Electron's net API outside the bundled output. Done means documenting a supported configuration or explaining the required file placement and build behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, javascript, webpack
- Domain
- build-system, desktop
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100