nativescript-jailbreak-detector
This plugin checks for root in android devices as well as for jailbreak in IOS devices
npm i --save nativescript-jailbreak-detector
- Version: 1.0.1
- GitHub:
- NPM: https://www.npmjs.com/package/nativescript-jailbreak-detector
- Downloads:
- Last Day: 0
- Last Week: 0
- Last Month: 0
NativeScript-Jailbreak-Detector
A Nativescript plugin that makes detection of root and jailbreak hassle free.
Contributors
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