在电子应用程序中隐藏构建可执行文件的源代码

Hide source code from build executable in electron-app

我正在尝试打包和分发我用 electron 编写的应用程序。我注意到当二进制文件构建完成时,本地 resource/source 代码也暴露在最终构建的文件夹中。

在 resource/app 文件夹中,您会将所有源代码公开给任何可以访问的人。

我想知道是否有办法隐藏这些信息,只提供构建的二进制文件。

我正在使用 Electron 1.2 和 electron-packager 7.0.4

除了 mini-/uglifying 您的 js 代码(仍然可以查看)和创建 .asar 包(可以提取)之外,您无法做很多事情来防止代码的可见性。

另请参阅 electron-packager github 页面上的 this post

theres nothing built in to electron to do that, so we don't support anything like that (since we only support what electron supports). you would have to implement that in your own module and run it on your code before using electron-packager -maxogden