nativescript-jailbreak-detector
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

NativeScript-Jailbreak-Detector

NPM version Downloads TotalDownloads

A Nativescript plugin that makes detection of root and jailbreak hassle free.

Contributors

RootBeer

DTTJailbreakDetection

Supported Platforms

  • iOS
  • Android

Installation

tns plugin add nativescript-jailbreak-detector

iOS

Does not need any configuration.

Android

Does not need any configuration.

Usage

Typescript

import { JailbreakDetector } from 'nativescript-jailbreak-detector';
if (new JailbreakDetector().isRooted()) {
   // Logic here
 }

iOS

JailbreakDetector contains isJailBroken() method for IOS.

import { JailbreakDetector } from 'nativescript-jailbreak-detector';import {isIOS} from "tns-core-modules/platform";
import {isIOS} from "tns-core-modules/platform";
 
if (isIOS && new JailbreakDetector().isJailBroken()) {
  // Logic here
}

Note: isRooted() will call isJailBroken() internally for IOS devices so there is no need to check for platform before using isRooted() even on IOS.

Android

This plugin uses rootbeer package to find out is the device is rooted or not. Hence it exposes all the other helper methods too.

import { JailbreakDetector } from 'nativescript-jailbreak-detector';
const jailDetector = new JailbreakDetector();
 
// All the available methods
jailDetector.isRooted();
jailDetector.checkForBusyBoxBinary();
jailDetector.checkForDangerousProps();
jailDetector.checkForMagiskBinary();
jailDetector.checkForRootNative();
jailDetector.checkForRWPaths();
jailDetector.checkForSuBinary();
jailDetector.checkSuExists();
jailDetector.detectPotentiallyDangerousApps();
jailDetector.detectRootCloakingApps();
jailDetector.detectRootManagementApps();
jailDetector.detectTestKeys();
jailDetector.isRootedOrBusyboxInstalled();
jailDetector.isSelinuxFlagInEnabled();

Demo

# install required dependencies for demo and  
cd src && npm run postclone
# iOS 
npm run demo.ios
# Android 
npm run demo.android

Package Sidebar

Install

npm i nativescript-jailbreak-detector

Weekly Downloads

3

Version

1.0.1

License

Apache-2.0

Unpacked Size

28.3 kB

Total Files

18

Last publish

Collaborators

  • shivang-sai