Skip to main content

priv_kit 0.19.0 copy "priv_kit: ^0.19.0" to clipboard
priv_kit: ^0.19.0 copied to clipboard

An app-owned privileged Android runtime: Priv Kit supports startup through Root, ADB, Manual, and external authorization bridges.

0.19.0 #

Upgrade priv-core 0.18.0 → 0.19.0 #

Breaking: PrivRuntimeConfig.crashLogDirectory → crashLogDirectories (List<String>); configureRuntime takes the same list. null keeps the current value, an empty list clears it, and paths must be absolute.

priv-core now writes to the first usable directory, falling back to /data/local/tmp/priv-kit/<applicationId>/<userId>/crashes/ instead of the shared flat /data/local/tmp. Names are uniformly priv-crash_uid<uid>_<timestamp>.json.

readCrashLogs() merges configured directories (file proxy, skipped while disconnected) with fallback reports read through the new readFallbackCrashLogs bridge, so it works offline. It takes directories: and includeFallbackCrashLogs: instead of directory: / includeFallbackDirectory:, de-duplicates by path, sorts newest first and skips oversized or malformed files.

Also breaking: privilegeCrashLogFallbackDirectory → privilegeCrashLogFallbackRoot. New model: PrivFallbackCrashLogFile.

0.18.0 #

Upgrade priv-core 0.17.9 → 0.18.0 #

Breaking: PrivilegeUserServiceSpec.embedded became process. The Dart equivalent PrivUserServiceSpec.embedded is therefore replaced by process, a PrivUserServiceProcess that selects the execution process and, optionally, its UID:

  • dedicated (default) — inherit the server UID in a separate child process.
  • embedded — run inside the Privileged Server process.
  • root / system / shell — dedicated processes with UID 0 / 1000 / 2000. Changing the UID does not change the inherited SELinux domain.

serviceClassName is now nullable on both sides: omitting it selects priv-core's built-in Binder forwarding service, so no app-defined class or AIDL is needed for forwarding. Privilege.bindUserService() now also exposes the connection's uid and callingPackageName; the plugin returns them from userServiceConnectionInfo(connectionHandle).

Binder transactions can be forwarded through a bound UserService connection. binderHasSystemService and binderFromSystemService accept an optional userServiceHandle (the value returned by bindUserService); lookups and outgoing transactions then run in that process. Unbinding invalidates wrappers created from the connection instead of falling back to the main server. Kotlin code can do the same with userService = connection on PrivilegeBinderWrapper.fromSystemService / fromBinder.

PrivilegeSystemServiceSource.SERVER_PROCESS was renamed to REMOTE_PROCESS, because the lookup can now happen in a selected UserService process rather than only the server. PrivBinderServiceSource.remoteProcess is the new Dart name; serverProcess stays as a deprecated alias and sends the new wire value.

0.17.9 #

Upgrade priv-core 0.17.8 → 0.17.9 #

priv-core replaced its own exception types with plain ones: command failures now surface as IOException, so the plugin re-tags them and Dart still receives COMMAND_ERROR instead of FILE_ERROR. A command executor that dies mid-run now reports BINDER_DIED, matching the raw DeadObjectException priv-core throws. ADB failures are still wrapped upstream and keep reporting STARTUP_ERROR, so no Dart API changes.

0.17.8 #

Sync with priv-core 0.17.8 #

  • Package version aligned with priv-core 0.17.8; runtime changes are under 0.0.12.
  • Optimize the example app: en/zh localization and a logs dialog.

0.0.12 #

Upgrade priv-core 0.17.6 → 0.17.8 #

ADB identity, pairing and TCP session failures now report one PrivilegeStartupException message instead of passing the original error through. The native starter ignores unrelated processes with an empty cmdline/comm, and reports an interrupted APK directory scan instead of using the partial result.

0.0.11 #

Upgrade priv-core 0.17.4 → 0.17.6 #

A manually started server now learns its crash log directory at the handshake, so its earliest reports land in /data/local/tmp — which readCrashLogs() already scans. Wireless port discovery no longer opens the Android 17 network picker and waits instead of failing without the local network permission.

0.0.10 #

Upgrade priv-core 0.17.2 → 0.17.4 #

The server and dedicated UserServices now write a report when they die on an uncaught Java/Kotlin exception: readCrashLogs() returns them as PrivCrashLog values, newest first, and configureRuntime(crashLogDirectory:) chooses where they land. They are read through the file proxy, so a server must be connected, and nothing deletes them. fileWalk() additionally accepts a symbolic-link root such as /sdcard. Otherwise nothing changes: a rejected ADB setting write only reports a better message.

0.0.9 #

Upgrade priv-core 0.17.1 → 0.17.2 #

PrivilegeBinderWrapper.shellCommand() is now kept under R8, so it stays callable from Kotlin in release builds. No API changed and the Dart surface is untouched.

0.0.8 #

Upgrade priv-core 0.17.0 → 0.17.1 #

checkServerPermission() now returns PERMISSION_GRANTED directly for root servers (UID 0), skipping the system permission query. The connection is still validated, so the call keeps failing when the server is gone.

This matches the behaviour already documented for getDeniedServerPermissions() (empty list for root) and isPermissionRestricted() (false for root); the Dart docs and both READMEs now state the root short-circuit for all three.

0.0.7 #

Binder access #

Exposes priv.kit.core.binder, so Dart can resolve system services and the connected server's lifecycle Binder:

  • binderHasSystemService(name, source) — whether the service resolves.
  • binderFromSystemService(name, source) — an integer handle, or null when the service is unavailable.
  • binderServerLifecycle() — the server's lifecycle Binder, an ownership token for privileged APIs that release resources when their owner dies.
  • binderGetInterfaceDescriptor / binderPing / binderIsAlive — what Dart is allowed to ask a Binder about itself.
  • binderClose(handle) — release a handle.

PrivBinderServiceSource selects which process does the lookup: currentProcess uses ServiceManager in the app, serverProcess looks inside the Privileged Server for services only published to shell or root.

A Binder cannot cross the platform channel, so Dart only ever holds an integer handle. Issuing a service's own transactions stays in Kotlin — the same split as a UserService: resolve with PrivilegeBinderWrapper.fromSystemService and convert the Binder with your AIDL's Stub.asInterface(...).

The example app adds DemoBinderBridge, which drives the DUMP transaction (the one behind dumpsys, implemented by every system service) so the round trip needs no app-specific AIDL, and uses PrivilegeBinderCall.orElse to separate ServerUnavailable from BinderDied.

New error code BINDER_DIED for DeadObjectException, where the endpoint died rather than the server.

0.0.6 #

UserService #

Exposes priv.kit.core.userservice — the only mechanism here that runs app-defined code with the server's privileges:

  • startUserService / stopUserService — drive the lifecycle from Dart.
  • bindUserService / unbindUserService — bind and release a connection, identified by an integer handle.

PrivUserServiceSpec carries serviceClassName, tag, version, embedded and daemon.

A Binder cannot cross the platform channel, so Dart cannot call the service's own AIDL methods — bindUserService exists only so Dart can manage the connection lifetime. Invoking the service has to happen in Kotlin:

val service = IMyService.Stub.asInterface(connection.binder)

The example app adds IDemoPrivilegeService.aidl, DemoPrivilegeService and DemoUserServiceBridge (its own method channel) to show that split.

The plugin now depends on priv-core with api instead of implementation: its public API exposes priv-core types, and host apps that write a UserService or register an external startup bridge need them on the compile classpath.

0.0.5 #

File proxy #

Exposes priv.kit.core.file, so Dart can read, write and traverse paths the app itself cannot reach. Every operation runs inside the connected server.

  • Query: fileExists, fileIsFile, fileIsDirectory, fileIsSymbolicLink, fileCanRead, fileCanWrite, fileCanExecute, fileLength, fileLastModified, fileMetadata.
  • Mutate: fileCreateNewFile, fileMkdir, fileMkdirs, fileDelete, fileRenameTo, fileReplaceAtomically, fileDeleteRecursively.
  • Streams: fileOpenRead / fileRead / fileOpenWrite / fileWrite / fileClose, plus the fileReadAllBytes and fileWriteAllBytes helpers.
  • Traversal: fileWalk, which streams PrivFileEntry values.

Streams cannot cross a platform channel, so they are exposed through integer handles; walks get a per-walk EventChannel, the same approach already used for command output. Cancelling a walk subscription stops the traversal.

New error code FILE_ERROR covers IOException and ErrnoException, e.g. a cross-filesystem rename(2) or a permission failure.

0.0.4 #

Runtime configuration #

Exposes priv.kit.core.PrivilegeConfig, the owner-death reconnect policy:

  • getRuntimeConfig() — current PrivRuntimeConfig (followDeathDelayMillis, activeReconnectOnOwnerDeath).
  • configureRuntime(followDeathDelayMillis:, activeReconnectOnOwnerDeath:) — replaces it atomically. Omitted fields keep their current value.

Upstream defaults are 10 minutes and false, also exported as privilegeDefaultFollowDeathDelayMillis / privilegeDefaultActiveReconnectOnOwnerDeath.

Changes are pushed to the connected server and apply to the next owner death; a reconnect flow already in progress keeps the values it captured.

0.0.3 #

Runtime permission management for any package #

Adds three calls that operate on arbitrary packages, where the existing checkServerPermission only inspects the connected server itself:

  • checkPermission(permission, packageName, userId) — returns privilegePermissionGranted (0) or privilegePermissionDenied (-1).
  • grantRuntimePermission(packageName, permission, userId)
  • revokeRuntimePermission(packageName, permission, userId)

Also adds isPermissionGranted(...), a boolean convenience wrapper over checkPermission.

userId is optional and defaults to the current Android user. Grant and revoke require the connected server to hold android.permission.GRANT_RUNTIME_PERMISSIONS, so check isPermissionRestricted() first.

0.0.2 #

Upgrade priv-core 0.12.0 → 0.15.0 #

  • v0.14.0 — getDeniedServerPermissions() now only returns permissions that are defined on the current device; permissions the system does not define are excluded.
  • v0.12.1 — Permission checks and denied-permission lists no longer go stale after changing a vendor USB debugging security setting; they update without restarting the server.

0.0.1 #

  • Initial release: Flutter platform channels for the Priv Kit Android runtime (priv-core 0.12.0), covering Root / ADB wireless / ADB TCP-IP / manual / external startup, server state and startup log event channels, server lifecycle and permission queries, ADB pairing and TCP control calls, and command execution (runCommand / startCommand).
1
likes
0
points
1.22k
downloads

Documentation

Documentation

Publisher

verified publishernoob-coder.com

Weekly Downloads

An app-owned privileged Android runtime: Priv Kit supports startup through Root, ADB, Manual, and external authorization bridges.

Homepage
Repository (GitHub)
View/report issues

Topics

#android #root #adb #shell #shizuku

License

unknown (license)

Dependencies

flutter, freezed_annotation, plugin_platform_interface

More

Packages that depend on priv_kit

Packages that implement priv_kit