twrpbuilder_plugin 1.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 8

TWRP Builder Plugin #

A new Flutter plugin only for Android. This plugin is for TWRPBuilder app only. Although you can use this plugin to get root access in your app.


  • [x] Add method to get root access
  • [x] Add method to create directory
  • [ ] Add method to execute Shell commands

Note #

This plugin is WIP.

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

1.1.1 #

  • Add Zip compression method


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

import 'package:twrpbuilder_plugin/twrpbuilder_plugin.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => new _MyAppState();

class _MyAppState extends State<MyApp> {
  bool _rootAccess = false;
  String dirStatus = "";
  String _brand = "";
  String _board = "";
  String _abi = "";
  String _fingerPrint= "";
  String _model = "'";
  String _product = "";

  void initState() {

  Future<void> initRootRequest() async {
    bool rootAccess = await TwrpbuilderPlugin.rootAccess;

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _rootAccess = rootAccess;

  Future<void> _createDir() async {
      ///Please grant storage permissions in Settings

      String propData = await TwrpbuilderPlugin.buildProp;

      await TwrpbuilderPlugin.createBuildProp('build.prop', propData);

      dirStatus = await TwrpbuilderPlugin.mkDir('TWRPBuilderF');

      //await TwrpbuilderPlugin.cp('/system/build.prop', 'TWRPBuilderF/build.prop');
      bool isOldMtk = await TwrpbuilderPlugin.isOldMtk;
      String recoveryMount = await TwrpbuilderPlugin.getRecoveryMount();
      //Navigator.of(context).pop(); ///Dismiss Loading dialog


  Future<Null> _showLoading() async {
    return showDialog<Null>(
        context: context,
        barrierDismissible: false,
        builder: (BuildContext context) {
          return AlertDialog(
              content: Container(
                height: 60.0,
                width: 60.0,
                alignment: Alignment.centerLeft,
                child: Row(
                  children: <Widget>[
                    Padding(padding: EdgeInsets.only(left: 8.0, right: 8.0)),
                    Text('Please wait...')

  Future<Null> _loadDeviceDetails() async {
    String brand = await TwrpbuilderPlugin.getBuildBrand;
    String board = await TwrpbuilderPlugin.getBuildBoard;
    String abi = await TwrpbuilderPlugin.getBuildAbi;
    String fingerPrint = await TwrpbuilderPlugin.getBuildFingerprint;
    String model = await TwrpbuilderPlugin.getBuildModel;
    String product = await TwrpbuilderPlugin.getBuildProduct;

    setState(() {
      _brand = brand;
      _board = board;
      _abi = abi;
      _fingerPrint = fingerPrint;
      _model = model;
      _product = product;

  Widget build(BuildContext context) {
    return MaterialApp(
      home: new Scaffold(
          appBar: AppBar(
            title: Text('Bull'),
          body: Container(
            padding: EdgeInsets.all(16.0),
            height: 480.0,
            width: 320.0,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisSize: MainAxisSize.max,
              children: <Widget>[
                  title: Text('Brand', style: TextStyle(
                      fontSize: 16.0, fontWeight: FontWeight.w700)),
                  subtitle: Text(_brand, style: TextStyle(
                      fontSize: 16.0, fontWeight: FontWeight.w600)),
                  title: Text('Board', style: TextStyle(
                      fontSize: 16.0, fontWeight: FontWeight.w700)),
                  subtitle: Text(_board, style: TextStyle(
                      fontSize: 16.0, fontWeight: FontWeight.w600)),
                  title: Text('Model', style: TextStyle(
                      fontSize: 16.0, fontWeight: FontWeight.w700)),
                  subtitle: Text(_model, style: TextStyle(
                      fontSize: 16.0, fontWeight: FontWeight.w600)),
                  title: Text('Product', style: TextStyle(
                      fontSize: 16.0, fontWeight: FontWeight.w700)),
                  subtitle: Text(_product, style: TextStyle(
                      fontSize: 16.0, fontWeight: FontWeight.w600)),
                  children: <Widget>[
                      onPressed: _createDir,
                      child: Text('Backup'),


Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  twrpbuilder_plugin: ^1.1.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:twrpbuilder_plugin/twrpbuilder_plugin.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

This package is not analyzed, because it is discontinued.

Health issues and suggestions

Document public APIs. (-1 points)

21 out of 21 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.58.0 <3.0.0