GithubHelp home page GithubHelp logo

lwgboy / vpnhotspot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from coder-cuizw/vpnhotspot

0.0 1.0 0.0 1.3 MB

Share your VPN connection over hotspot or repeater! (root required)

License: Apache License 2.0

Kotlin 100.00%

vpnhotspot's Introduction

VPN Hotspot

CircleCI API Releases F-Droid Language: Kotlin Codacy Badge License

Connecting things to your VPN made simple. Share your VPN connection over hotspot or repeater. (root required)
or XDA Labs

This app is useful for:

  • Connecting things that don't support VPN like Chromecasts behind corporate firewalls;
  • Setting up gapps behind corporate firewalls;
  • Connecting to your mobile hotspot but you're not bothered to set up VPN on your device;
  • Identifying, monitoring and blocking (unwanted) clients;
  • Bypassing tethering limits by:
    • (recommended) Use this app with a real VPN/socksifier; (ad-blocker may not work)
    • (might or might not work based on your carrier) Use this app with TTL editor like TTL Master;
    • Try your luck and simply use this app.

P.S. You can also do the similar on Windows, Mac, and iOS. I don't know about you but I can't get my stupid Windows 10 to work with hosted network now that they introduced this Mobile hotspot.

Settings and How to Use Them

Default settings are picked to suit general use cases and maximize compatibility but it might not be optimal for battery life.

Upstream

  • Upstream network interface: Main upstream used to reroute traffic. Leave blank for auto detect system VPN. Put none (or other similarly invalid entries) to suppress tethering VPN. Put your interface name for tethering WireGuard.
  • IP Masquerade Mode:
    • None: Nothing will be done to remap address/port from downstream. I find turning this option off sometimes works better for dummy VPNs like ad-blockers and socksifiers than Simple mode, e.g. Shadowsocks. But you should never use this for real VPNs like OpenVPN, WireGuard, etc.
    • Simple: Source address/port from downstream packets will be remapped and that's about it.
    • Android Netd Service: Let your system handle masquerade. Android system will do a few extra things to make things like FTP and tethering traffic counter work. You should probably not use this if you are trying to hide your tethering activity from your carrier.

Downstream

  • Disable IPv6 tethering: Turning this option on will disable IPv6 for system tethering. Useful for stopping IPv6 leaks as this app currently doesn't handle IPv6 VPN tethering (see #6).
  • Enable DHCP workaround: Only used if your device isn't able to get your clients IP addresses with VPN on. This is a global setting, meaning it will only be applied once globally.

Misc

  • Keep Wi-Fi alive: Acquire Wi-Fi locks when repeater, temporary hotspot or system VPN hotspot is activated.
    • Choose "System default" to save battery life;
    • Choose "On" (default) if repeater/hotspot turns itself off automatically or stops working after a while;
    • Choose "High Performance Mode" to minimize packet loss and latency (will consume more power).
  • Start repeater on boot: Self explanatory.
  • Network status monitor mode: This option controls how the app monitors connected devices as well as interface changes (when custom upstream is used). Requires restarting the app to take effects. (best way is to go to app info and force stop)
    • Netlink monitor: Use Linux netlink mechanism, most battery efficient but may not work with SELinux enforcing mode. Sometimes auto fallbacks to Netlink monitor with root and Poll.
    • Netlink monitor with root: Same as above but runs netlink as root. This option works well with SELinux enforcing mode but might still be bugged on devices heavily modified by OEM and/or carriers. Sometimes auto fallbacks to Poll.
    • Poll: (default) Update network information manually every second. Least battery efficient but it should work on most devices. Recommended to switch to other modes if possible.
    • Poll with root: Same as Poll but polling is done using a root shell.

Q & A

Search the issue tracker for more.

What changes exactly can this app do to my system? (and how to revert them)

Unable to find "Tethering hardware acceleration" in Developer options?

No root?

Failed to create group due to internal error/repeater shuts down after a while?

This could caused by the Wi-Fi channel you selected is no longer available, due to:

  1. Your device doesn't support operating on this channel, or
  2. There is some nearby Wi-Fi direct device that broadcasted that it can't operate on the channel you picked.

For maximum stability, you need to set channel = 0 so that your device will pick a channel automatically. You can also use WPS to connect your 2.4GHz-only device to force the repeater to switch from 5GHz to 2.4GHz for this time.

Private APIs used / Assumptions for Android customizations

a.k.a. things that can go wrong if this app doesn't work.

This is a list of stuff that might impact this app's functionality if unavailable. This is only meant to be an index. You can read more in the source code.

Undocumented API list:

Undocumented system configurations:

  • @android:array/config_tether_usb_regexs
  • @android:array/config_tether_wifi_regexs
  • @android:array/config_tether_wimax_regexs
  • @android:array/config_tether_bluetooth_regexs

Other:

For ip rule priorities, RULE_PRIORITY_SECURE_VPN and RULE_PRIORITY_TETHERING is assumed to be 12000 and 18000 respectively; RULE_PRIORITY_DEFAULT_NETWORK is assumed to be 22000 (or at least > 18000) for API 27-. DHCP server like dnsmasq is assumed to run and send DHCP packets as root.

Undocumented system binaries are all bundled and executable:

  • Since API 24: iptables-save;
  • echo;
  • ip (link monitor neigh rule with proper output format);
  • ndc (ipfwd with proper output format since API 23, nat);
  • iptables (with correct version corresponding to API level, -nvx -L <chain> with proper output format);
  • su.

If some of these are unavailable, you can alternatively install a recent version (v1.28.1 or higher) of Busybox.

Wi-Fi driver wpa_supplicant:

vpnhotspot's People

Contributors

dwuku avatar ferhadnecef avatar mygod avatar

Watchers

 avatar

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.