Files
Folo/apps/mobile/scripts/verify-native-runtime-version.ts
DIYgod 28ab52296e fix(mobile): embed the real OTA runtime version in Android builds
EAS generates android/ with `expo prebuild`, which sets NODE_ENV to
"development" when it is unset. The app config picked the 0.0.0-dev
runtime from NODE_ENV, so every Android binary since the React Native
0.79 upgrade embedded expo_runtime_version 0.0.0-dev, and ota.folo.is
rejects its update checks. iOS kept the real runtime because eas-cli
syncs its committed Expo.plist outside of prebuild.

Decide the development runtime from the EAS build profile and fall back
to NODE_ENV only without one (expo start, local prebuild). The
eas-build-post-install hook now fails any build whose native runtime
differs from the expected one, and a test evaluates every eas.json
profile the way prebuild does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 16:21:11 +08:00

22 lines
617 B
TypeScript

import { fileURLToPath } from "node:url"
import { dirname } from "pathe"
import { verifyNativeRuntimeVersion } from "./verify-native-runtime-version.impl"
// Runs as the eas-build-post-install hook, after EAS generated or synced the native project.
const projectDir = dirname(dirname(fileURLToPath(import.meta.url)))
async function main() {
const runtimeVersion = await verifyNativeRuntimeVersion({
projectDir,
platform: process.env.EAS_BUILD_PLATFORM,
profile: process.env.PROFILE,
nodeEnv: process.env.NODE_ENV,
})
console.info(`Native runtime version: ${runtimeVersion}`)
}
void main()