Code Monkey home page Code Monkey logo

jail-monkey's Introduction

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.

iOS Only APIs

Method Returns Description
jailBrokenMessage string Returns the reason for jailbroken detection. Will return an empty string on Android.

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/

jail-monkey's People

Contributors

gantman avatar levibuzolic avatar dependabot[bot] avatar danthonypabon avatar gustavjf avatar tangten avatar t-mdo avatar aprct avatar crafterm avatar mateosilguero avatar modevby avatar sankar4n avatar tommeier avatar nicholaszankichsmarkets avatar ermankuruoglu avatar fauzzi avatar nilavassg avatar kelokchan avatar sonicdoe avatar el173 avatar geraintwhite avatar lefloh avatar droidking18 avatar brockdub avatar adamivancza avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.