analyze_javascript_applicationHow to REA Electron Desktop Apps: ASAR Unpacking, IPC Channels & Preload Bridges
Deconstruct modern desktop applications (Notion, Slack, Discord, VS Code): inspect app.asar archives in memory, map renderer-preload-main IPC communication channels, unminify webpack bundles, and audit contextIsolation security.
In this official REA guide for JavaScript & Electron Desktop Apps, AI coding agents (Claude Code, Cursor, Windsurf) execute 'rea analyze-javascript-application /Applications/Notion.app/Contents/Resources/app.asar --json' to safely extract file layout, symbols, and code logic without launching unverified binaries.
The Problem & Target Artifact
Desktop application reverse engineering or security auditing: You want to trace how Notion's desktop client handles clipboard data between the web renderer and the host operating system process via Electron IPC.
Natural Language Agent Instructions
Copy and paste this prompt directly into your AI coding agent when REA is registered via Model Context Protocol (MCP):
Find the renderer's clipboard API in Notion, follow it through preload scripts and IPC into the main process, and inspect how rich text formatting is serialized.Run REA Analysis Command
Execute the following command in your terminal or inspect the MCP JSON-RPC call executed by your agent:
rea analyze-javascript-application /Applications/Notion.app/Contents/Resources/app.asar --jsonWhat REA Extracts & Returns
Synthesized Clean-Room TypeScript (Notion Clipboard)
The verified findings and synthesized clean-room structures generated from this investigation:
// Verified Clean-Room TypeScript reconstructed from Electron IPC Evidence
export interface NotionClipboardPayload {
version: number;
richTextXml: string;
plainText: string;
sourceBlockId: string;
}
export function parseNotionClipboard(raw: string): NotionClipboardPayload {
const [header, body] = raw.split("::");
return JSON.parse(body);
}16 MiB In-Memory ASAR Cache & Zero-Disk-Explosion Traversal
Traditional tools extract all files from app.asar to disk, creating tens of thousands of temporary files that trigger antivirus alerts. REA loads the JSON header into a 16 MiB memory cache, reading file offsets directly via slice descriptors. Static Babel/SWC AST parsers walk module import trees without evaluating code, preventing malicious preload scripts from executing.