isRooted method

Future<bool> isRooted(
  1. List<String> arguments, {
  2. bool debug = false,
})

Implementation

Future<bool> isRooted(List<String> arguments, {bool debug = false}) async {
  await init();
  final result = await execute([...arguments, 'shell', 'whoami'], debug: debug);
  if (result.exitCode != 0) {
    throw Exception(result.stderr);
  }
  return result.stdout.toString().contains('root');
}