PrivKitPlatform class abstract
The interface that implementations of priv_kit must implement.
Platform implementations should extend this class rather than implement it, so new methods added here do not break existing implementations.
- Inheritance
-
- Object
- PlatformInterface
- PrivKitPlatform
- Implementers
Constructors
- PrivKitPlatform()
- Constructs a PrivKitPlatform.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
serverState
→ Stream<
PrivServerInfo?> -
Process-wide connection state of the Privileged Server.
no setter
-
startupLog
→ Stream<
PrivStartupLogLine> -
Diagnostic lines emitted while a start operation is running.
no setter
Methods
-
adbCheckPairing(
{String? adbDeviceName, int? port, int? portDiscoveryTimeoutMillis}) → Future< PrivAdbPairingCheckResult> - One-shot check of whether this app's ADB key is already authorized.
-
adbCheckPairingSession(
int sessionId) → Future< PrivAdbPairingCheckResult> - Runs one check on a session opened by adbOpenPairingCheckSession.
-
adbCheckTcpAuthorization(
{String? adbDeviceName, int? tcpPort}) → Future< PrivAdbAuthorizationCheckResult> - One-shot authorization check against the static TCP port.
-
adbCheckTcpAuthorizationSession(
int sessionId) → Future< PrivAdbAuthorizationCheckResult> - Runs one check on a session opened by adbOpenTcpAuthorizationCheckSession.
-
adbDiscoverConnectPort(
{String? adbDeviceName, int? timeoutMillis}) → Future< int> - Discovers the Wireless Debugging connect port.
-
adbDiscoverPairingPort(
{String? adbDeviceName, int? timeoutMillis}) → Future< int> - Discovers the Wireless Debugging pairing port.
-
adbGetActiveTcpPort(
{String? adbDeviceName}) → Future< int?> - The static ADB port adbd is currently listening on, if any.
-
adbGetConfiguredTcpPort(
{String? adbDeviceName}) → Future< int?> - The static ADB port previously configured by this app, if any.
-
adbGetIdentityInfo(
{String? adbDeviceName}) → Future< PrivAdbIdentityInfo> - ADB identity of this app, including its public key fingerprint.
-
adbGetWirelessDebuggingControlStatus(
{String? adbDeviceName}) → Future< PrivAdbWirelessDebuggingControlStatus> - Whether Priv Kit can manage Wireless Debugging on this device.
-
adbOpenPairingCheckSession(
{String? adbDeviceName, int? port, int? portDiscoveryTimeoutMillis}) → Future< int> - Opens a persistent pairing check session and returns its handle.
-
adbOpenTcpAuthorizationCheckSession(
{String? adbDeviceName, int? tcpPort}) → Future< int> - Opens a persistent TCP authorization check session, returns its handle.
-
adbPair(
{required String pairingCode, String? adbDeviceName, int? port, int? portDiscoveryTimeoutMillis}) → Future< PrivAdbPairingResult> - Pairs this app's ADB key with a six digit Wireless Debugging code.
-
adbPrepareTcpForStart(
{String? adbDeviceName, int? tcpPort}) → Future< PrivAdbAuthorizationCheckResult> - Checks and, when possible, restores the static TCP port before a start.
-
adbRequestTcpAuthorization(
{String? adbDeviceName, int? tcpPort, int? timeoutMillis}) → Future< PrivAdbAuthorizationRequestResult> - Requests authorization on the static TCP port and waits for the user.
-
adbRestartTcp(
{String? adbDeviceName, int? tcpPort, PrivAdbConnectionOptions? options}) → Future< PrivAdbTcpResult> - Restarts the static ADB port.
-
adbStopTcp(
{String? adbDeviceName, int? tcpPort, PrivAdbConnectionOptions? options}) → Future< PrivAdbTcpResult> - Stops the static ADB port.
-
adbSwitchToTcp(
{String? adbDeviceName, int? tcpPort, PrivAdbConnectionOptions? options}) → Future< PrivAdbTcpResult> -
Switches adbd to TCP/IP mode on
tcpPort(adb tcpip). -
binderClose(
int handle) → Future< void> -
Releases a handle returned by the
binder*calls. -
binderFromSystemService(
String serviceName, {PrivBinderServiceSource source = PrivBinderServiceSource.currentProcess, int? userServiceHandle}) → Future< int?> -
Resolves
serviceNameinto a handle Dart can inspect. -
binderGetInterfaceDescriptor(
int handle) → Future< String?> -
The interface descriptor reported by
handle, when it has one. -
binderHasSystemService(
String serviceName, {PrivBinderServiceSource source = PrivBinderServiceSource.currentProcess, int? userServiceHandle}) → Future< bool> -
Whether
serviceNamecan be resolved fromsource. -
binderIsAlive(
int handle) → Future< bool> -
Whether the process hosting
handleis still alive. -
binderPing(
int handle) → Future< bool> -
Whether
handleanswers a ping. -
binderServerLifecycle(
) → Future< int?> - Handle for the connected server's lifecycle Binder.
-
bindUserService(
PrivUserServiceSpec spec) → Future< int> - Binds an app-defined UserService and returns a connection handle.
-
cancelCommand(
String commandId) → Future< void> - Cancels a running command and releases its resources.
-
cancelOperation(
String operationId) → Future< void> -
Cancels a start operation previously launched with
operationId. -
checkPermission(
{required String permission, required String packageName, int? userId}) → Future< int> -
Checks
permissionagainstpackageName. -
checkServerPermission(
String permission) → Future< int> - Checks one permission against the connected server.
-
closeSession(
int sessionId) → Future< void> - Closes a session opened by adbOpenPairingCheckSession or adbOpenTcpAuthorizationCheckSession.
-
commandEvents(
String commandId) → Stream< PrivCommandEvent> - Events of the command previously started with startCommand.
-
configureRuntime(
{int? followDeathDelayMillis, bool? activeReconnectOnOwnerDeath, List< String> ? crashLogDirectories}) → Future<void> - Replaces the owner-death reconnect policy.
-
connectReadyServer(
) → Future< PrivServerInfo?> - Connects a server that has already announced itself, if any.
-
externalStartCheckAuthorization(
String providerId) → Future< PrivExternalStartResult> - Reads a provider's authorization state without prompting the user.
-
externalStartProviderIds(
) → Future< List< String> > - Ids of registered Core external start providers.
-
externalStartRequestAuthorization(
String providerId) → Future< PrivExternalStartResult> - Requests authorization from a provider.
-
externalStartRun(
{required String providerId, required String commandLine, String? operationId}) → Future< String> -
Runs
commandLinethrough a Core external start provider. -
externalStartupRunInCurrentProcess(
{required String commandLine, PrivExternalStartupOptions? options}) → Future< String> -
Runs
commandLinethrough/system/bin/shin this app's own process. -
externalStartupRunThroughBridge(
{required String commandLine, required String bridgeId, PrivExternalStartupBridgeOptions? options}) → Future< String> -
Runs
commandLinethrough an app-registered external startup bridge. -
fileCanExecute(
String path) → Future< bool> -
Whether
pathcan be executed. -
fileCanRead(
String path) → Future< bool> -
Whether
pathcan be read. -
fileCanWrite(
String path) → Future< bool> -
Whether
pathcan be written. -
fileClose(
int handle) → Future< void> - Closes a stream handle opened by fileOpenRead or fileOpenWrite.
-
fileCreateNewFile(
String path) → Future< bool> -
Creates
pathas a new empty file. -
fileDelete(
String path) → Future< bool> -
Deletes
path. A directory must be empty. -
fileDeleteRecursively(
String path) → Future< bool> -
Deletes
pathand, when it is a directory, all of its descendants. -
fileExists(
String path) → Future< bool> -
Whether
pathexists. -
fileIsDirectory(
String path) → Future< bool> -
Whether
pathis a directory. -
fileIsFile(
String path) → Future< bool> -
Whether
pathis a regular file. -
fileIsSymbolicLink(
String path) → Future< bool> -
Whether
pathis a symbolic link. -
fileLastModified(
String path) → Future< int> -
Last modification time of
path, in milliseconds since the epoch. -
fileLength(
String path) → Future< int> -
Size of
pathin bytes. -
fileMetadata(
String path, {bool followSymbolicLinks = false}) → Future< PrivFileMetadata> -
Reads one metadata snapshot of
path. -
fileMkdir(
String path) → Future< bool> -
Creates
pathas a directory, requiring its parent to exist. -
fileMkdirs(
String path) → Future< bool> -
Creates
pathas a directory, creating missing parents. -
fileOpenRead(
String path) → Future< int> -
Opens
pathfor reading and returns the stream handle. -
fileOpenWrite(
String path, {bool append = false, bool syncOnClose = false}) → Future< int> -
Opens
pathfor writing and returns the stream handle. -
fileRead(
int handle, {int maxBytes = privilegeFileDefaultReadChunkBytes}) → Future< Uint8List> -
Reads up to
maxBytesfromhandle. An empty list means end of file. -
fileRenameTo(
String from, String to) → Future< bool> -
Renames
fromtoto. -
fileReplaceAtomically(
String from, String to) → Future< void> -
Atomically renames
fromoverto. -
fileWalkEntries(
String operationId) → Stream< PrivFileEntry> - Entries of the walk previously started with fileWalkStart.
-
fileWalkStart(
String operationId, String path, {int? maxDepth, List< String> ? skipDirectoryGlobs, int? flushBatchSize}) → Future<void> -
Starts a directory walk and keeps it under
operationId. -
fileWrite(
int handle, Uint8List bytes) → Future< void> -
Writes
bytestohandle. -
getDeniedServerPermissions(
) → Future< List< String> > - Permissions declared for the server's packages but denied to its process.
-
getNativeStarterCommand(
) → Future< String> - The device-side shell command that starts the native starter.
-
getRuntimeConfig(
) → Future< PrivRuntimeConfig> - The current owner-death reconnect policy.
-
getServerInfo(
) → Future< PrivServerInfo> - The connected server. Throws when no server is connected.
-
getServerState(
) → Future< PrivServerInfo?> -
The currently connected server, or
null. -
grantRuntimePermission(
{required String packageName, required String permission, int? userId}) → Future< void> -
Grants
permissiontopackageName. -
hasLocalNetworkPermission(
) → Future< bool> - Whether this app may access the local network (always true below API 37).
-
hasNotificationPermission(
) → Future< bool> - Whether this app may post notifications (always true below API 33).
-
isDeveloperModeEnabled(
) → Future< bool> - Whether Android Developer options are enabled.
-
isPermissionRestricted(
) → Future< bool> - Whether the connected server cannot grant runtime permissions.
-
isRootAvailable(
) → Future< bool> -
Whether this device exposes a usable
subinary. -
isUsbDebuggingEnabled(
) → Future< bool> - Whether the Android USB debugging switch is on.
-
isWifiConnected(
) → Future< bool> - Whether the device is connected to a Wi-Fi network.
-
isWifiEnabled(
) → Future< bool> -
Whether the Android Wi-Fi switch is on (
Settings.Global.wifi_on). -
isWifiReady(
) → Future< bool> - Whether Wi-Fi is on and connected, the prerequisite for wireless ADB.
-
isWirelessDebuggingEnabled(
) → Future< bool> - Whether the Android Wireless debugging switch is on (API 30+).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openAppDetailsSettings(
) → Future< bool> - Opens this app's details page.
-
openDeveloperSettings(
) → Future< bool> - Opens Developer options, or About phone when they are not enabled yet.
-
openNotificationPermissionSettings(
) → Future< bool> - Opens this app's notification settings, with an app-details fallback.
-
openUsbDebuggingSettings(
) → Future< bool> - Opens the USB debugging switch inside Developer options.
-
openWifiSettings(
) → Future< bool> - Opens system Wi-Fi settings; returns whether an Activity was found.
-
openWirelessDebuggingSettings(
) → Future< bool> - Opens Wireless debugging, or Wi-Fi settings when Wi-Fi is not ready.
-
pingServer(
) → Future< bool> - Pings the server Binder, clearing the connection when it is dead.
-
prepareOwnerRestart(
{required int passiveReconnectTimeoutMillis}) → Future< void> - Tells the connected server that this owner process is about to restart.
-
readFallbackCrashLogs(
) → Future< List< PrivFallbackCrashLogFile> > - Reads this app's fallback reports with its own permissions, so it works without a connected server. The native side filters name, type and size.
-
requestLocalNetworkPermission(
) → Future< bool> -
Requests
ACCESS_LOCAL_NETWORKfrom this app's current Activity. -
requestNotificationPermission(
) → Future< bool> -
Requests
POST_NOTIFICATIONSfrom this app's current Activity. -
revokeRuntimePermission(
{required String packageName, required String permission, int? userId}) → Future< void> -
Revokes
permissionfrompackageName. -
runCommand(
PrivCommand command, {int? timeoutMillis, int? maxBytesPerStream}) → Future< PrivCommandResult> -
Starts
commandand drains both streams to completion. -
shutdownServer(
) → Future< void> - Shuts the connected server down and clears the local connection.
-
startAdb(
{PrivAdbConnectionOptions? options, int? timeoutMillis, String? adbDeviceName, String? operationId}) → Future< PrivServerInfo> - Starts the Privileged Server through ADB.
-
startCommand(
String commandId, PrivCommand command, {int? timeoutMillis}) → Future< void> -
Starts
commandfor streaming consumption and keeps it undercommandId. -
startRoot(
{int? timeoutMillis, String? operationId}) → Future< PrivServerInfo> -
Starts the Privileged Server through
su. -
startUserService(
PrivUserServiceSpec spec) → Future< void> - Starts an app-defined UserService.
-
stopUserService(
PrivUserServiceSpec spec) → Future< void> - Stops an app-defined UserService.
-
toString(
) → String -
A string representation of this object.
inherited
-
unbindUserService(
int connectionHandle) → Future< void> - Releases a connection handle returned by bindUserService.
-
userServiceConnectionInfo(
int connectionHandle) → Future< PrivUserServiceConnectionInfo> - Effective UID and calling package of a bound UserService connection.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ PrivKitPlatform
-
The default instance of PrivKitPlatform to use.
getter/setter pair