isJailbroken method

  1. @override
Future<bool> isJailbroken()
override

Returns true if the device shows signs of being rooted (Android) or jailbroken (iOS).

Implementation

@override
Future<bool> isJailbroken() async {
  try {
    final result = await methodChannel.invokeMethod<bool>('isJailbroken');
    return result ?? false;
  } on PlatformException catch (e, s) {
    // Fail open: a detection error should never lock out a legitimate
    // user.
    debugPrint('root_jailbreak_check: detection failed, failing open: $e\n$s');
    return false;
  }
}