unroot method

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

Implementation

Future<void> unroot(List<String> arguments, {bool debug = false}) async {
  await init();
  await execute([...arguments, 'unroot'], 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 stop adb as root');
}