root_tester 0.0.5 copy "root_tester: ^0.0.5" to clipboard
root_tester: ^0.0.5 copied to clipboard

A Flutter plugin to check if device is rooted or not.only for Android & iOS Devices.

example/lib/main.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:root_tester/root_tester.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  bool _isRooted = false;

  @override
  void initState() {
    super.initState();
    initRootTester();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initRootTester() async {
    bool isRooted;
    try {
      isRooted = await RootTester.isDeviceRooted;
    } on PlatformException {
      isRooted = false;
    }
    if (!mounted) return;

    setState(() {
      _isRooted = isRooted;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('root_tester'),
        ),
        body: Center(
          child: Text('This Device Root Status is: $_isRooted\n'),
        ),
      ),
    );
  }
}
17
likes
140
pub points
83%
popularity

Publisher

verified publishershashwatmishra.me

A Flutter plugin to check if device is rooted or not.only for Android & iOS Devices.

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on root_tester