fn syncDevice()
Capture device identity, capability ceiling (root), users, and owners
fn syncPackages()
Capture the full installed-package inventory joined with metadata
fn syncUsage()
Capture per-app usage stats (last-used, launch count, standby bucket)
fn syncStorage()
Capture per-app code size on disk and totals
fn sync()
Fan-out: capture the full read surface (device, packages, usage,
fn syncPermissions(user?: number, scope?: enum)
Capture per-app runtime permission grants (the user-facing,
| Argument | Type | Required | Description |
|---|
| user? | number | no | Android user id (0 = owner) |
| scope? | enum | no | Limit to third-party apps (default) or include system apps |
fn syncBattery()
Capture estimated per-app power use (mAh) from batterystats,
fn syncAppControls(ops?: array)
Capture holders of special-access appops (display-over-other-apps,
| Argument | Type | Required | Description |
|---|
| ops? | array | no | appops op names to query (default: the special-access set) |
fn syncNotifications(user?: number, scope?: enum)
Capture per-app notification posture from the POST_NOTIFICATIONS
| Argument | Type | Required | Description |
|---|
| user? | number | no | Android user id (0 = owner) |
| scope? | enum | no | Limit to third-party apps (default) or include system apps |
fn disableApp(pkg: string, user?: number, confirm?: boolean, force?: boolean)
Disable an app for a user (pm disable-user). Reversible. Dry-run unless confirm=true.
| Argument | Type | Required | Description |
|---|
| pkg | string | yes | Package name to act on |
| user? | number | no | Android user id (0 = owner) |
| confirm? | boolean | no | Actually run. Default false = dry-run preview, device untouched. |
| force? | boolean | no | Override the protected-app guard (management tooling). |
fn enableApp(pkg: string, user?: number, confirm?: boolean, force?: boolean)
Re-enable a disabled app (pm enable). Dry-run unless confirm=true.
| Argument | Type | Required | Description |
|---|
| pkg | string | yes | Package name to act on |
| user? | number | no | Android user id (0 = owner) |
| confirm? | boolean | no | Actually run. Default false = dry-run preview, device untouched. |
| force? | boolean | no | Override the protected-app guard (management tooling). |
fn uninstallApp(pkg: string, user?: number, confirm?: boolean, force?: boolean)
Uninstall an app for a user (pm uninstall --user). Restorable. Dry-run unless confirm=true.
| Argument | Type | Required | Description |
|---|
| pkg | string | yes | Package name to act on |
| user? | number | no | Android user id (0 = owner) |
| confirm? | boolean | no | Actually run. Default false = dry-run preview, device untouched. |
| force? | boolean | no | Override the protected-app guard (management tooling). |
fn restoreApp(pkg: string, user?: number, confirm?: boolean, force?: boolean)
Restore an uninstalled-for-user app (cmd package install-existing). Dry-run unless confirm=true.
| Argument | Type | Required | Description |
|---|
| pkg | string | yes | Package name to act on |
| user? | number | no | Android user id (0 = owner) |
| confirm? | boolean | no | Actually run. Default false = dry-run preview, device untouched. |
| force? | boolean | no | Override the protected-app guard (management tooling). |
fn disableApps(packages: array, user?: number, confirm?: boolean, force?: boolean)
Fan-out disable: act on many packages in one lock (repo rule 6). Dry-run unless confirm=true.
| Argument | Type | Required | Description |
|---|
| packages | array | yes | Packages to act on |
| user? | number | no | |
| confirm? | boolean | no | Actually run. Default false = dry-run preview, device untouched. |
| force? | boolean | no | |
fn uninstallApps(packages: array, user?: number, confirm?: boolean, force?: boolean)
Fan-out uninstall for a user. Dry-run unless confirm=true. Restorable.
| Argument | Type | Required | Description |
|---|
| packages | array | yes | Packages to act on |
| user? | number | no | |
| confirm? | boolean | no | Actually run. Default false = dry-run preview, device untouched. |
| force? | boolean | no | |
fn applyDesired(desired?: array, user?: number, confirm?: boolean, force?: boolean)
Reconcile the device to a declarative desired-state list
| Argument | Type | Required | Description |
|---|
| desired? | array | no | Desired per-package states. If omitted, read from globalArguments.desired. |
| user? | number | no | |
| confirm? | boolean | no | Actually converge. Default false = dry-run reconcile plan, device untouched. |
| force? | boolean | no | Override the protected-app guard for destructive steps. |
fn forceStop(pkg: string, user?: number, confirm?: boolean, force?: boolean)
Force-stop a running app (am force-stop). Reversible. Dry-run unless confirm=true.
| Argument | Type | Required | Description |
|---|
| pkg | string | yes | Package name to act on |
| user? | number | no | Android user id (0 = owner) |
| confirm? | boolean | no | Actually run. Default false = dry-run preview, device untouched. |
| force? | boolean | no | Override the protected-app guard (management tooling). |
fn clearAppData(pkg: string, user?: number, confirm?: boolean, force?: boolean)
Clear an app's data/caches for a user (pm clear). DESTRUCTIVE + protected-guarded. Dry-run unless confirm=true.
| Argument | Type | Required | Description |
|---|
| pkg | string | yes | Package name to act on |
| user? | number | no | Android user id (0 = owner) |
| confirm? | boolean | no | Actually run. Default false = dry-run preview, device untouched. |
| force? | boolean | no | Override the protected-app guard (management tooling). |
fn syncLabels(scope?: enum, refresh?: boolean, limit?: number, delayMs?: number)
Resolve human-readable app names from Play / F-Droid (og:title) and
| Argument | Type | Required | Description |
|---|
| scope? | enum | no | |
| refresh? | boolean | no | Re-fetch even if already cached |
| limit? | number | no | Cap new lookups this run (0 = no cap) |
| delayMs? | number | no | Throttle between HTTP lookups (ms) |
fn getAppOps(pkg: string, user?: number)
Read per-app operation modes (cmd appops get). Read-only.
| Argument | Type | Required | Description |
|---|
| pkg | string | yes | |
| user? | number | no | |
fn setAppOp(pkg: string, op: string, mode: enum, confirm?: boolean)
Set one appops op mode for an app (cmd appops set). Dry-run unless confirm=true.
| Argument | Type | Required | Description |
|---|
| pkg | string | yes | |
| op | string | yes | appops op name, e.g. RUN_IN_BACKGROUND, FINE_LOCATION |
| mode | enum | yes | allow | deny | ignore | default | foreground |
| confirm? | boolean | no | Actually set. Default false = dry-run preview, device untouched. |
Resources
device-info(infinite)— Device identity, capability ceiling, users, and owners
packages(infinite)— Full installed-package inventory (pm list + dumpsys join)
usage(infinite)— Per-app last-used, launch count, and standby bucket
storage(infinite)— Per-app code size on disk and app/data/cache totals
mutation-log(infinite)— Audit of the last app-disposition run (dry-run plan or applied result)
reconcile-log(infinite)— Audit of the last desired-state reconcile (plan + applied steps)
appops(infinite)— Per-app operation modes (appops get) for one package
labels(infinite)— Human-readable app names resolved from Play / F-Droid (cached)
permissions(infinite)— Per-app runtime permission grants plus a privacy-category rollup
battery(infinite)— Estimated power use (mAh): global components + per-app totals
app-controls(infinite)— Holders of special-access appops (overlay, all-files, install, ...)
notifications(infinite)— Per-app POST_NOTIFICATIONS posture (can the app notify?)