[PR #2424] feat: add switch support for Tasker by intents #2171 #2802

Open
opened 2026-10-14 21:05:23 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amnezia-client/pull/2424
Author: @good-vi
Created: 3/30/2026
Status: 🔄 Open

Base: dev ← Head: tasker_support


📝 Commits (1)

  • 6d02034 feat: add switch support for Tasker by intents #2171

📊 Changes

3 files changed (+187 additions, -0 deletions)

View changed files

📝 client/android/AndroidManifest.xml (+16 -0)
📝 client/android/src/org/amnezia/vpn/AmneziaVpnService.kt (+8 -0)
➕ client/android/src/org/amnezia/vpn/TaskerReceiver.kt (+163 -0)

📄 Description

Tasker Integration

Sending commands to AmneziaVPN

In Tasker, create a task with a Send Intent action:

Task → Add Action → System → Send Intent

Field Value
Action org.amnezia.vpn.tasker.CONNECT
Package org.amnezia.vpn
Class org.amnezia.vpn.TaskerReceiver
Target Broadcast Receiver

Leave all other fields (Extra, Data, MIME, etc.) blank. Run the task and AmneziaVPN will connect to the last used server.

For DISCONNECT, same setup but Action = org.amnezia.vpn.tasker.DISCONNECT

For TOGGLE, Action = org.amnezia.vpn.tasker.TOGGLE


Reacting to VPN state changes

To react to VPN state changes in Tasker (e.g. show a notification when connected):

  1. Event → System → Intent Received
  2. Set Action = org.amnezia.vpn.tasker.VPN_STATE_CHANGED
  3. In the task that fires, Tasker auto-populates local variables:
    • %state → CONNECTED, DISCONNECTED, CONNECTING, etc.
    • %server_name → name of the active server
    • %protocol → e.g. AmneziaWG

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/amnezia-vpn/amnezia-client/pull/2424 **Author:** [@good-vi](https://github.com/good-vi) **Created:** 3/30/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `tasker_support` --- ### 📝 Commits (1) - [`6d02034`](https://github.com/amnezia-vpn/amnezia-client/commit/6d02034b54f29fcfe10ec956aa596c411200a505) feat: add switch support for Tasker by intents #2171 ### 📊 Changes **3 files changed** (+187 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `client/android/AndroidManifest.xml` (+16 -0) 📝 `client/android/src/org/amnezia/vpn/AmneziaVpnService.kt` (+8 -0) ➕ `client/android/src/org/amnezia/vpn/TaskerReceiver.kt` (+163 -0) </details> ### 📄 Description ## Tasker Integration ### Sending commands to AmneziaVPN In Tasker, create a task with a **Send Intent** action: **Task → Add Action → System → Send Intent** | Field | Value | |---------|----------------------------------| | Action | `org.amnezia.vpn.tasker.CONNECT` | | Package | `org.amnezia.vpn` | | Class | `org.amnezia.vpn.TaskerReceiver` | | Target | Broadcast Receiver | Leave all other fields (Extra, Data, MIME, etc.) blank. Run the task and AmneziaVPN will connect to the last used server. For **DISCONNECT**, same setup but Action = `org.amnezia.vpn.tasker.DISCONNECT` For **TOGGLE**, Action = `org.amnezia.vpn.tasker.TOGGLE` --- ### Reacting to VPN state changes To react to VPN state changes in Tasker (e.g. show a notification when connected): 1. **Event → System → Intent Received** 2. Set Action = `org.amnezia.vpn.tasker.VPN_STATE_CHANGED` 3. In the task that fires, Tasker auto-populates local variables: - `%state` → `CONNECTED`, `DISCONNECTED`, `CONNECTING`, etc. - `%server_name` → name of the active server - `%protocol` → e.g. `AmneziaWG` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#2802
No description provided.