简体   繁体   English

如何从已编译的 Electron 应用程序中获取源文件?

[英]How can I get source files from a compiled Electron application?

how can I unpack a .app Application for Mac OS built with Electron?我怎样才能解压一个用 Electron 构建的 Mac OS 的 .app 应用程序? I want to view the source files, but I don't know how to access them.我想查看源文件,但我不知道如何访问它们。

Generally, Electron apps are bundled using Electron's asar tool.通常,使用 Electron 的asar工具捆绑 Electron 应用程序。 Usually, you can unpack the source for these apps using the same tool.通常,您可以使用相同的工具解压缩这些应用程序的源代码。

If the app was bundled using a different tool, you will need to do your own research into whether the bundling process can be trivially reversed.如果应用程序是使用不同的工具捆绑的,您需要自己研究捆绑过程是否可以简单地逆转。

If you don't have asar installed, you can install it via npm :如果你没有安装asar ,你可以通过npm安装它:

npm install -g asar

Then try using asar to unpack the source:然后尝试使用asar解压源:

cd /Applications/Slack.app/Contents/Resources
mkdir example-sourcecode
asar extract app.asar example-sourcecode

I found the above information on this blog post .我在这篇博文中找到了上述信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何获得已编译的车把模板的来源? - How can I get the source of a compiled handlebars template? Gulp中如何排除从Typescript编译的javascript文件? - How can I in Gulp exclude javascript files compiled from Typescript? 如何从 Typescript 编译中排除某些文件? - How can I exclude certain files from being compiled in Typescript? Electron:如何从 BrowserWindow 获取 Screen? - Electron: How can I get Screen from BrowserWindow? 如何从电子中的新BrowserWindow()获取窗口对象? - How can I get a window object from new BrowserWindow() in electron? 我如何打开Chrome并通过节点/电子应用程序执行Google图片搜索 - How can I open chrome and do a google image search from a node/electron application 如何在 electron 应用程序中显示网络摄像头视频源? - How can I show webcam video feed inside an electron application? 如何使用电子循环浏览文件夹和子文件夹中的文件? - how can I loop through files in a folder and subfolders using electron? 如何在我的角度应用程序中获取clientID和重定向URI以从onedrive访问文件 - How can I get the clientID and redirect URI to access files from onedrive in my angular application 如何从主要过程代码中获取Electron stdout内容? - How can I get Electron stdout content from within my main process code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM