electron-bytenode-example icon indicating copy to clipboard operation
electron-bytenode-example copied to clipboard

about source test

Open PlayNprovide opened this issue 1 year ago • 4 comments

I gave it a try before I use your webpack plugin

I modified nothing on the example just clone and package It's executed without a problem but after I packaged opened index.compiled.jsc I could still see the text "If this text appears in your packaged app, it means Bytenode is NOT configured correctly! #SOURCE-TEST"

0

is it normal to see this text or am I supposed to do something?

love the library btw

PlayNprovide avatar Jan 19 '24 08:01 PlayNprovide

@PlayNprovide did you ever get an answer to your question?

I did see this note on electron-vite mentioning about bytenode not solving string protection. https://evite.netlify.app/guide/source-code-protection#enable-bytecode-to-protect-your-electron-source-code

fras2560 avatar Mar 13 '24 15:03 fras2560

@fras2560 no I didn't get any anwer yet and yeah I guess it does not protect string but they are saying "If this text appears in your packaged app, it means Bytenode is NOT configured correctly! #SOURCE-TEST" so I just wanted to check that It's normal to show string in raw

PlayNprovide avatar Mar 14 '24 01:03 PlayNprovide

@PlayNprovide I do get the same behavior as you describe. So I am glad you asked the question.

One work around I found in the meantime would be to do something like this:

export const SOURCE_TEST = "***SECRET-BACKEND-TEXT***";
// would be become
export const SOURCE_TEST = String.fromCharCode(42,42,42,83,69,67,82,69,84,45,66,65,67,75,69,78,68,45,84,69,88,84,42,42,42);

fras2560 avatar Mar 14 '24 12:03 fras2560

I think I may have just put that test in to see if text strings were making it through. It makes sense that they would be. Maybe a better test would be to see if the variable names are making it through compilation.

A tool like Javascript Obfuscator can be used to mask strings if necessary.

I'm open to suggestions… and pull requests… for a better solution or clearer documentation. Or maybe this should go in the Bytenode docs.

jjeff avatar Mar 14 '24 15:03 jjeff