[BREAKGLASS] A React Native library for identifying if a phone is rooted or mocking locations
Go to file
Levi Buzolic 3a3bb026fb
Some checks failed
Android Build / build (push) Has been cancelled
Update README.md
2021-05-18 14:50:32 +10:00
_art optimized images 2016-10-18 11:08:19 -05:00
.github/workflows Create an up to date example project targeting React Native 0.64 2021-05-18 11:23:33 +10:00
android Bump Android minSdk to 21 inline with React Native 0.64 2021-05-18 09:59:28 +10:00
ExampleProject Tidy example app 2021-05-18 11:40:23 +10:00
JailMonkey Update JailMonkey.m with new checks (paths, symlinks, dylibs, forking) 2021-05-11 19:50:28 -04:00
JailMonkey.xcodeproj code moved to static lib 2016-07-20 10:08:20 -05:00
.gitignore Improvement in general 2019-07-25 10:13:12 -04:00
.npmignore create npm ignore file 2016-09-25 17:57:50 -05:00
jail-monkey.podspec Use correct React dependency in podspec 2020-11-24 10:08:30 +11:00
jailmonkey.d.ts Update Flow and TS types and ensure the JS confirms to those types 2021-01-15 15:59:39 +11:00
jailmonkey.js Always default to false for each synchronous call 2021-05-18 11:27:19 +10:00
jailmonkey.js.flow Update Flow and TS types and ensure the JS confirms to those types 2021-01-15 15:59:39 +11:00
LICENSE Create LICENSE 2017-08-11 14:09:15 -05:00
package.json v2.4.0 2021-05-18 14:40:46 +10:00
README.md Update README.md 2021-05-18 14:50:32 +10:00
yarn.lock Merge pull request #77 from GantMan/dependabot/npm_and_yarn/ini-1.3.7 2021-05-18 09:54:40 +10:00

WARNING: I don't have the devices to test anymore, so testing is done by those submitting PRs bona fide.

Jail Monkey

Version Downloads

Can you ever really trust a phone?

Why?

Are users claiming they are crossing the globe in seconds and collecting all the Pokeballs? Some apps need to protect themselves in order to protect data integrity. JailMonkey allows you to:

  • Identify if a phone has been jail-broken or rooted for iOS/Android.
  • Detect mocked locations for phones set in "developer mode".
  • (ANDROID ONLY) Detect if the application is running on external storage such as an SD card.

Use

import JailMonkey from 'jail-monkey'

if (JailMonkey.isJailBroken()) {
  // Alternative behaviour for jail-broken/rooted devices.
}

Circle of Trust

API

Method Returns Description
isJailBroken boolean is this device jail-broken/rooted.
canMockLocation boolean Can this device fake its GPS location.
trustFall boolean Checks if the device violates either isJailBroken or canMockLocation.
isDebuggedMode Promise<boolean> Is the application is running in debug mode. Note that this method returns a Promise.

Android Only APIs

Method Returns Description
hookDetected boolean Detects if there is any suspicious installed applications.
isOnExternalStorage boolean Is the application running on external storage (ie. SD Card)
AdbEnabled boolean Is Android Debug Bridge enabled.
isDevelopmentSettingsMode Promise<boolean> Whether user has enabled development settings on their device. Note that this method returns a Promise.

On iOS all of the Android only methods will return false or Promise<false> where appropriate.

Since emulators are usually rooted, you might want to bypass these checks during development. Unless you're keen on constant false alarms

Install

npm i jail-monkey --save
react-native link # Not required as of React Native 0.60.0

If you use rnpm, you may have trouble as rnpm does not link Android properly after 0.29.0!

Note: On Android you should include location.isFromMockProvider() from your location provider to compliment JailMonkey.canMockLocation(). Most react-native location libraries already have this check built in

Additional Info

This has been made public to help keep it up to date. As detection measures get better or out-dated, please send updates to this project so it can be the best method of detection.

Special thanks to this fantastic blog article: http://blog.geomoby.com/2015/01/25/how-to-avoid-getting-your-location-based-app-spoofed/