SudoUtil class
Constructors
- SudoUtil({_CommandRunner? commandRunner, SudoPlatformContext? platform, _TokenGenerator? tokenGenerator})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
ensureSudo(
) → Future< void> - Verifies the current process has sudo/Administrator privileges.
-
ensureSudoAndWriteToken(
String socketPath, {int timeoutSeconds = 300}) → Future< String> - Ensures sudo rights, then writes a temp token JSON file next to the daemon socket.
-
isRunningAsRoot(
) → Future< bool> - Returns true if current process is elevated (root/Admin), regardless of OS.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readToken(
String socketPath) → Future< SudoTokenPayload> - Reads the JSON token payload that a CLI dropped near the daemon socket.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited