在 React Native 中使用 Jail Monkey 检查设备是否越狱/植根失败模块为“未定义”

kit*_*une 5 jailbreak package.json react-native

在 React Native 中,我找到了两个插件来检查设备(iOS/Android)是否越狱/root:

  1. 监狱猴子
  2. react-native-is-device-rooted

我首先尝试了 npm 包react-native-is-device-rooted但它不起作用,而且似乎已经过时了。所以我尝试了 Jail Monkey,但出现以下错误:

在此处输入图片说明

代码是:

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())
    }
}
Run Code Online (Sandbox Code Playgroud)

我已经仔细检查了包的手动链接(使用 Xcode、pod install 等......)。没有任何效果,有人可以帮助我吗?

kit*_*une 1

已解决,但手动进行链接。