Skip to content

SysAdminDoc/OpenTasker

Repository files navigation

OpenTasker

Version License Platform Kotlin

OpenTasker v0.2.59 — a fully open-source, FOSS alternative to Tasker for Android. Profiles, contexts, tasks, actions, day schedule presets/ranges, runtime template argument and condition expansion, per-expression template diagnostics, explicit regex template policy, FOSS geofence evaluation with a live platform location source, a disabled Location evidence template, app-launch service startup, adb-backed location/calendar/sun evidence collection, provider-cadence, unplugged-sample, and post-reconnect unplugged-history gates, background Location event-delivery smoke evidence, balanced provider cadence, policy-aware location setup copy, persisted dwell state, inspector dwell details, and stale-key cleanup, scene library management with text/button/slider/image element editing, task binding pickers, scaled canvas previews, and drag-to-move canvas editing, flow graphs with node deep links, conditional action labels, scrollable lane overviews, screen-reader summaries, and picker-backed Add Context/Add Step shortcuts, JSON bundles, profile sharing manifests, Tasker XML import UI, F-Droid build readiness, dependency version governance, optional Shizuku readiness, optional Termux script readiness, external automation intents, context inspection, notification listener triggers, NFC tag triggers and write helper, calendar/sun triggers with editor presets, and conservative Locale setting/condition plugin host actions with an adb validation harness are active now; broad device-verified background geofence reliability, elevated backends, script execution, and broader plugin UX are planned.

Status: v0.2.59 adds Flow graph deep links, conditional edge labels, lane overviews, accessibility summaries, mutation shortcuts, Scene element editing, scaled previews, drag-to-move layout editing, shorter bottom navigation labels, and the API 36 dependency/toolchain follow-up. v0.2.58 adds a Tasker XML document-picker import flow with bounded preview, migration/capability warnings, confirmed Room import, and disabled-by-default imported profiles. v0.2.57 adds a calendar/sun adb evidence harness and verified the debug app on API 36 device SM-S938B; evidence build/device-evidence/calendar-sun/20260505-152622 shows Calendar access granted, CalendarProvider calendar/instance queries succeeding, and AutomationService foreground after launch. v0.2.48 evidence build/device-evidence/location/20260505-143254 shows a 615.055-second recent unplugged interval that satisfied the 600-second post-reconnect history gate with GPS/network provider cadence evidence present. These remain single-device data points, not broad background geofence reliability claims.


Highlights

Core engine operational — profiles → contexts → tasks → actions pipeline
43 registered action definitions — supported actions run, restricted/script/import-placeholder actions are gated or fail explicitly ✅ Reactive context sources — app foreground, time, day schedules, state, event, WiFi, app-open monitoring, notifications, NFC tag scans/write helper, calendar windows, sunrise/sunset matching, and platform location fixes are wired; broader device-verified background geofencing remains planned runtime work ✅ Template expression runtime — action arguments and conditions support bounded {{ ... }} expansion with scoped variables, arrays, JSON paths, string/math functions, traces, and warnings ✅ FOSS geofence source/evaluator — Location context matching supports platform GPS/network fixes, balanced provider cadence, policy disclosures, radius, accuracy, persisted dwell checks, stale-key cleanup, inspector dwell detail, a Location evidence template, adb run-log/logcat evidence collection, provider-cadence/unplugged-sample/post-reconnect history gates, and API 36 background event-delivery smoke evidence without Play Services ✅ AMOLED-first — Catppuccin Mocha palette, light theme toggle
Compose UI reintegration started — active navigation now manages profiles, tasks, actions, contexts, and run logs from Room
Profile templates — guided starter profiles with variable slots, safety notes, disabled-by-default installation, and a setup-required Location evidence template ✅ Scene element editor — Room-backed scene list/create/delete plus button, text, slider, and image element editing with tap/long-press task bindings, scaled canvas previews, and drag-to-move layout edits ✅ Read-only flow graphs — optional Flow tab maps profiles to contexts, enter/exit tasks, action steps, and warnings ✅ Shizuku readiness — optional package/status detection and elevated-action hints without executing privileged calls ✅ Termux scripting readiness — optional Termux/Termux:Tasker detection and a blocked script action without arbitrary execution ✅ Open JSON bundles — schema-versioned profile/task/context/action/variable/scene export and import planning
Profile sharing manifests — offline share summaries with safety findings and GitHub Discussions submission text ✅ Tasker XML import UI — Tasker XML files can be selected, previewed with migration/capability warnings, and imported into Room as disabled profiles for review ✅ F-Droid readiness — property-based fdroid profile, dependency-policy and metadata checks, local fdroidserver lint/build evidence, and APK payload comparison harness ✅ Dependency governance — Gradle version catalog centralizes plugin/library versions before staged upgrades ✅ Locale plugin host baseline — explicit setting-plugin dispatch, condition-plugin query execution, configuration result parsing, request-query events, package validation, bundle limits, last-known unknown-state fallback, timeout wrapping, and adb validation harness ✅ External automation target — signature-scoped intents to run tasks, toggle profiles, query status, and pass variables ✅ Automation modes — per-profile single, restart, queued, and parallel re-trigger behavior
Setup checklist — notifications, exact alarms, battery optimization, usage access, notification access, overlays, location, Bluetooth, SMS, and DND access
Scheduled time ticks — AlarmManager exact scheduling when allowed, inexact fallback when Android denies exact alarms
WiFi trigger monitor — dynamic NetworkCallback path instead of restricted manifest connectivity broadcasts
App-open monitor — foreground-service-owned UsageStats polling with explicit missing-permission pause behavior
Runtime action registry — UI action IDs map to real implementations or explicit unsupported failures
Capability gating — action picker marks setup requirements and blocks unsupported privileged actions
Run log traces — task history includes action-level status, duration, failure reasons, sanitized template expansions, warning counts, and per-expression diagnostics ✅ Context inspector — live source health, latest observed values, and per-profile match explanations
Notification listener events — notification access can feed event=notification contexts with package/title/body filters
NFC tag events — tag scans can feed event=nfc contexts with normalized tag ID matching
Calendar and sun events — Calendar access feeds redacted event=calendar windows; coordinate-based sunrise/sunset filters support offsets and editor presets; adb smoke evidence covers permission/provider/service readiness
Regression coverage — cron parsing, variable scoping, and template expression edge cases are test-covered ✅ Database persistence — Room DAOs with StateFlow live updates
Action metadata system — dynamic form generation for all 43 registered action definitions ✅ Context configuration UI — editor supports all 6 context families while runtime support continues to harden by family
100% Kotlin — modern, type-safe, coroutine-friendly
Profile execution — AutomationService wired to TaskRunner for context triggers
Run log persistence — task execution history is written to Room
Tasker compat.prj.xml/.tsk.xml exports can be previewed and imported through a disabled-by-default review flow


Architecture

AutomationService (foreground)
  ↓
ProfileMatcher (monitors context streams)
  ↓
ContextSources (app, time, state, event, location)
  ↓
TaskRunner (executes action list)
  ↓
ActionRegistry (built-ins + capability gates + Locale setting and condition plugin dispatch)
  ↓
Room DB (persistent storage)

Contexts

  • Runtime-wired now: Application foreground detection, time ticks, day schedules with presets/ranges, device state broadcasts, event broadcasts, WiFi network changes, app-open monitoring, notification listener events, NFC tag events, calendar windows, sunrise/sunset event filters, and platform location fixes.
  • Configured in UI but still being hardened: Location/geofence contexts. Location matching now receives FOSS platform GPS/network events and supports radius, accuracy, persisted dwell evaluation, a focused API 36 background event-delivery smoke test, and harness gates for provider cadence plus unplugged battery samples or post-reconnect battery history; broader multi-device reliability evidence remains planned runtime work.

Actions (43 registered definitions)

Category Count Examples
Settings 7 WiFi, Bluetooth, brightness, volume, airplane, mobile data, screen timeout
App 7 launch intent, launch app, kill, go home, open URL, SMS, screenshot
File 5 read, write, append, delete, list
Network 4 HTTP GET/POST, ping, download
Media 6 play, stop, pause, next, previous, mute
System 6 vibrate, reboot, lock, screen off/wake, log
Notification 2 notification/toast, TTS speak
Variable 1 set variable
Flow 1 wait
Plugin 2 Locale setting dispatch, Locale condition query
Script 1 gated Termux script run
Import 1 unsupported Tasker action placeholder

Some actions are intentionally disabled or marked setup-required because Android restricts normal apps from changing airplane mode, mobile data, screenshots, reboot, screen-off, and similar privileged operations. Shizuku manager detection and Termux script bridge detection are available only as readiness signals; OpenTasker does not request Shizuku permission, request Termux RUN_COMMAND, execute elevated commands, or run scripts yet.


Build & Run

git clone https://github.com/SysAdminDoc/OpenTasker
cd OpenTasker
./gradlew :app:testDebugUnitTest :app:assembleDebug
# or Release:
./gradlew :app:assembleRelease

Install on device:

adb install -r app/build/outputs/apk/debug/app-debug.apk

Release APKs are unsigned unless OPEN_TASKER_RELEASE_KEYSTORE, OPEN_TASKER_RELEASE_KEYSTORE_PASSWORD, OPEN_TASKER_RELEASE_KEY_ALIAS, and OPEN_TASKER_RELEASE_KEY_PASSWORD are set in the build environment.


Next Phase (v0.3)

  1. Dependency modernization batches — staged AndroidX/Kotlin/Room/WorkManager updates with device verification
  2. Geofence durability — broader background-location behavior evidence and reliability claims across more device/API/provider combinations
  3. Scene resize handles — direct resize/multi-select layout edits before overlay launch
  4. Flow branch visualization — branch/subflow display after explicit flow-control action types exist
  5. Shizuku API opt-in backend — explicit user opt-in, permission request, isolated execution, and run-log audit trail
  6. Termux script dispatch — explicit permission flow, script allowlisting, stdout/stderr capture, and output variable mapping
  7. Sharing preview UI — import warnings, screenshots, permissions, and local review before importing community bundles
  8. Locale condition UX — plugin-backed Condition context rows and clearer setup/error surfaces
  9. Dependency modernization follow-through — staged library/plugin upgrades under the existing Gradle version-catalog plan

Development

  • IDE: Android Studio Koala+ (Kotlin 2.0)
  • Min SDK: 26 (Android 8.0)
  • Target SDK: 35
  • Permissions: foreground service, PACKAGE_USAGE_STATS, system alert window (optional for scenes)
  • Architecture: MVVM with Compose + Room + coroutines

License

MIT — see LICENSE.

Contributing

Issues and pull requests welcome. See ROADMAP.md for planned features.

About

A fully open-source, FOSS alternative to Tasker for Android.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors