npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-root-jail-detect

v2.0.0

Published

A lightweight and reliable React Native library to detect rooted Android devices and jailbroken iOS devices using modern Kotlin, Swift, and TypeScript. Built for security-focused mobile applications.

Readme

React Native Root/Jail Detect

npm
version License:
MIT PRs
Welcome

A lightweight, blazing‑fast React Native security module to detect rooted (Android) and jailbroken (iOS) devices, runtime instrumentation tools (Frida), debuggers, and emulators.

Perfect for apps that require strong client‑side integrity checks such as:

  • Banking apps
  • Fintech platforms
  • Enterprise apps
  • Gaming anti‑cheat systems
  • Security‑sensitive applications

Features

  • Fast -- Native implementation (Swift + Kotlin + C/C++)
  • Cross‑platform -- Works on both Android and iOS
  • New Architecture Ready -- Supports Fabric & TurboModules
  • Runtime Protection -- Includes a security watchdog
  • Frida Detection -- Detects dynamic instrumentation
  • Debugger Detection -- Detects runtime debugging
  • Emulator / Simulator Detection
  • Zero Dependencies
  • MIT Licensed

Advanced Security Features

Frida Detection

The module detects runtime instrumentation tools such as Frida commonly used for reverse engineering and bypassing security checks.

Detection techniques include:

  • Frida server port detection
  • Frida thread detection
  • Frida memory scanning
  • Frida runtime symbol detection
  • Frida dynamic library inspection

This helps protect apps from runtime tampering and reverse engineering.


Runtime Security Watchdog

The module includes a runtime watchdog that continuously monitors the environment even after the app launches.

Example scenario:

App launches → device appears safe
Attacker attaches debugger later
Watchdog detects it → action triggered

Protection modes:

Mode Behavior


LOG_ONLY Logs detection events THROW_EXCEPTION Throws runtime exception TERMINATE Terminates the application


Installation

npm install react-native-root-jail-detect

or

yarn add react-native-root-jail-detect

iOS Setup

cd ios
pod install
cd ..
npx react-native run-ios

Android Setup

For React Native 0.60+ autolinking works automatically.

npx react-native run-android

Basic Usage

import RootJailDetect from 'react-native-root-jail-detect';

const checkDeviceSecurity = async () => {
  const compromised = await RootJailDetect.isDeviceCompromised();

  if (compromised) {
    console.warn("Device is rooted/jailbroken");
  } else {
    console.log("Device is secure");
  }
};

Advanced Usage

Get Detection Reasons

Retrieve detailed detection reasons.

const reasons = await RootJailDetect.getDetectionReasons();
console.log(reasons);

Example output:

[
 "Frida instrumentation detected",
 "Debugger attached",
 "Root management app detected"
]

Enable Security Watchdog

RootJailDetect.startSecurityWatchdog({
  interval: 3000,
  protectionMode: "TERMINATE"
});

Stop watchdog:

RootJailDetect.stopSecurityWatchdog();

API Reference

isDeviceCompromised()

Returns whether device is rooted or jailbroken.

const compromised = await RootJailDetect.isDeviceCompromised();

isEmulator()

Detects emulator (Android) or simulator (iOS).

const emulator = await RootJailDetect.isEmulator();

isDebuggerAttached()

Detects whether a debugger is attached.

const debug = await RootJailDetect.isDebuggerAttached();

getDetectionReasons()

Returns array of human‑readable security warnings.

const reasons = await RootJailDetect.getDetectionReasons();

Comprehensive Security Checks

Android

Root detection techniques include:

  • Root management app detection
  • su binary detection
  • writable system partition checks
  • dangerous system properties
  • root cloaking files
  • build tag inspection

Emulator Detection

  • Build fingerprint analysis
  • emulator system properties
  • QEMU file detection

Debugger Detection

  • Java debugger detection
  • ptrace detection
  • TracerPid inspection

Runtime Instrumentation Detection

  • runtime thread detection
  • memory map scanning
  • runtime symbol detection

iOS

Jailbreak Detection

  • Cydia / Sileo / Zebra detection
  • MobileSubstrate detection
  • suspicious filesystem artifacts
  • sandbox escape attempts

Debugger Detection

  • sysctl inspection
  • ptrace anti‑debug

Runtime Instrumentation Detection

  • injected dylib detection
  • suspicious thread detection
  • runtime symbol detection

Example Screenshots

Android Emulator

Android Emulator

Android Real Device

Android Real Device

iOS Real Device

iOS Real Device

iOS Simulator

iOS Simulator


Use Cases

This module is useful for:

  • Banking apps
  • Payment gateways
  • Gaming anti‑cheat
  • Enterprise security policies
  • VPN and security apps

Security Strength

This module combines:

  • multiple detection heuristics
  • native runtime checks
  • debugger detection
  • instrumentation detection
  • watchdog runtime monitoring

This layered approach significantly increases difficulty for attackers attempting to bypass checks.


Important Notes

  • Not Foolproof: Sophisticated root/jailbreak concealment tools may bypass detection
  • Use as Part of Security Strategy: Combine with other security measures (SSL pinning, code obfuscation, etc.)
  • Graceful Degradation: Consider UX - don't block legitimate users unnecessarily
  • Regular Updates: Root/jailbreak methods evolve; keep the library updated

Contributing

PRs are welcome!

  1. Fork the repo
  2. Create a feature branch
  3. Commit changes
  4. Open a pull request

License

MIT © Rushikesh Pandit

Built with ❤️ for the React Native community.