Need help with intents

chaoscreater

Active member
I'm using Windscribe VPN and even though I can use Shortcut Maker to look at the intents used by this app, they don't work. For example, there's a Connect and Disconnect intent and triggering those would just crash the app, so they seem to be useless.

I was able to use adb to do a filter on the intents generated in the background and I've also used Dexplorer to look at the manifest.xml and here's what I've got so far:

08-09 14:18:37.603 2628 2677 I ActivityManager: Background started FGS: Allowed [callingPackage: com.windscribe.vpn; callingUid: 10792; uidState: CEM ; intent: Intent { cmp=com.windscribe.vpn/.backend.ikev2.CharonVpnServiceWrapper (has extras) }; code:ACTIVITY_STARTER; tempAllowListReason:<null>; targetSdkVersion:33; callerTargetSdkVersion:33; startForegroundCount:0; bindFromPackage:null]

08-09 14:18:37.603 2628 2677 W ActivityManager: Background start not allowed: service Intent { cmp=com.windscribe.vpn/.backend.ikev2.CharonVpnServiceWrapper (has extras) } to com.windscribe.vpn/.backend.ikev2.CharonVpnServiceWrapper from pid=23024 uid=10792 pkg=com.windscribe.vpn startFg?=true

08-09 14:18:59.259 2628 4288 W ActivityManager: Background start not allowed: service Intent { act=org.strongswan.android.CharonVpnService.DISCONNECT cmp=com.windscribe.vpn/.backend.ikev2.CharonVpnServiceWrapper } to com.windscribe.vpn/.backend.ikev2.CharonVpnServiceWrapper from pid=23024 uid=10792 pkg=com.windscribe.vpn startFg?=true


08-09 14:21:00.842 2628 2628 D AlarmManager: mPendingIntent -> PendingIntent{c90c53b: PendingIntentRecord{36c374a com.windscribe.vpn broadcastIntent}}

08-09 14:21:15.828 2628 3058 I ActivityManager: Background started FGS: Allowed [callingPackage: com.windscribe.vpn; callingUid: 10792; uidState: SVC ; intent: Intent { cmp=com.windscribe.vpn/.backend.ikev2.CharonVpnServiceWrapper (has extras) }; code:ACTIVITY_STARTER; tempAllowListReason:<null>; targetSdkVersion:33; callerTargetSdkVersion:33; startForegroundCount:2; bindFromPackage:null]


<service
name="com.windscribe.vpn.backend.ikev2.CharonVpnServiceWrapper"
permission="android.permission.BIND_VPN_SERVICE" />

<service
name="org.strongswan.android.logic.CharonVPNService"
permission="android.permission.BIND_VPN_SERVICE"
exported="true">
<intent-filter>
<action name="android.net.VPNService" />
</intent-filter>
</service>

I've set up intents using the Send Intent action in MacroDroid before, but they were pretty basic ones. In this case, the Windscribe intents in the logs include the "permission" property and some additional "extras". Based on the above, how can I set this up in MacroDroid? My goal is to simply automate connecting to the VPN. There's also a quick tile that you can tap on to connect/disconnect Windscribe VPN. Tapping it manually works fine, but I can't seem to automate this. None of the configurations I've tried work.

I'm aware that you can use UI Interaction with MacroDroid or tasker, but ideally I'd like to avoid that and just invoke the connection on/off via proper methods.
 
Last edited:

Dimlos

Well-known member
For Pro, it seems that .ovpn can be created with OpenVPN Config Generator, so I believe it is possible to use OpenVPN to control the connection with an intent.
Sorry, but I was not willing to pay to verify this, so please do so at your own risk.
Proton VPN can create .ovpn for free, so if you are not particular, Proton VPN may be easier.
 

chaoscreater

Active member
I'm not using Pro, just using the free version with 50GB of data. I have multiple accounts, each with 50GB, so there's no need to get the Pro version.

At the moment, I can automate it using shell script (which is a bit better than using UI Interaction, depending on the scenario). Here's what I have:

cmd statusbar expand-settings
cmd statusbar click-tile com.windscribe.vpn/.services.VpnTileService

However, ideally I'd want to get this working using intent. Also tried this via ADB and it sorta worked but not really. It shows that it's connecting to a VPN server in a generated notification, but it never connects and Windscribe just crashes.

adb shell am start-foreground-service -n com.windscribe.vpn.backend.ikev2.CharonVpnServiceWrapper -a android.net.VpnService


Also, it seems like the Pro option gives you OpenVPN and Wireguard connection options. The CharonVPNService is what seems to be the method/protocol used in the free version. But none of those do anything when I tried them. I basically extracted the manifest.xml and let ChatGPT scan them and try to come up with combinations of what to use for the intent configuration:

index.php
 

Attachments

  • 1691579368778.png
    1691579368778.png
    60.9 KB · Views: 37
Top