superuser 2.1.1 copy "superuser: ^2.1.1" to clipboard
superuser: ^2.1.1 copied to clipboard

Detect, verify user who execute Flutter program has superuser role and running with superuser permission with replicated UNIX identification commands.

Superuser detection for Flutter desktop application #

Superuser is a special user, who granted as much as possible to access system files for maintenance purpose. Different systems has different names to refer superuser (e.g. root in various UNIX system and Administrator in Windows).

Although pub.dev has numerous of packages to detect superuser, they are designed for Android and some packages added iOS support already. Hence, these package may become bulky because of unnessary callbacks along with detection only.

Instead, superuser package offers superuser detection in Flutter desktop and two replicated identification command from UNIX (whoami and group) for additional verification if necessary.

Limitations #

This package only tested using informations given on local machines only. It may not perform identically if running devices is domain joined.

Implementations #

Production #

No additional setup needed.

Testing or simulating with mock interface #

For testing, MockSuperuser must be binded already before performing widget test:

import 'package:flutter_test/flutter_test.dart';
import 'package:superuser/instance.dart';
import 'package:superuser/mock.dart';

void main() {
    setUpAll(() {
        // Bind mock instance here
        SuperuserInstance.bindInstance(const MockSuperuser(whoAmI: "reonaw"));
    });
    // Do any testes below
}

If using for debug simulation, mock interface must be binded before runApp:

import 'package:flutter/widgets.dart';
import 'package:superuser/instance.dart';
import 'package:superuser/mock.dart';

void main() {
    SuperuserInstance.bindInstance(const MockSuperuser(whoAmI: "hiderik", isSuperuser: true, isActivated: true));

    runApp(const YourApp());
}

Demo #

Demo application of superuser has been available in release page in Windows and Linux application.

These demo animations are for reference only, conditions and contents may be differ without notice.

Open without superuser right #

Open demo application oridinary

Open with superuser right #

Open demo application with superuser right

License #

BSD-3

2
likes
160
points
42
downloads

Publisher

verified publisherrk0cc.xyz

Weekly Downloads

Detect, verify user who execute Flutter program has superuser role and running with superuser permission with replicated UNIX identification commands.

Homepage
Repository (GitHub)

Topics

#superuser #root #admin #administrator #ffi

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

BSD-3-Clause (license)

Dependencies

flutter, meta, superuser_interfaces, superuser_plugin_unix, superuser_plugin_windows

More

Packages that depend on superuser