DefinedNet / mobile_nebula

Brings nebula to mobile devices (iOS, Android)
https://defined.net
125 stars 37 forks source link

Feature Request: On android, a parameterized intent to turn nebula networks on or off #83

Open mr-ransel opened 1 year ago

mr-ransel commented 1 year ago

Problem

There's no way to programatically turn on or off nebula networks in the android app.

Solution

Enable a Tasker compatible interface to control nebula networks automatically without needing to build any other custom automation solutions or integrations.

Feature Description

It would be great if we supported a parameterized Android intent that allows for programmatic/automated control of different nebula tunnels, so they could be turned on or off using Tasker, or any other solution capable of triggering specific app intents (automaticall or otherwise).

If you're concerned about the safety of other apps on the phone, a pattern I've seen elsewhere is to add a generated secret available in the app UI somewhere that must be passed into the intent parameters to take effect. Just a generated text field visible under Advanced settings should be sufficient.

Feature Value

This would unlock a ton of value for advanced users, without negatively impacting the app's simplicity of configuration or require the developers to build specific automation options for all the different scenarios where a user might want more particular on/off conditions (time of day, geographic location, always on at boot, only on while on cellular/certain wifi networks, or any number of other errata)

For example, Tasker could be used to turn nebula on or off on different Wireless networks (switching between a dedicated LAN and WAN nebula network for example, or turning nebula on soon after phone boot).

agrawalsourav98 commented 1 year ago

Hey. I was also facing this issue. So, I decided to sort of add this.

Check out the feature on my fork, https://github.com/agrawalsourav98/mobile_nebula/tree/adding_always_on_vpn

I don't know much about Android Programming hence feedback would be great.

To start/stop the vpn, you can launch it using intent (Type: Broadcast, Action: net.defined.mobile_nebula.<START,STOP>_NEBULA, Package: net.defined.mobile_nebula)