Short answer: Packing your app in app.asar does not hide the source. It is a tar-like archive, and the official @electron/asar tool unpacks it in one command. Keep secrets you cannot afford to lose off the client, verify a signed license in the main process at launch and again where the paid feature runs, turn on Electron's asar integrity fuses, and ship JavaScript that is harder to read on disk. Then watch public listings for a cracked or cloned copy.
app.asar is just an archive
When you package an Electron app, the JavaScript usually lands in resources/app.asar, or in Contents/Resources/app.asar on a Mac. ASAR stands for Atom Shell Archive Format. Electron's glossary describes it as a simple tar-like format that concatenates files into a single file. It does not protect source.
There is no compression and no encryption in the format. The official packer, @electron/asar, extracts it with:
npx @electron/asar extract app.asar out
That is why an asar is trivially unpacked. Current @electron/asar versions can store a SHA-256 integrity hash in the header for later verification. That hash does not encrypt the files. If your license check or business logic lives as plain JavaScript in app.asar, anyone who has the shipped app can read it.
What Electron fuses do, and what they don't
Electron fuses are bits you flip in the Electron binary after you package the app and before you code-sign it. Changing them later should fail code-signature checks on macOS (Gatekeeper) and Windows (AppLocker).
Two fuses matter for a swapped or patched archive:
-
EnableEmbeddedAsarIntegrityValidationchecksapp.asaragainst a hash embedded at package time. If the hash is missing or does not match, the app exits. Official docs list support on macOS as of Electron 16 and on Windows as of Electron 30. The fuse is off by default. -
OnlyLoadAppFromAsarchanges how Electron finds your app code. By default it looks forapp.asar, then a looseappfolder, thendefault_app.asar. With this fuse on, it looks forapp.asarand does not fall back to a loose folder. Use both fuses together, or someone can drop anappfolder next to the archive and skip the integrity check.
Flip them with @electron/fuses after packaging, then sign the app. These fuses do not hide source. Official docs do not list Linux support for asar integrity checking.
What bytecode and V8 snapshots do, and what they don't
Tools such as bytenode compile JavaScript to V8 bytecode (a .jsc file) so the original source is not in the archive. Electron can also bake JavaScript into a V8 snapshot (v8_context_snapshot.bin). Neither is encryption. Decompilers exist, and string constants often survive.
Compile bytecode with the same Electron version, CPU architecture, and process type that will load it. On Electron 42 and later (V8 14.8 and later), bytecode compiled through ELECTRON_RUN_AS_NODE can crash the main process. Compile main-process code inside an actual Electron main process, and compile renderer or preload code in a renderer context.
Bytecode and snapshots raise the effort of a casual read. They do not keep a secret safe, and they do not stop someone from patching a license check.
What obfuscation does, and what it doesn't
Obfuscation renames identifiers, strips comments, and can wrap or encrypt strings so a quick look at the file is messy. Generic default presets are often reversible with free deobfuscators. Treat obfuscation as one layer, not the whole plan. It does not make cracking or reverse engineering impossible.
Move secrets off the client
Anything you ship inside the app, in asar, in bytecode, or in a snapshot, can eventually be read. API keys with real power, license-signing private keys, and paid-content keys belong on a server you control. The app can hold a public key to verify a license. If a feature can run on the server, run it there.
What code signing and integrity checks do, and what they don't
Code signing (Developer ID and notarization on a Mac, Authenticode on Windows) tells the OS who shipped the binary and that the file has not been changed since you signed it. That is what makes a patched binary fail to launch for most customers. It does not encrypt app.asar, and it does not stop someone from reading a copy they already have. Sign after you flip fuses and after any post-package hardening.
Asar integrity answers a different question: was this archive changed after I shipped it? A mismatch can exit the app. It does not stop someone from unpacking a genuine copy and reading the JavaScript. A check that lives in JavaScript can itself be patched, unless it is backed by the fuse in the signed Electron binary.
Put the license check in the main process
The renderer is the easier place to inspect. DevTools, a modified preload, or a patched renderer script can flip a flag in the UI. Put license verification in the main process, and have the paid work refuse to run unless that check passes.
Use a license that is signed on your server and verified in the app with the matching public key, so honest customers stay unlocked offline. Check the signature and the expiry at launch, and again where the paid feature runs, rather than caching a single isLicensed() boolean. A signed license rejects a forged key. It does not stop a patch that skips the check. See How to check a license key in your Mac app offline for the same pattern.
Honest limits
A determined attacker can unpack the archive, decompile bytecode, attach to a running process, or patch the branch that unlocks the paid feature. Hardening raises attacker cost and time. It does not make cracking or reverse engineering impossible. See How to stop your Mac app from being cracked.
How Fortifie fits
Fortifie hardens the JavaScript you ship, including the JavaScript in an Electron app, so AI tools and cheap static reads have less to pull apart. This is the same self-serve JavaScript path used for other JS builds, not a separate native Electron packer. On by default:
- String and secret encryption: each value is decrypted only where it is used, with a key tied to the code path that uses it.
- Identifier renaming and comment removal.
- Decoy secrets, decoy functions, and decoy comments, aimed at automated and AI readers.
On paid plans, a hidden fingerprint shows which Fortifie account a recovered build was issued to, not which of the developer's own customers leaked it.
In our tests on two small owned JavaScript apps, five builds each, two free deobfuscators (webcrack and synchrony) recovered every text string and the embedded secret from every javascript-obfuscator default build. From every Fortifie default build they recovered the secret on none of the five seeds, and none of the function names. A one-shot AI pass also recovered nothing from Fortifie's builds (0 of 6). The Fortifie default build was about 2.8 times the size of the original file, with no measurable change in run time. A strong AI agent that writes and runs its own decoding scripts still recovered the secret in some runs, and in our tests a simple scripted patch still unlocked every protected build, Fortifie's included. These are our own small test apps, not a broad benchmark. Method and tables: How we test.
Hardening raises attacker cost and time. It does not make cracking or reverse engineering impossible.
After you ship, Fortifie searches the web, GitHub, and the App Store for listings that advertise a crack or a lookalike of your app. That is a search, not proof. Paid JavaScript builds can also carry a canary that reports when a cracked copy runs. A cracked copy can strip the canary, so silence does not mean there is no crack. You review the hardened build. Nothing ships without you.
Solo is $39/month or $390/year. Studio is $149/month or $1,490/year. Leak Finder is a $49/month add-on on Solo and is included with Studio. New monthly plans are 50% off the first month. See pricing, or run the free cracked listings check on an app you own.
Frequently asked questions
Does packing my app in asar hide the source code?
No. app.asar is a tar-like archive with no encryption. The official @electron/asar tool can extract it.
Do Electron fuses stop someone from reading my JavaScript?
No. EnableEmbeddedAsarIntegrityValidation and OnlyLoadAppFromAsar catch a swapped or patched archive on macOS and Windows. They do not encrypt the files.
Is V8 bytecode enough to protect source?
No. Bytecode and snapshots are not encryption. Decompilers exist, and strings often remain.
If I obfuscate or harden the JavaScript, will that stop cracking?
No. In our tests, a simple scripted patch still unlocked every protected build, Fortifie's included. See How we test.
How does Fortifie work with Electron?
Fortifie hardens the JavaScript inside your Electron app on the same self-serve JavaScript path. It is not a separate native Electron packer.
Top comments (0)