DEV Community

VEILVM
VEILVM

Posted on

React Native and Expo still ship a JavaScript bundle you can extract from the app

A React Native or Expo app feels like a native binary. Users install it from a store, open an icon, and never see a browser tab. The business logic you wrote in JavaScript or TypeScript still ships as a bundle inside that binary — or as Hermes bytecode that tools can unpack — and an interested person can pull it out of the APK, the IPA, or an OTA update.

This article is about what actually gets packaged, why "it's a mobile app" is not protection, and how to raise the cost of copying the proprietary part.

The bundle is in the package

A conventional release contains:

  • Native shells (Android / iOS) and whatever modules you linked.
  • A JavaScript bundle (index.android.bundle, the Expo / Metro output, or an OTA payload from EAS Update or a similar channel).
  • If you use Hermes, a .hbc bytecode file instead of plain text JS — which is still a compiled form of your program, not a disappearance of it.
# conceptual Android inspection (your own build)
unzip -l app-release.apk | grep -E "index.|hbc|bundle"
# OTA updates are a second copy, often easier to fetch than the store binary
Enter fullscreen mode Exit fullscreen mode

Hermes bytecode raises the cost relative to a pretty-printed Metro bundle. It does not encrypt your algorithm. Public and commercial tooling exists to disassemble .hbc, and the strings, API paths, and structure of the program are usually recoverable. An OTA update that you ship as a plain JS bundle for speed can be an easier copy than the store binary you thought was the only artifact.

Expo and React Native Web targets make this even more direct: the same modules may also be on a public URL.

What "extract the bundle" means in practice

You do not need a jailbreak to look at your own (or a public) Android package. Anyone can download the APK, unzip it, and search it. iOS IPAs from a device you control, or from TestFlight artifacts you retained in CI, have the same property. Treat those outputs the way you would treat a web dist/ folder.

// if this function is in a module the mobile app imports,
// it is in the bundle, minified or not
export function solveOfflineLicense(deviceId, payload) {
  // proprietary client-side check — also extractable
}
Enter fullscreen mode Exit fullscreen mode

Minification and Hermes compilation will rename solveOfflineLicense. They will not remove the need for that logic to exist on the device if the feature works offline.

What belongs on a server anyway

Move off the device when you can:

  • Entitlements, receipts, and "is this user Pro" decisions.
  • Secret API keys and signing keys. A key in the bundle is a key in the APK.
  • Authoritative prices and unlocks.

Client-side checks are UX and a first filter. They are not the authority. That is the same rule as a web app; the store binary does not change it.

OTA channels need the same hygiene as web previews: do not push an unprotected debug bundle to a public update channel "just for QA," and do not leave old update IDs fetchable after you start protecting production updates.

Protect the functions that must run on the device

Some logic genuinely has to be local: an offline preview, a game rule module, a mapper that works in airplane mode. For those:

  1. Keep the server as the authority whenever a network is available, and for anything that spends money or grants access.
  2. Minify the production bundle as usual, and use Hermes if it already fits your stack — as a runtime, not as a security story.
  3. Extract the sensitive function and apply a real protection pass: renaming and string tables as a floor, VM-style protection if wholesale reuse is the risk.
  4. Do not ship public source maps in the app package or on a public update server.

A JS VM obfuscator compiles that function to a custom bytecode and ships a small interpreter. The app still runs on the device. A recovered bundle no longer contains the original function in plain JavaScript. It is slower, so do not wrap the UI tree or the animation loop.

VEILVM is a browser-based JSVMP workspace you can point at one extracted function before you wire protection into the release pipeline. Protection raises the cost of lifting your offline engine out of the APK or an OTA update. It does not make the store binary opaque, and it does not replace server-side entitlements.

Checklist

  • [ ] You have opened your own release APK or IPA and know where the JS or Hermes bundle lives.
  • [ ] OTA update channels do not publish unprotected debug bundles.
  • [ ] Secrets and authoritative entitlements are not in the client bundle.
  • [ ] Source maps are not packaged with the app or published on a public update URL.
  • [ ] The remaining on-device engine is extracted and protected on purpose.
  • [ ] Release-build tests exercise the protected function, including an offline path if you claim one.

If you want to try VM protection on a single extracted function, VEILVM runs in the browser with no sign-up: 3 free runs a day, up to 5 KB per file (resets at 00:00 UTC). A free account raises the input limit to 30 KB. Pro is $9/month or $79/year and adds an API so the protection step can run in CI. Standard requests are processed in memory and are not written to logs. Start at https://vm.ldvmp.com.

Top comments (0)