Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nwjs app javascript protection?

So nwjs is a neat little framework that enables node apps to run in desktop mode independent to platform. But the way I package my files is pretty raw.

I zip my node app directory into a .nw file, and I copy it to an existing nwjs app's content folder. Then this means that anyone with some knowledge of nwjs will be able to literally unzip the .nw file and dig through the app directory. WTF. Is there a way to protect my files in my nwjs app?

like image 234
user3467433 Avatar asked Aug 09 '26 17:08

user3467433


1 Answers

You can compile the javascript files with snapshot:

 nwjc source.js binary.bin

then load the compiled js in your app like this

 require('nw.gui').Window.get().evalNWBin(null, 'binary.bin');

for more info, check this out.

like image 139
ShegaMike Avatar answered Aug 12 '26 12:08

ShegaMike



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!