flutter_root_jailbreak 2.0.2 copy "flutter_root_jailbreak: ^2.0.2" to clipboard
flutter_root_jailbreak: ^2.0.2 copied to clipboard

a plugin to detect whether Android is rooted and whether iOS is jailbroken

example/lib/main.dart

import 'dart:io';

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:flutter_root_jailbreak/flutter_root_jailbreak.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 _result= true;

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

  Future<void> isRooted() async {
   try {
     bool result = Platform.isAndroid ? await FlutterRootJailbreak.isRooted : await FlutterRootJailbreak.isJailBroken;
     _result = result;
   }catch (e){
     debugPrint("=====error: isRooted======");
   }

    setState(() {
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Rooted || JailBroken'),
        ),
        body: Center(
          child: Platform.isAndroid
              ? Text('Android is rooted : $_result\n')
              : Text('iOS is is jailbroken : $_result\n'),
        ),
      ),
    );
  }
}
12
likes
130
pub points
85%
popularity

Publisher

unverified uploader

a plugin to detect whether Android is rooted and whether iOS is jailbroken

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_root_jailbreak