Node framework for unpacking, patching, and re-packing electron applications
Packaged Electron apps store their JavaScript source code in .asar
packages
(more info). This framework will read those asar packages, output the JavaScript
source to a pre-defined directory and any changes made to those files can be used to generate patch files. Those patch
files can then be stored and applied to the source later on which can then be used to re-package the source for the
electron app.
npm i https://github.com/alexsobiek/positron
const asarPackage = path.join(__dirname, "app.asar") // Where our asar package is located
const sourceDir = path.join(__dirname, "source"); // Where we should dump contents of our asar package
const patchDir = path.join(__dirname, "patches"); // Where we should create and read patches from
const positron = new Positron(asarPackage, sourceDir, patchDir); // Create new Positron instance
positron.unpackage();
positron.makePatches();
positron.applyPatches();
positron.package();
If you are unpacking and patching a closed-source application, it is very likely you are breaking a license or agreement. Publishing modified applications or patch files are typically prohibited. The purpose of this project is for proof of concept and to create local modifications of electron apps. Developers of this project are not responsible should our software lead you to violate an agreement or license.