Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strings are not protected when using bytecodePlugin #552

Open
4 tasks done
subframe7536 opened this issue Jul 2, 2024 · 4 comments
Open
4 tasks done

Strings are not protected when using bytecodePlugin #552

subframe7536 opened this issue Jul 2, 2024 · 4 comments

Comments

@subframe7536
Copy link

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
Copy link
Owner

alex8088 commented Jul 4, 2024

What is your source code?

@subframe7536
Copy link
Author

subframe7536 commented Jul 4, 2024

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
Copy link
Author

Did some research and successfully obfuscate the string. see in subframe7536/electron-incremental-update@961893d

@staristic
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants