Skip to content

Feature request: documented non-UI configuration for fleet/headless installs (drawer + preferences) #553

Description

@djbclark

Problem

We run AutoJs6 as an unattended watchdog on a small device fleet (Termux + Shizuku + wireless ADB). First-time setup must enable several drawer toggles and permissions without human taps:

  • Accessibility service
  • Foreground service (background stability)
  • Shizuku access
  • Post notifications, storage, battery-unrestricted, display-over-other-apps
  • Off: floating button, pointer location, client/server mode, keep-screen-on-in-foreground

Today we automate this with Mac-side UI automation (uiautomator + drawer scrolling). That is fragile (OEM Settings flows, scroll position, localization) and slow.

What we tried

  1. adb shell settings put secure enabled_accessibility_services — works for system accessibility (append-only), but does not set in-app drawer prefs.
  2. Reading/writing SharedPreferences — release APK is not debuggable; adb shell uid 2000 gets Permission denied on /data/data/org.autojs.autojs6/.
  3. Shizuku shell — same data-dir restriction for normal installs.
  4. In-app storages module — script-local only; does not configure app drawer/settings.

Preference keys exist in strings.xml (e.g. key_$_foreground_service, key_$_floating_menu_shown, key_$_enable_a11y_service_with_secure_settings) but there is no documented, supported way to set them outside the UI.

Request

Please consider one or more of:

  1. Document default SharedPreferences file name + keys for drawer toggles (and whether adb/run-as / Shizuku is expected to work on release builds).
  2. Intent or ContentProvider to apply a named profile, e.g. org.autojs.autojs6.APPLY_FLEET_PROFILE with extras or a JSON file path on shared storage.
  3. Export/import settings (XML/JSON) like other Android apps.
  4. Optional install-time defaults via intent extra on first launch (e.g. foreground service ON for automation-only deployments).
  5. Read-only query API so external tooling can verify state without UI scraping.

Our use case

  • Open-source fleet orchestration: stayturgid (AutoJs6 secondary layer; Termux-primary repair; Overall orchistration primarly via ansible, and trying to get as near to being a 100% ansible project as possible).
  • Devices: Pixel / Samsung, Android 14–16, Obtainium-installed release APK (v6.7.x arm64).
  • We already use Shizuku API from scripts; a Shizuku-guarded preference writer would be acceptable.

Workaround today

UI automation in enable_autojs6_shizuku.py + shared/autojs6_drawer_defaults.json. Happy to contribute docs or a reference profile JSON if an official schema exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions