Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

how can I unpack a .app Application for Mac OS built with Electron? I want to view the source files, but I don't know how to access them.

like image 645
Redouan Azizim Avatar asked Mar 26 '20 15:03

Redouan Azizim


1 Answers

Generally, Electron apps are bundled using Electron's asar tool. 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:

npm install -g asar

Then try using asar to unpack the source:

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

I found the above information on this blog post.

like image 146
Woodrow Barlow Avatar answered Nov 08 '22 04:11

Woodrow Barlow