如何解压缩.asar文件?

Vik*_*sal 73 node.js electron asar

我使用follwoing命令打包了我的电子应用程序

asar pack app app.asar
Run Code Online (Sandbox Code Playgroud)

现在,我需要解压缩并获取整个代码.反正有没有这样做?

mar*_*pie 126

来自asar文档

(npx这里的用法是避免asar全局安装工具npm install -g asar)

提取整个存档:

npx asar extract app.asar destfolder 
Run Code Online (Sandbox Code Playgroud)

提取特定文件:

npx asar extract-file app.asar main.js
Run Code Online (Sandbox Code Playgroud)

  • @FakeName - 我使用了7Zip项目中此线程中的7Zip插件:https://sourceforge.net/p/sevenzip/discussion/45797/thread/74cf1dec/允许用户在7Zip中打开任何ASAR文件. (14认同)
  • [电子文档](https://github.com/electron/electron/blob/master/docs/tutorial/application-distribution.md#packaging-your-app-into-a-file)说:"你也可以将您的应用打包到asar存档中,以避免将应用的源代码暴露给用户." 但是,如果你能打开它,那是不是真的?对?? (12认同)
  • 附注:您可以使用`npm install -g asar`安装命令. (11认同)
  • 好的,如何在不必安装整个节点开发环境的情况下解压缩asar文件*? (5认同)
  • 使用 sudo 运行时工作正常。感谢您的回答,您是我的救星:) (2认同)

Seb*_* Ax 20

使用以下7Zip插件可以在没有安装节点的情况下进行升级:http://www.tc4shell.com/en/7zip/asar/

感谢@MayaPosch提到这一点.