FLUTTER ECOSYSTEM

gokul1630/root

안드로이드 기기의 루트 상태를 확인하고 루트 권한으로 쉘 명령을 실행하는 Flutter 플러그인

루트 프로젝트 이미지
Stars
25
Forks
18
최근 푸시(UTC)
2022. 9. 22.
프로젝트 상태
활성
Gokulprasanth GitHub avatar
GITHUB User

Gokulprasanth ↗

I'm here to continue my hobby in software space

Salem, India
언어DartJava

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 2 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

root plugin

CodeFactor

A Flutter Plugin to check Android device Root status and Run shell commands in android(only).
This plugin is based on Topjohnwu libsu and Stericson Root Tools.

https://media.giphy.com/media/8eTmwU4QUazn9cpPhg/giphy.gif

Usage

To use this plugin, add root as a dependency in your pubspec.yaml file.
 root: ^2.0.4
import it
import 'package:root/root.dart';
Declare a async method to check root status
bool _status = false;

 Future<void> checkRoot() async {
    bool result = await Root.isRooted();
    setState(() {
      _status = result;
    });
  }
  
 later you can use _status in your code to let app know the root status. 
 
Declare a async method to check Su on System
bool _status = false;

 Future<void> checkRoot() async {
    bool result = await Root.isRootAvailable();
    setState(() {
      _status = result;
    });
  }
  
 later you can use _status in your code to let app know the root status. 
 
Declare a async method to run shell commands
use this function only for short period of processes, don't use for long processes else app may crash
String _result;

 Future<void> setCommand() async {
    String res = await Root.exec(cmd: "cat /proc/version");
    setState(() {
      _result = res;
    });
  }
  
  later you can use the _result in your code to let know the output of the given shell command.
 
issues
  • Please file the issues you found. Thank you.