Skip to content

v0.2.2

Latest

Choose a tag to compare

@Anthony-Bondu Anthony-Bondu released this 17 Aug 20:06
2c6c595

Reconstructs ESM module imports on modern Metro bundles and fixes closure and declaration correctness, on top of v0.2.1.

What's new

  • ESM import reconstruction: a dependency required from many functions is no longer emitted as the same import X from "M" line dozens of times, and distinct named imports of one module merge into a single import { a, b } from "M". Each import carries the module id as a comment (import { sendRequest, healthcheck } from "HTTPUtils" /* 530 */) so a module can be remapped to a real path by its stable id. Eager inline module loads (importDefault(530).foo(), require(4137).bar()) repeated at every use site are hoisted into one module level binding, while React Native lazy getters (get: () => require(N).default) are left lazy so lazy loading is preserved.
  • Closure and declaration correctness: a captured environment slot is now written and read with the same identifier, so a counter increment no longer read closure_1_0 while writing outer1_0. A nested function again declares its own local (let obj) instead of leaving it undeclared or reassigning a parent const when the name happens to match an ancestor local, which restores tens of thousands of declarations on a large bundle.
  • Performance: the whole bundle decompile stays around 90 seconds. The ancestor environment slot map is now precomputed once instead of being rebuilt per function, which had made the output phase quadratic on a 130k function bundle.
  • Internals: the pipeline context and the closure resolution and hoisting passes are split into focused modules, and object literals filled incrementally (o[0] = x) collapse to a single literal.

Everything from v0.2.1 is included: the bytecode write path, the analyst tooling (dump tables, disasm --info, callgraph, MCP tools), HBC98 async and generator reconstruction, the self update command, and Metro and ESM module reconstruction.

Downloads

Each archive contains the hermes-decomp and hermes-mcp binaries. Verify with shasum -a 256 -c SHA256SUMS.

File SHA256
hermes-decomp-v0.2.2-linux-x86_64.tar.gz ffbe444bc6a9dd260f1d96d26ce5ee1c943103dac96aa99b8a053438e3e3fc9e
hermes-decomp-v0.2.2-macos-arm64.tar.gz abd9ed574b51a319e01c3510b496b759e08c7a7bb358c2f8ac8e38cb8f6aad47
hermes-decomp-v0.2.2-windows-x86_64.zip b341a0e660a75b19a46b8ee21ff056568b3659d8a3a564186bfc6fe71811ca6b