Hello Friends,
Welcome To Infinitbility!
First, I try react-native-isDeviceRooted ( https://www.npmjs.com/package/react-native-is-device-rooted ) but due to manual installation I got errors and started to research on an alternative solution and I got jail-monkey ( https://www.npmjs.com/package/jail-monkey ) and it’s like a charm and below tutorial, I will explain how I do it…
Note ❗ Since emulators are usually rooted, you might want to bypass these checks during development. Unless you’re keen on constant false alarms ⏰
Introduction
jail-monkey package provide functionality to check or detect device is rooted or jailbroken and also is easy installation compare to react-native-isDeviceRooted, our emulators are usually rooted then we have to stop checking is rooted or jailbroken when we developing and testing in emulators.
Installation
jail-monkey installation are very simple…
- Install jail-monkey using npm
npm i jail-monkey --save
- Install jail-monkey using yarn
yarn add jail-monkey
- Link jail-monkey package ( Not required as of React Native 0.60.0 )
react-native link jail-monkey # Not required as of React Native 0.60.0
jail-monkey isJailBroken example
jail-monkey provide isJailBroken functionality to check android device is rooted or iOS device is jailbroken and it’s work both platform with same codebase checl below example
import JailMonkey from 'jail-monkey'
if (JailMonkey.isJailBroken()) {
// Alternative behaviour for jail-broken/rooted devices.
}
Keywords
react-native
, rooted
, jailbroken
, ios
, android
, secured
, Detect
Thanks for reading…