alex8088 / electron-vite

Next generation Electron build tooling based on Vite 新一代 Electron 开发构建工具,支持源代码保护
https://electron-vite.org
MIT License
2.96k stars 132 forks source link

Strings are not protected when using `bytecodePlugin` #552

Open subframe7536 opened 1 week ago

subframe7536 commented 1 week ago

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

image

Electron-Vite Version

2.3.0

Electron Version

28.2.10

Vite Version

5.3.1

Validations

alex8088 commented 1 week ago

What is your source code?

subframe7536 commented 1 week ago

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

subframe7536 commented 1 week ago

Did some research and successfully obfuscate the string. see in https://github.com/subframe7536/electron-incremental-update/commit/961893d4232f0313d4c1c639aa133b53c099e388