root method

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

Implementation

Future<void> root(List<String> arguments, {bool debug = false}) async {
  await init();
  await execute([...arguments, 'root'], debug: debug);

  final now = DateTime.now();

  while (DateTime.now().difference(now) < _kRootTimeout) {
    await Future.delayed(_kRootInterval);
    if (await isRooted(arguments)) {
      return;
    }
  }

  throw Exception('Failed to start adb as root');
}