Skip to content

Instantly share code, notes, and snippets.

@Gabboxl
Created August 20, 2023 20:37
Show Gist options
  • Save Gabboxl/33f029e3e8ef33e53aa6d8f9c17f605f to your computer and use it in GitHub Desktop.
Save Gabboxl/33f029e3e8ef33e53aa6d8f9c17f605f to your computer and use it in GitHub Desktop.
How to decompile an Electron app

Let me tell you how easy it is to decompile an Electron app (that's closed source).

Prerequisites

Decompilation

First of all, you find the install path of your Electron app. If you found it, find the resources folder. If you found it, you'll have to install asar globally, by running:

npm install -g @electron/asar

Then, you can decompile the app by running:

asar extract app.asar app

It is recommended to copy the app.asar file to your user/home directory to not get tired of it having to ask you for permissions. (if it's stored in the root directory, this is for Linux users only.)

cd into the app source:

cd app

Electron isn't installed by default. You can install it by running:

npm install --save-dev electron

You may run the app in development mode by running:

npx electron .

Or, you may add a start script in the package.json file:

{
...
  "devDependencies": {
    "electron": "^22.0.0"
  },
  "scripts": {
    "start": "electron ."
  }
...
}

and run npm run start to run the app.

If you'd want to compile, you can install electron-builder:

npm install --save-dev electron-builder

Then, you can run:

npx electron-builder

This will compile for the current OS you're running. You can also specify the OS and architecture:

npx electron-builder --platform=darwin --arch=x64

like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment