Search code examples
react-nativepackage.jsonjailbreak

Check if device is jailbroken/rooted using Jail Monkey in React Native fails module is 'undefined'


In React Native I found two plugins to check if a device (iOS/Android) is jailbroken/rooted:

  1. Jail Monkey
  2. react-native-is-device-rooted

I have firstly tried the npm package react-native-is-device-rooted but it doesn't work and it seems to be outdated. So I tried Jail Monkey, but I get this following error:

enter image description here

The code is:

import JailMonkey from 'jail-monkey'

export default class Welcome extends Component {
    render() {
        return (
                ...
                <View style={styles.lowerView}>
                    <CustomButton text={"Jail Monkey"} onPress={() => this.printJailMonkey()}/>
                </View>
                ...
        );
    }

    printJailMonkey = () => {
        console.log("Jail Monkey library content: " + JailMonkey.isJailBroken())
    }
}

I have checked carefully the manual link of the package (using Xcode, pod install, and so on...). Nothing worked, does someone can help me?


Solution

  • Solved but doing manually the linking.