Search code examples
androidreactjsreact-nativeexporooted-device

react native:how to understand device is rooted?


I want to know if the device has been rooted, or not? I looked at react native library as well as the expo and did not find anything.

Also I want to have a list of installed apps on the phone.


Solution

  • You can use this library to identify if a phone is rooted or mocking locations.

    https://github.com/GantMan/jail-monkey

    import JailMonkey from 'jail-monkey'
    
    // is this device JailBroken on iOS/Android?
    JailMonkey.isJailBroken()
    
    // Can this device mock location - no need to root!
    JailMonkey.canMockLocation()
    
    // Check if device violates any of the above
    JailMonkey.trustFall()
    
    // (ANDROID ONLY) Check if application is running on external storage
    JailMonkey.isOnExternalStorage()