
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
react-native-pvt-jail-monkey
Advanced tools
A React Native module for identifying jail-broken, rooted, or mock locations on iOS and Android
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:
import JailMonkey from 'react-native-pvt-jail-monkey'
//debug - if true will skips all validations
//checkEmulator - check for simulator and emulator
//keyStoreSignature - [Android only] check signing signature of the install apk (SHA1 format)
let params = {debug:false,checkEmulator:false,keyStoreSignature:"5E:8F:16:206:2E:A3:CD:2C:4A:0D:54:78:76:BA:A6:F3:8C:AB:F6:25"}
//custom method with all security checking
JailMonkey.isSafe(params).then(()=>{
// is not rooted/jailbreak/emulator/simulator
},()=>{
// is rooted/jailbreak/emulator/simulator)
})
JailMonkey.externalCheck({
"magisk": true, //android only
'isRunningOnMac': true, //ios only
'isJb': true, //ios only
'isInjectedWithDynamicLibrary': true, //ios only
'isSecurityCheckPassed': true, //ios only
'isDebugged':true, //ios only
'isFromAppStore':true //ios only
}).then((ok) => {
console.log("safe device")
}, ({ code, message }) => {
// {"code":"error","message":"magisk"}
console.log("error", JSON.stringify(message))
})
use SHA1 format
keytool -list -v -keystore <keyStore>
prerequisite content hide when minimize
//in appDelegate.m
#import <JailMonkey.h>
- (void)applicationWillResignActive:(UIApplication *)application{
[JailMonkey showSecureScreen:[self window]];
}
- (void)applicationDidBecomeActive:(UIApplication *)application{
[JailMonkey hideSecureScreen:[self window]];
}
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. |
isSafe | Promise<boolean> | [Custom methood] custom method with all security checking |
secureScreen | void | [Custom methood] enable minimize content hiding (note: android will also disallow screenshot in this mode) |
unSecureScreen | void | [Custom methood] disable minimize content hiding |
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.
npm i jail-monkey --save
react-native link # Not required as of React Native 0.60.0
cd ios/
pod install #ios will need pod install to link
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
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/
FAQs
A React Native module for identifying jail-broken, rooted, or mock locations on iOS and Android
We found that react-native-pvt-jail-monkey demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.