Code Monkey home page Code Monkey logo

Comments (12)

GluTbl avatar GluTbl commented on August 19, 2024 10

it will be a very lentgthy addition to enable tasker integration.

if you want to add with short code, just add some a Broadcastreceiver to receive intent... and trigget hr e action in the source code... Now from the Tasker send the Intent directly.

if you make a tasker plugin... you need to read whole documentation of tasker plugin making.

If i have free time i might add this tasker facility

from vpnhotspot.

Swap-File avatar Swap-File commented on August 19, 2024 3

I recently noticed that VPN Hotspot was able to toggle Bluetooth Tethering off and on without being systemized on android 13.

This interested me greatly, since all the other tools I used to use to toggle BT Tethering off and on refused to work on Android 13, even when systemized.

I've never done Android development before, but I sat down with Android Studio and copy & pasted the Tile Handler into a Broadcast Handler which can receive intents from MacroDroid or Tasker.

Here is what the changes look like if anyone wants to build a copy for themselves (or add more intents to support more automation):
Swap-File@a4024d2

I'm not sure if there is a limit to how many intents you can add to the manifest, but two work fine for me.

Here's what the intent looks like inside of Macrodroid:
image

from vpnhotspot.

Mygod avatar Mygod commented on August 19, 2024 1

A more compelling reason to support this would be for instant tethering. This could be done by checking wifiApConfiguration.SSID and see if it matches ^Instant Tethering .

Unfortunately, listening for ACTION_TETHER_STATE_CHANGED in manifest is not quite possible since Android 8, therefore a persistent foreground service would be needed. MacroDroid only supports listening for hotspot changes, and none at all for Tasker.

EDIT: I created a thread on their forum. Go spam them until they add this.

from vpnhotspot.

Kerrnel avatar Kerrnel commented on August 19, 2024 1

Bump on implementing intent interface. I can not find an app as reliable in turning on & off tethering - just by itself, w/o VPN involvement. I'd love to use it with Llama to automate getting into the car and having tethering for my car radio / off when out. (On a side note... gets me thinking AppleScript for Android should be a thing with object & class interface definition part of every app.)

from vpnhotspot.

hansonxyz avatar hansonxyz commented on August 19, 2024 1

Hi there,

I was really interested in this thread, as my goal was to automate bringing up a wireguard vpn interface and programmatically starting the hotspot via tasker. To do this, I needed to both add the broadcastreceiver to receive the intent to start tethering, as described above, and also have the program automatically monitor all new interfaces that were added. I made these modifications and published them in a modified source code here:

https://github.com/hansonxyz/vpnhotspotmod

The key extra changes to the code Swap-File added was changing the TetheringService from START_NOT_STICKY to START_STICKY, and adding the following code around line 565 on TetheringManager.kt:


                            method.matches1<java.util.List<*>>("onTetheredInterfacesChanged") -> {
                                @Suppress("UNCHECKED_CAST")
                                val tetheredInterfaces = args!![0] as List<String?>
                                callback?.onTetheredInterfacesChanged(tetheredInterfaces)

                                // hansonxyz
                                tetheredInterfaces?.let {
                                    for (iface in it) {
                                        App.app.startForegroundService(
                                            Intent(App.app, TetheringService::class.java)
                                                .putExtra(
                                                    TetheringService.EXTRA_ADD_INTERFACES,
                                                    arrayOf(iface)
                                                )
                                        )
                                    }
                                }
                            }

from vpnhotspot.

sea3pea0 avatar sea3pea0 commented on August 19, 2024

I'm still in the same boat. When I turn my car on, my hotspot is started and to get vpn/hotspot working I have to open the app and hit the wlan switch to route the hotspot through my vpn. I was thinking about trying to automate this process with tasker by opening vpn hotspot after tasker turns the hotspot on and then have tasker use the cli to initiate a screen press over the wlan switch to turn it on. It seems like this might be worth a try since my scenario should be fairly predictable because the only thing I use the phone for is the hotspot connection. I haven't looked at macro droid yet, but I'll have to check it out

from vpnhotspot.

Mygod avatar Mygod commented on August 19, 2024

Meanwhile, I think a good workaround would be a monitoring mode for system VPN tethering. I will implement it in 2.3.0.

from vpnhotspot.

the-mentor avatar the-mentor commented on August 19, 2024

Why not use the tasker plugin system?
https://tasker.joaoapps.com/plugins-intro.html

Awesome app btw!
-DM

from vpnhotspot.

sollermun avatar sollermun commented on August 19, 2024

Has anyone figured out a good way to automatically toggle the rndis0 tunnel? I'm using a phone to act as a usb modem for a router. I've managed to automate turning on the usb hotspot and VPN. The missing piece would be to automatically turn on rndis0 whenever usb tethering is reset.

from vpnhotspot.

cocoands avatar cocoands commented on August 19, 2024

+1 for Tasker integration. I also think making the app compatible with the AutoInput accessibility service would be another good place to start. It should be simpler than writing a new plugin. AutoInput currently can not interact with the VPN Hotspot UI, but if it could, manually toggling the switches as @sea3pea0 and @sollermun describe wouldn't be an issue.

from vpnhotspot.

xangma avatar xangma commented on August 19, 2024

I recently noticed that VPN Hotspot was able to toggle Bluetooth Tethering off and on without being systemized on android 13.

This interested me greatly, since all the other tools I used to use to toggle BT Tethering off and on refused to work on Android 13, even when systemized.

I've never done Android development before, but I sat down with Android Studio and copy & pasted the Tile Handler into a Broadcast Handler which can receive intents from MacroDroid or Tasker.

Here is what the changes look like if anyone wants to build a copy for themselves (or add more intents to support more automation): Swap-File@a4024d2

I'm not sure if there is a limit to how many intents you can add to the manifest, but two work fine for me.

Here's what the intent looks like inside of Macrodroid: ...

Hello! Thanks so much for this information. With your (and an LLM's help) I was able to build and test this in a couple of hours, and it works great. And obviously thanks to the original app developer/s too! :-D

from vpnhotspot.

ibnusaja avatar ibnusaja commented on August 19, 2024

Hi there,

I was really interested in this thread, as my goal was to automate bringing up a wireguard vpn interface and programmatically starting the hotspot via tasker. To do this, I needed to both add the broadcastreceiver to receive the intent to start tethering, as described above, and also have the program automatically monitor all new interfaces that were added. I made these modifications and published them in a modified source code here:

https://github.com/hansonxyz/vpnhotspotmod

The key extra changes to the code Swap-File added was changing the TetheringService from START_NOT_STICKY to START_STICKY, and adding the following code around line 565 on TetheringManager.kt:


                            method.matches1<java.util.List<*>>("onTetheredInterfacesChanged") -> {
                                @Suppress("UNCHECKED_CAST")
                                val tetheredInterfaces = args!![0] as List<String?>
                                callback?.onTetheredInterfacesChanged(tetheredInterfaces)

                                // hansonxyz
                                tetheredInterfaces?.let {
                                    for (iface in it) {
                                        App.app.startForegroundService(
                                            Intent(App.app, TetheringService::class.java)
                                                .putExtra(
                                                    TetheringService.EXTRA_ADD_INTERFACES,
                                                    arrayOf(iface)
                                                )
                                        )
                                    }
                                }
                            }

for adb shell am ? can you hel me for the command line ? thanks before

from vpnhotspot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.