electron-vite
electron-vite copied to clipboard
Strings are not protected when using `bytecodePlugin`
Describe the bug
Create from official template and add bytecodePlugin
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin(), bytecodePlugin({ protectedStrings: ['pong'] })]
},
//...
})
in generated .jsc file, the pong is shown vertically
Electron-Vite Version
2.3.0
Electron Version
28.2.10
Vite Version
5.3.1
Validations
- [X] Follow the Code of Conduct.
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
What is your source code?
Just the template: https://github.com/alex8088/quick-start/blob/17aaa8c5b8f9def5dbf3f88c55ac8b17408544e2/packages/create-electron/playground/vue-ts/src/main/index.ts#L53
If string is long (like primary key), it is much easier to recognize
Did some research and successfully obfuscate the string. see in https://github.com/subframe7536/electron-incremental-update/commit/961893d4232f0313d4c1c639aa133b53c099e388
The bytecodePlugin is not work for me, too. I just add one password string into protectedStrings like this
main: { plugins: [externalizeDepsPlugin(), bytecodePlugin({ protectedStrings: [my_password] })] },
But I still found my_password string in index.jsc file easily. I've read documents and sure that build.minify is disabled.