-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ignorenetworkstate restriction, to allow tunnel over USB #1746
Conversation
This not connected or exposed anywhere in the UI. How would anyone use this feature? |
In my case, I plan to use it by setting the restriction via DevicePolicyManager#setApplicationRestrictions from a Device Owner application. I actually already have an implementation of such app, that I set as Device Owner via ADB. |
Yeah, but it would be good if that could be set like the other device restrictions that set the global configuration setting and using the central device restriction parser and added to the xml file that describes the device restrictions of ics-openvpn. Currently, it seems more like a hack since it ignores the already existing device restriction infrastructure. |
Makes sense. BTW, how do you use/test the restriction definition? Via an app or MDM UI? |
By the way, I tried to sign the Contributor License Agreement, but it seems that the URL isn't valid anymore... |
@EliyahuSternDAI I ussually use the google DPC test program. But I still don't think this is should be done this way. All other restrictions are parsed and applied in I think your new option should also be added the the |
@schwabe the reason for reading the value lazily only once, is because I have noticed during debugging that |
The last version looks much better. Is it okay for you when I squash the commits or do you want to squash the commits yourself? |
Actually, I have some more uncommitted changes (add the option to If you think the code is Ok as is, it's great if you can squash it and I'll come back to completing the other UI related changes as soon as I can. |
…#1746) * Add ignorenetworkstate restriction, to allow tunnel over USB * Add to app_restrictions.xml * Parse restriction value into SharedPreferences Co-authored-by: Eliyahu Stern <[email protected]>
…#1746) * Add ignorenetworkstate restriction, to allow tunnel over USB * Add to app_restrictions.xml * Parse restriction value into SharedPreferences Co-authored-by: Eliyahu Stern <[email protected]>
…#1746) * Add ignorenetworkstate restriction, to allow tunnel over USB * Add to app_restrictions.xml * Parse restriction value into SharedPreferences Co-authored-by: Eliyahu Stern <[email protected]>
OpenVPN for Android can be used for reverse tethering (similar to Gnirehtet).
In general, what it requires is:
remote localhost <port>
instruction, so that the client connects to a local tcp portadb reverse tcp:<port> tcp:<host_port>
on the host, where<port>
is the same as above, and<host_port>
is OpenVPN Server port on the USB host, or another port forward.One problem with such setup, is that although it does not rely on any physical (e.g. Wi-Fi) network, turning off all such networks will cause tunnel shutdown.
This PR aims to allow changing that default behavior, by setting
ignorenetworkstate
tofalse
. This will instruct OpenVPN for Android to keep the tunnel connected also when there is no network.