Skip to content
THE OTA MANUALCLI & compatibility

Runtime compatibility fingerprinting ​

Editing TypeScript does not guarantee OTA compatibility in NativeScript. Build-time native metadata and static bindings define the exact native surface available to JavaScript in an installed binary.

ota-ns fingerprint computes a deterministic per-platform runtimeContract (ios-rc-<16-hex> or android-rc-<16-hex>) and compares future bundles against a store-binary baseline before allowing ota-ns pack to sign a release.

The five fingerprinted sections ​

SectionWhat is hashedCatches
runtime@nativescript/ios or @nativescript/android version, @nativescript/core version, @getcortexlabs/ota-nativescript version + all native bootstrapper files, nativescript.config.*Runtime upgrades, OTA native bootstrapper changes, V8/markingMode config changes
nativePluginsResolved native plugins (platforms/android/dependencies.json + package.json native plugin scan) and every file under each plugin's platforms/<platform>/Adding, removing or upgrading plugins with Swift, ObjC, Java, Kotlin, Podfile or Gradle changes
nativeConfigAndResourcesNormalized App_Resources/iOS/ or App_Resources/Android/New permissions (NSCameraUsageDescription, AndroidManifest.xml), entitlements, ProGuard rules, minSdk/deployment target changes
generatedMetadataiOS Release*/metadata-*.bin + whitelist.mdg/blacklist.mdg + plugins-release.xcconfig; Android assets/metadata/*.datChanges in the native API surface exposed to JS
staticBindingsNormalized Android build-tools/sbg-bindings.txt + tns-java-classes.js + JS-to-native class/protocol registration markers (ObjCProtocols, ObjCExposedMethods, @JavaProxy, .extend)New JS subclasses of native classes/protocols absent from compiled native bindings

Normalization prevents false positives ​

Hashing raw build files would trigger spurious drift on every JS edit or version bump. ota-ns fingerprint normalizes volatile fields automatically:

  • iOS Info.plist: normalizes CFBundleVersion, CFBundleShortVersionString, CortexOtaConfigBase64 and CortexOtaRuntimeContract while preserving permissions, URL schemes and ATS rules.
  • Android app.gradle: normalizes versionCode and versionName while preserving minSdkVersion, minifyEnabled, ProGuard files and Gradle dependencies.
  • Android sbg-bindings.txt: parses NativeScript 9.1's 9-field *-delimited format, stripping volatile bundle filenames and line/column offsets while preserving the exact canonical set of baseClass | javaProxyOrExtendName | sortedMethods | sortedInterfaces.

CI drift gating ​

Record one baseline JSON artifact per store binary build:

sh
npx ota-ns fingerprint --platform ios --project . --write-baseline ./ota.baseline.ios.json
npx ota-ns fingerprint --platform android --project . --write-baseline ./ota.baseline.android.json

Compare in CI on every OTA release branch:

sh
npx ota-ns fingerprint --platform ios --project . --baseline ./ota.baseline.ios.json
  • Exit code 0: compatible (runtimeContract matches baseline).
  • Exit code 2: native drift detected — prints the exact section diff ([runtime], [nativePlugins], [nativeConfigAndResources], [generatedMetadata], [staticBindings]) showing what requires a new store binary.
  • ota-ns pack --baseline <path> enforces this check automatically and refuses to pack on drift unless --allow-drift is explicitly passed.