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

@bandaru.sudheer.npm/expo-root-deductor

v0.2.1

Published

Expo module for device security checks (root/jailbreak, emulator, developer mode detection)

Readme

expo-root-deductor

A comprehensive Expo module for detecting device security compromises including root detection, developer mode checks, and emulator detection on Android platform.

Features

  • 🔒 Root Detection: Detects if the device is rooted (Android)
  • 🛠️ Developer Mode Detection: Checks if developer mode is enabled
  • ⚙️ Developer Options Detection: Detects if developer options are enabled
  • 📱 Emulator Detection: Identifies if the app is running on an emulator or simulator
  • 🌐 Web Support: Includes web platform support with appropriate fallbacks
  • 📊 Detailed Results: Returns comprehensive security check results with failed check indicators

Installation

Managed Expo projects

For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release. If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.

Bare React Native projects

For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.

Add the package to your npm dependencies

npm install @bandaru.sudheer.npm/expo-root-deductor

Configure for Android

No additional configuration needed. The module will automatically detect root status and developer options.

Usage

Basic Example

import ExpoRootDeductor from 'expo-root-deductor';

// Check device security
const checkSecurity = async () => {
  try {
    const result = await ExpoRootDeductor.checkDeviceSecurity();
    
    console.log('Is Compromised:', result.isCompromised);
    console.log('Failed Checks:', result.failedChecks);
    console.log('Details:', result.details);
    
    if (result.isCompromised) {
      // Handle compromised device
      console.warn('Device security compromised!');
    }
  } catch (error) {
    console.error('Security check failed:', error);
  }
};

Complete Example with React Hook

import { useEvent } from 'expo';
import ExpoRootDeductor from 'expo-root-deductor';
import { useState } from 'react';

export default function SecurityCheck() {
  const [securityResult, setSecurityResult] = useState(null);

  const checkSecurity = async () => {
    try {
      const result = await ExpoRootDeductor.checkDeviceSecurity();
      setSecurityResult(result);
    } catch (error) {
      console.error('Security check failed:', error);
    }
  };

  return (
    <View>
      <Button title="Check Device Security" onPress={checkSecurity} />
      
      {securityResult && (
        <View>
          <Text>
            Is Compromised: {securityResult.isCompromised ? 'YES' : 'NO'}
          </Text>
          
          {securityResult.failedChecks?.length > 0 && (
            <View>
              <Text>Failed Checks:</Text>
              {securityResult.failedChecks.map((check, index) => (
                <Text key={index}>• {check}</Text>
              ))}
            </View>
          )}
          
          <Text>
            Rooted: {securityResult.details?.isRooted ? 'Yes' : 'No'}
          </Text>
          <Text>
            Developer Mode: {securityResult.details?.isDeveloperMode ? 'Yes' : 'No'}
          </Text>
          <Text>
            Developer Options: {securityResult.details?.isDeveloperOptionsEnabled ? 'Yes' : 'No'}
          </Text>
          <Text>
            Emulator: {securityResult.details?.isEmulator ? 'Yes' : 'No'}
          </Text>
        </View>
      )}
    </View>
  );
}

API Reference

Methods

checkDeviceSecurity(): Promise<DetectionResult>

Performs comprehensive security checks on the device and returns detailed results.

Returns: Promise<DetectionResult>

DetectionResult:

type DetectionResult = {
  isCompromised: boolean;           // True if any security check failed
  failedChecks: string[];            // Array of failed check names
  details: {
    isRooted: boolean;               // True if device is rooted
    isDeveloperMode: boolean;        // True if developer mode is enabled
    isDeveloperOptionsEnabled: boolean; // True if developer options are enabled
    isEmulator: boolean;              // True if running on emulator/simulator
  };
};

Example:

const result = await ExpoRootDeductor.checkDeviceSecurity();
// {
//   isCompromised: true,
//   failedChecks: ['isRooted', 'isDeveloperOptionsEnabled'],
//   details: {
//     isRooted: true,
//     isDeveloperMode: false,
//     isDeveloperOptionsEnabled: true,
//     isEmulator: false
//   }
// }

hello(): string

Returns a greeting message. Useful for testing module integration.

Returns: string

Example:

const greeting = ExpoRootDeductor.hello();
// "Hello world! 👋"

setValueAsync(value: string): Promise<void>

Sets a value and triggers an onChange event.

Parameters:

  • value: string - The value to set

Example:

await ExpoRootDeductor.setValueAsync('Hello from JS!');

Constants

PI: number

The mathematical constant π (pi).

Example:

const pi = ExpoRootDeductor.PI;
// 3.141592653589793

Events

onChange

Event fired when a value changes via setValueAsync.

Event Payload:

type ChangeEventPayload = {
  value: string;
};

Example:

import { useEvent } from 'expo';

const onChangePayload = useEvent(ExpoRootDeductor, 'onChange');
console.log(onChangePayload?.value);

Views

ExpoRootDeductorView

A view component that displays a web view.

Props:

type ExpoRootDeductorViewProps = {
  url: string;                      // URL to load in the web view
  onLoad?: (event: { nativeEvent: { url: string } }) => void; // Callback when URL loads
  style?: StyleProp<ViewStyle>;      // Optional style prop
};

Example:

import { ExpoRootDeductorView } from 'expo-root-deductor';

<ExpoRootDeductorView
  url="https://www.example.com"
  onLoad={({ nativeEvent: { url } }) => console.log(`Loaded: ${url}`)}
  style={{ height: 200 }}
/>

Platform Support

  • ✅ Android
  • ✅ Web (with appropriate fallbacks)

Security Considerations

⚠️ Important: This module provides security detection capabilities, but it should not be the sole security measure for your application. Determined attackers may find ways to bypass these checks. Always implement multiple layers of security.

Limitations

  • Root detection can be bypassed by sophisticated root cloaking tools
  • Some checks may have false positives or false negatives
  • Web platform has limited detection capabilities

Contributing

Contributions are very welcome! Please refer to guidelines described in the contributing guide.

License

MIT

Author

sudheer-9999 - GitHub

Repository

GitHub Repository

Issues

Report Issues