r/reactnative • • 4d ago

5 release mistakes that pass code review but ship in your .ipa / .aab (and how to check the built file)

Post image

Code review looks at the repo, but what users get is the file your build produced. With env-switched app.config.ts, Expo prebuild and config plugins, the two drift apart. These are the mistakes I see most, and all of them are visible only in the built app:

1. A secret key in the JS bundle. Hermes bytecode stores strings as plain text, so anyone with the app file can read them. Publishable keys (Stripe pk_, Firebase, the Supabase anon key) are fine. Secret keys (Stripe sk_live_, AWS, OpenAI, a Supabase service_role key) belong on a server.

2. A staging or localhost API URL. EXPO_PUBLIC_API_URL set in the wrong EAS profile, a .env that wasn't swapped, or the emulator fallback http://10.0.2.2:3000 left in.

3. Staging domains in deep links. Associated domains (iOS) and App Links (Android) are often switched by APP_VARIANT. If the production build claims staging.example.com, universal links quietly break. On iOS, only the entitlements inside the signed executable show what really shipped.

4. A debuggable or development-signed build. android:debuggable="true", or an iOS build with get-task-allow (the App Store rejects it).

5. Source maps inside the app. A .map file or an inline sourceMappingURL gives away your original source.

Checking by hand: unzip the .aab / .ipa, then run strings on the bundle and grep for sk_live, localhost, staging, 10.0.2.2. For iOS deep links, run codesign -d --entitlements - Payload/YourApp.app.

I got tired of doing that by hand, so I wrote a small free, MIT-licensed CLI that does all of the above in about a second, with no upload and no dependencies. You can try it on a demo build with planted mistakes:

curl -LO https://github.com/harpreetkbadhan/release-lint-demo/releases/download/v1.0.0/release-lint-demo.aab
npx app-release-lint release-lint-demo.aab

Repo: https://github.com/harpreetkbadhan/release-lint

What release mistakes have you shipped that I didn't list? I'd like to add checks for them.

1 Upvotes

13 comments sorted by

3

u/codariadev 4d ago • Bravo

Nice list. Another one that shows up in Expo/EAS apps: the update channel. A production binary can still be subscribed to a preview/staging EAS Update channel if app.config or the EAS profile points at the wrong one. The store build looks fine, then a preview bundle goes out to real users (or a fix never reaches them). That's only visible in the built app, not in a normal code review.

Also android:usesCleartextTraffic="true" / NSAllowsArbitraryLoads left on after talking to a local API. It often survives review and you only see it in the manifest or Info.plist of the artifact.

2

u/harpreetkbadhan 4d ago

Thanks, both are great examples of "only visible in the artifact".

Cleartext / ATS is already in: debug/cleartext-traffic reads usesCleartextTraffic from the built AndroidManifest and debug/arbitrary-loads reads NSAllowsArbitraryLoads from the Info.plist.

The EAS Update channel is a really good one and not covered yet. The channel is baked into the binary (Expo.plist on iOS, a meta-data entry in the manifest on Android), so it can be checked: a store build subscribed to a preview/staging channel should be an error. I'll add it and reply here when it's out.

2

u/harpreetkbadhan 4d ago

Thanks u/codariadev , are great "only visible in the artifact" cases. Cleartext and ATS on/off are already checked (debug/cleartext-traffic, debug/arbitrary-loads). The EAS Update channel isn't yet, and it's a really good one: I opened an issue for it here: https://github.com/harpreetkbadhan/release-lint/issues/5

3

u/dawedev 4d ago • Bravo

Worth adding the Info.plist and manifest side to the list, since config plugins write those too. A production build can still carry NSAllowsArbitraryLoads or an NSExceptionDomains entry for a dev server, and on Android usesCleartextTraffic="true" or a network_security_config that trusts user CAs from a debug setup. plutil -p Payload/YourApp.app/Info.plist and aapt2 dump xmltree on the manifest show what actually shipped. Same idea as your list: the repo says one thing, the built file says another.

1

u/harpreetkbadhan 4d ago

Thanks, good list. Two of these already ship: usesCleartextTraffic="true" and NSAllowsArbitraryLoads are read from the built manifest and Info.plist (same idea as plutil / aapt2 dump, done inside the tool). The per-host ones, NSExceptionDomains and a network_security_config that allows HTTP for a dev host, are next: https://github.com/harpreetkbadhan/release-lint/issues/6

User CAs I hadn't listed, adding it now: <certificates src="user"/> in base-config or a domain-config ships to everyone, while inside debug-overrides it's fine. Thanks!

1

u/harpreetkbadhan 4d ago

One more from the same thread (thanks u/dawedev): flag <trust-anchors><certificates src="user"/> in base-config or a domain-config of the network security config. Inside <debug-overrides> it only applies to debuggable builds, so it's fine there. Proposed: debug/user-ca-trusted, warning.

1

u/harpreetkbadhan 4d ago

Shipped in 0.3.0: per-host plain HTTP (network_security_config domain-config and NSExceptionDomains) and user CAs outside debug-overrides are now reported, read from the built file. Your debug-overrides point is in there too. Thanks for the idea!

https://github.com/harpreetkbadhan/release-lint/releases/tag/v0.3.0

1

u/dawedev 4d ago

Nice, that was quick. One edge case for the debug-overrides rule: debug-overrides also apply to any build where android:debuggable ends up true, for example a release build type that got debuggable set by mistake. So it might be worth flagging debuggable="true" in the built manifest next to it, if the tool doesn't already.

1

u/harpreetkbadhan 4d ago

Thanks! debuggable="true" is already its own error (debug/debuggable), read from the compiled manifest of the built .aab/.apk, so a release build type with debuggable set by mistake fails the scan. You're right that the two should connect though: when the build is debuggable, the report should also say what debug-overrides turns on (user CAs etc.). Adding that next.

2

u/dawedev 3d ago

Good, then it's mostly the report wording. A line like "this build is debuggable, so debug-overrides are active: user CAs trusted" would make the risk obvious to whoever reads the CI output.

1

u/harpreetkbadhan 3d ago

Agreed, and that's how it works now. When the build is debuggable, the report flags the user CAs inside debug-overrides too and says why they're active. Shipped in 0.3.3. Thanks for the push, this came straight from your comment.

2

u/dawedev 3d ago

Nice, that was fast. That wording should save someone a confusing debugging session later.

1

u/harpreetkbadhan 4d ago

u/dawedev Done in 0.3.3: when the build is debuggable, user CAs in debug-overrides are now reported too, next to the debug/debuggable error, saying why they're active. Thanks again!