@sentinelrn/native
v0.1.1
Published
Native runtime-integrity detectors (Android + iOS) for SentinelRN.
Readme
@sentinelrn/native
Native runtime-integrity detectors for SentinelRN, with Android (Kotlin) and iOS (Swift) implementations.
This package implements the IntegrityProvider interface from @sentinelrn/core. It collects a flat "integrity snapshot" from the device and maps it into scored threat signals — all severity/confidence/scoring lives in core, keeping detection consistent across platforms.
Install
pnpm add @sentinelrn/core @sentinelrn/nativeFor bare React Native, install pods:
cd ios && pod installUsage
Register the provider once at startup, before the first integrity.check():
import { SentinelRN } from "@sentinelrn/core";
import { registerSentinelNative } from "@sentinelrn/native";
registerSentinelNative();
const report = await SentinelRN.integrity.check();What it detects
| Platform | Signals |
| --- | --- |
| Android | root (su binaries, root packages, test-keys, writable system paths), emulator, debugger, developer mode, mock location, hooking (Frida/Xposed) |
| iOS | jailbreak (filesystem paths, sandbox escape, Cydia scheme), simulator, debugger (P_TRACED) |
Graceful degradation
When the native module is unavailable (Expo Go, web, tests), the provider falls back to best-effort JS-only heuristics and never throws — a detection gap becomes missing signals, not a crash. Meaningful root/jailbreak/hooking detection requires the native module in a development or production build.
Architecture support
Works on both the legacy bridge and the new architecture (Fabric / TurboModules, bridgeless).
- A codegen spec ships at
src/NativeSentinelRNNative.tsand is wired via thecodegenConfigblock inpackage.json, soreact-native-codegengenerates typed TurboModule interfaces at app build time. - At runtime the module is resolved through
TurboModuleRegistry.getfirst, thenNativeModules— so the same provider works under either architecture, and returnsnull(degrading gracefully) when neither is present.
Detection is heuristic and an arms race. SentinelRN raises attacker cost; it does not guarantee detection. See the threat model.
MIT © SentinelRN
