gpt4 book ai didi

react-native - 在 React Native 失败模块中使用 Jail Monkey 检查设备是否越狱/root 为 'undefined'

转载 作者:行者123 更新时间:2023-12-03 23:49:29 30 4
gpt4 key购买 nike

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

  • Jail Monkey
  • react-native-is-device-rooted

  • 我首先尝试了 npm 包 react-native-is-device-rooted 但它不起作用,而且似乎已经过时了。所以我尝试了 jail 猴子,但我收到以下错误:

    enter image description here

    代码是:
    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())
    }
    }

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

    最佳答案

    JailMonkey 使用 native 模块,因此无法在 Expo 托管应用程序中运行。你需要将它弹出到 ExpoKit 才能让 JailMonkey 工作。

    关于react-native - 在 React Native 失败模块中使用 Jail Monkey 检查设备是否越狱/root 为 'undefined',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59955022/

    30 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com