必须 root,无 root 无法使用;部分功能需把应用装到 /system/priv-app 才生效;中继模式建议把信道设为 0 自动选择,否则可能创建组失败或中继断开
VPNHotspot
MygodApache-2.0活跃维护在 Android 手机上把 VPN 连接通过热点或中继共享出去,让连上热点的设备也能走 VPN,需要 root 权限。
Share your VPN connection over hotspot or repeater! (root required)
从 GitHub Releases 下载 APK 安装;或通过 Obtainium 添加 https://github.com/Mygod/VPNHotspotREADME 未说明具体硬件要求,仅要求 Android 10-17 设备并具备 root 权限
把手机上的 VPN 连接通过热点或中继共享给其他设备,需要 root 权限
在 Android 手机上把 VPN 连接通过热点或中继共享出去,让连上热点的设备也能走 VPN,需要 root 权限。
核心能力
- 通过热点或 Wi-Fi 中继共享 VPN 连接
- 识别、监控并屏蔽接入的客户端
- 支持用系统 VPN 类应用绕过网络共享限制
- 可作为系统应用安装以获取受限权限
- 适配 Android 10 到 17
容易踩的坑
- v3.0.8最新正式版2026-08-02 · 2026-08-02 04:32 UTC
What's Changed
- Fixes. (#774)
- Bump gradle-wrapper from 9.6.0 to 9.6.1 by @dependabot[bot] in https://github.com/Mygod/VPNHotspot/pull/771.
Full Changelog: https://github.com/Mygod/VPNHotspot/compare/v3.0.7...v3.0.8
- v3.0.72026-06-29 · 2026-06-29 22:06 UTC
查看更新说明
What's Changed
- APKs are now compressed using
tar.xzoverzipfor smaller downloads. Obtainium users will need to update their configs to take advantage of this. It's recommended to use the link from README to update Obtainium config. - Fixes and improvements including accessibility. (#768, #769)
- Bump actions/checkout from 6 to 7 by @dependabot[bot] in https://github.com/Mygod/VPNHotspot/pull/767.
Full Changelog: https://github.com/Mygod/VPNHotspot/compare/v3.0.6...v3.0.7
- APKs are now compressed using
- v3.0.62026-06-20 · 2026-06-20 03:04 UTC
查看更新说明
Fixes and improvements.
UPDATE: Promoted to stable. Please see previous release notes for new features in v3.0.
Important compatibility notes
- Android 10/API 29 or newer is now required. Android 9 users should stay on v2.19.2.
- You should avoid updating to v3 while having VPN tethering active. Either turn it off first or reboot after updating.
- Release APKs are now split by CPU ABI, so sideload users should pick the APK matching their device, and clueless users should use Obtainium for brainless installation + update (click here to install).
- Android 17 is now officially supported.
- Repeater unsafe mode is replaced with a brand new supplicant mode, and safe mode is renamed to framework mode. Supplicant mode now supports strictly more features than framework mode and the old unsafe mode, but requires Android 10+ Wi-Fi HAL. Users stuck running outdated Wi-Fi HAL may consider keep using the older versions or the framework (safe) mode instead. (#762)
- Repeater MAC address customization is removed since it is nonfunctional.
- DHCP workaround is gone. You shouldn't need to use this anyways.
- Installing this app on external storage was a bad idea, and now is explicitly unsupported.
Full Changelog: https://github.com/Mygod/VPNHotspot/compare/v3.0.5...v3.0.6
- v3.0.5v3.0.5-betapre-release2026-06-19 · 2026-06-19 03:40 UTC
查看更新说明
The second beta release of v3 revamps the Repeater functionality which has been ignored in the v3 refactor until now.
Important compatibility notes
- Android 17 is now officially supported.
- Repeater unsafe mode is replaced with a brand new supplicant mode, and safe mode is renamed to framework mode. Supplicant mode now supports strictly more features than framework mode and the old unsafe mode, but requires Android 10+ Wi-Fi HAL. Users stuck running outdated Wi-Fi HAL may consider keep using the older versions or the framework (safe) mode instead. (#762)
- Repeater MAC address customization is removed since it is nonfunctional.
What's Changed
- Added support for repeater connection info display on Android 17+, including Wi-Fi generation, channel width, and Tx/Rx stream count when available.
- Added a repeater configuration method setting: use the standard Android framework path or direct Supplicant mode when needed.
- Added repeater MAC randomization controls on supplicant mode.
- Added support for repeater vendor data customization on supplicant mode on devices with Android 15+ Wi-Fi HAL.
- Fixes.
Full Changelog: https://github.com/Mygod/VPNHotspot/compare/v3.0.4...v3.0.5
- v3.0.4v3.0.4-betapre-release2026-06-10 · 2026-06-10 22:45 UTC
查看更新说明
First v3 beta is here and contains bugfixes from the previous alpha release.
Important compatibility notes
- You should avoid updating to v3 while having VPN tethering active. Either turn it off first or reboot after updating.
- Android 10/API 29 or newer is now required. Android 9 users should stay on v2.19.2.
- Release APKs are now split by CPU ABI, so sideload users should pick the APK matching their device, and clueless users should use Obtainium for brainless installation + update (click here to install).
- DHCP workaround is gone. You shouldn't need to use this anyways.
- Installing this app on external storage was a bad idea, and now is explicitly unsupported.
Full Changelog: https://github.com/Mygod/VPNHotspot/compare/v3.0.3...v3.0.4
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
VPN Hotspot
Connecting things to your VPN made simple. Share your VPN connection over hotspot or repeater. (root required)
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;
- Use this app with some adblock/DNS apps that uses system VPN service APIs, i.e. fake VPNs; (troubleshooting/a list of apps that work)
- Try your luck and simply use this app.
P.S. You can also do the similar on Windows, Mac, and iOS.
Features That Requires System App Installation
The following features in the app requires it to be installed under /system/priv-app since some restricted permissions are required.
One way to do this is to use App systemizer for Magisk.
- (Android 8-10, since app v2.4.0)
android.permission.OVERRIDE_WIFI_CONFIG: Read/write system Wi-Fi hotspot configuration. (#117)
Installing as system app also has the side benefit of launching root daemon less frequently due to having privileged permissions listed below.
android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKSandroid.permission.LOCAL_MAC_ADDRESSandroid.permission.MANAGE_USBandroid.permission.OVERRIDE_WIFI_CONFIGandroid.permission.READ_WIFI_CREDENTIALandroid.permission.TETHER_PRIVILEGEDandroid.permission.WRITE_SECURE_SETTINGS- Other system-app exclusive features that are not gated by permissions.
Whenever you install an app update, if there was a new protected permission addition (last updated in v2.17.1), you should update the app installed in system as well to make the system grant the privileged permission.
Q & A
Search the issue tracker for more.
What persistent changes can this app do to my system?
This app only indirectly write persistent changes through system APIs thus it should be generally pretty safe.
- In Supplicant mode, the repeater asks
wpa_supplicantto create a persistent group on startup, which Android persists in/data/vendor/wifi/wpa/p2p_supplicant.confor/data/misc/wifi/p2p_supplicant.conf. - If you edited the system Wi-Fi hotspot configuration through this app, those changes will persist.
- If you toggle tethering hardware offload through this app, the Android global
tether_offload_disabledsetting will persist. Toggle it back in this app or the matching Developer options setting to revert it.
Routing, firewall, addresses, and daemon/service state managed by this app are cleaned up when stopped, by Clean, or upon reboot.
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:
- Your device doesn't support operating on this channel, or
- 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.
API restrictions are updated up to SHA-256 checksum 9102af02fe6ab68b92464bdff5e5b09f3bd62c65d1130aaf85d3296f17d38074.
Greylisted/blacklisted APIs or internal constants: (some constants are hardcoded or implicitly used)
- (prior to API 30)
Landroid/net/ConnectivityManager;->getLastTetherError(Ljava/lang/String;)I,max-target-r - (prior to API 30)
Landroid/net/ConnectivityManager;->EXTRA_ACTIVE_LOCAL_ONLY:Ljava/lang/String;,lo-prio,max-target-o - (prior to API 30)
Landroid/net/ConnectivityManager;->EXTRA_ACTIVE_TETHER:Ljava/lang/String;,max-target-r - (prior to API 30)
Landroid/net/ConnectivityManager;->EXTRA_AVAILABLE_TETHER:Ljava/lang/String;,max-target-r - (prior to API 30)
Landroid/net/ConnectivityManager;->ACTION_TETHER_STATE_CHANGED:Ljava/lang/String;,max-target-r - (prior to API 30)
Landroid/net/ConnectivityManager;->EXTRA_ERRORED_TETHER:Ljava/lang/String;,max-target-r - (since API 30)
Landroid/net/ConnectivityModuleConnector;->IN_PROCESS_SUFFIX:Ljava/lang/String; - (since API 31)
Landroid/net/INetd$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/INetd; - (since API 31)
Landroid/net/INetd;->ipSecUpdateSecurityPolicy(IIILjava/lang/String;Ljava/lang/String;IIII)V - (since API 30)
Landroid/net/IIntResultListener$Stub;-><init>()V,blocked - (since API 30)
Landroid/net/IIntResultListener;->onResult(I)V,blocked - (since API 30)
Landroid/net/ITetheringConnector;->stopTethering(ILjava/lang/String;Landroid/net/IIntResultListener;)V,blocked - (since API 30)
Landroid/net/ITetheringConnector;->stopTethering(ILjava/lang/String;Ljava/lang/String;Landroid/net/IIntResultListener;)V,blocked - (since API 30)
Landroid/net/TetheringManager$ConnectorConsumer;->onConnectorAvailable(Landroid/net/ITetheringConnector;)V,blocked - (since API 30)
Landroid/net/TetheringManager$TetheringEventCallback;->onTetherableInterfaceRegexpsChanged(Landroid/net/TetheringManager$TetheringInterfaceRegexps;)V,blocked - (since API 31)
Landroid/net/TetheringManager$TetheringEventCallback;->onSupportedTetheringTypes(Ljava/util/Set;)V,blocked - (since API 30)
Landroid/net/TetheringManager;->getConnector(Landroid/net/TetheringManager$ConnectorConsumer;)V,blocked Landroid/net/TetheringManager;->TETHER_ERROR_*:I,blocked- (since API 30)
Landroid/net/TetheringManager;->TETHERING_VIRTUAL:I,blocked - (since API 30)
Landroid/net/TetheringManager;->TETHERING_WIGIG:I,blocked - (since API 31)
Landroid/net/IpSecManager;->DIRECTION_FWD:I,blocked - (since API 31)
Landroid/net/IpSecManager;->INVALID_SECURITY_PARAMETER_INDEX:I,blocked - (since API 31)
Landroid/net/wifi/SoftApCapability;->getCountryCode()Ljava/lang/String;,blocked - (since API 33)
Landroid/net/wifi/SoftApConfiguration$Builder;->setRandomizedMacAddress(Landroid/net/MacAddress;)Landroid/net/wifi/SoftApConfiguration$Builder;,blocked - (since API 31)
Landroid/net/wifi/SoftApConfiguration;->BAND_TYPES:[I,blocked - (since API 31)
Landroid/net/wifi/SoftApInfo;->getApInstanceIdentifier()Ljava/lang/String;,blocked Landroid/net/wifi/ISoftApCallback$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/wifi/ISoftApCallback;,lo-prio,max-target-o- (since API 33)
Landroid/net/wifi/IWifiManager;->registerLocalOnlyHotspotSoftApCallback(Landroid/net/wifi/ISoftApCallback;Landroid/os/Bundle;)V,blocked - (prior to API 31)
Landroid/net/wifi/IWifiManager;->registerSoftApCallback(Landroid/os/IBinder;Landroid/net/wifi/ISoftApCallback;I)V,max-target-o - (since API 31)
Landroid/net/wifi/IWifiManager;->registerSoftApCallback(Landroid/net/wifi/ISoftApCallback;)V,blocked - (since API 33)
Landroid/net/wifi/IWifiManager;->unregisterLocalOnlyHotspotSoftApCallback(Landroid/net/wifi/ISoftApCallback;Landroid/os/Bundle;)V,blocked - (prior to API 31)
Landroid/net/wifi/IWifiManager;->unregisterSoftApCallback(I)V,max-target-o - (since API 31)
Landroid/net/wifi/IWifiManager;->unregisterSoftApCallback(Landroid/net/wifi/ISoftApCallback;)V,blocked - (since API 31)
Landroid/net/wifi/WifiClient;->getApInstanceIdentifier()Ljava/lang/String;,blocked - (prior to API 30)
Landroid/net/wifi/WifiConfiguration;->AP_BAND_2GHZ:I,lo-prio,max-target-o - (prior to API 30)
Landroid/net/wifi/WifiConfiguration;->AP_BAND_5GHZ:I,lo-prio,max-target-o - (prior to API 30)
Landroid/net/wifi/WifiConfiguration;->AP_BAND_ANY:I,lo-prio,max-target-o - (prior to API 30)
Landroid/net/wifi/WifiConfiguration;->apBand:I,unsupported - (prior to API 30)
Landroid/net/wifi/WifiConfiguration;->apChannel:I,unsupported - (since API 30)
Landroid/net/wifi/WifiContext;->ACTION_RESOURCES_APK:Ljava/lang/String;,blocked - (since API 30)
Landroid/net/wifi/WifiContext;-><init>(Landroid/content/Context;)V,blocked Landroid/net/wifi/WifiManager$SoftApCallbackProxy;-><init>(Landroid/net/wifi/WifiManager;Landroid/os/Looper;Landroid/net/wifi/WifiManager$SoftApCallback;)VLandroid/net/wifi/WifiManager$SoftApCallbackProxy;-><init>(Landroid/net/wifi/WifiManager;Ljava/util/concurrent/Executor;Landroid/net/wifi/WifiManager$SoftApCallback;)V,blockedLandroid/net/wifi/WifiManager$SoftApCallbackProxy;-><init>(Landroid/net/wifi/WifiManager;Ljava/util/concurrent/Executor;Landroid/net/wifi/WifiManager$SoftApCallback;I)V,blockedLandroid/net/wifi/WifiManager$SoftApCallbackProxy;-><init>(Ljava/util/concurrent/Executor;Landroid/net/wifi/WifiManager$SoftApCallback;I)V- (prior to API 30)
Landroid/net/wifi/WifiManager$SoftApCallback;->onNumClientsChanged(I)V,greylist-max-o - (since API 33)
Landroid/net/wifi/WifiManager;->EXTRA_PARAM_KEY_ATTRIBUTION_SOURCE:Ljava/lang/String;,blocked Landroid/net/wifi/WifiManager;->cancelLocalOnlyHotspotRequest()V,unsupportedLandroid/net/wifi/WifiManager;->mService:Landroid/net/wifi/IWifiManager;,unsupportedLandroid/net/wifi/p2p/WifiP2pConfig$Builder;->MAC_ANY_ADDRESS:Landroid/net/MacAddress;,blockedLandroid/net/wifi/p2p/WifiP2pConfig$Builder;->mNetworkName:Ljava/lang/String;,blocked- (since API 30)
Landroid/net/wifi/p2p/WifiP2pGroup;->interfaceAddress:[B,unsupported Landroid/net/wifi/p2p/WifiP2pManager;->startWps(Landroid/net/wifi/p2p/WifiP2pManager$Channel;Landroid/net/wifi/WpsInfo;Landroid/net/wifi/p2p/WifiP2pManager$ActionListener;)V,unsupportedLandroid/hardware/wifi/supplicant/V1_0/IfaceType;->P2P:ILandroid/hardware/wifi/supplicant/V1_0/ISupplicant;->getService()Landroid/hardware/wifi/supplicant/V1_0/ISupplicant;Landroid/hardware/wifi/supplicant/V1_0/ISupplicant;->getInterface(Landroid/hardware/wifi/supplicant/V1_0/ISupplicant$IfaceInfo;Landroid/hardware/wifi/supplicant/V1_0/ISupplicant$getInterfaceCallback;)VLandroid/hardware/wifi/supplicant/V1_0/ISupplicant$getInterfaceCallback;->onValues(Landroid/hardware/wifi/supplicant/V1_0/SupplicantStatus;Landroid/hardware/wifi/supplicant/V1_0/ISupplicantIface;)VLandroid/hardware/wifi/supplicant/V1_0/ISupplicant;->listInterfaces(Landroid/hardware/wifi/supplicant/V1_0/ISupplicant$listInterfacesCallback;)VLandroid/hardware/wifi/supplicant/V1_0/ISupplicant$IfaceInfo;->name:Ljava/lang/String;Landroid/hardware/wifi/supplicant/V1_0/ISupplicant$IfaceInfo;->type:ILandroid/hardware/wifi/supplicant/V1_0/ISupplicant$listInterfacesCallback;->onValues(Landroid/hardware/wifi/supplicant/V1_0/SupplicantStatus;Ljava/util/ArrayList;)VLandroid/hardware/wifi/supplicant/V1_0/ISupplicantP2pIface;->asInterface(Landroid/os/IHwBinder;)Landroid/hardware/wifi/supplicant/V1_0/ISupplicantP2pIface;Landroid/hardware/wifi/supplicant/V1_0/SupplicantStatusCode;->FAILURE_ARGS_INVALID:ILandroid/hardware/wifi/supplicant/V1_0/SupplicantStatus;->code:ILandroid/hardware/wifi/supplicant/V1_0/SupplicantStatus;->debugMessage:Ljava/lang/String;Landroid/hardware/wifi/supplicant/V1_2/ISupplicantP2pIface;->addGroup_1_2(Ljava/util/ArrayList;Ljava/lang/String;ZI[BZ)Landroid/hardware/wifi/supplicant/V1_0/SupplicantStatus;Landroid/hardware/wifi/supplicant/V1_2/ISupplicantP2pIface;->castFrom(Landroid/os/IHwInterface;)Landroid/hardware/wifi/supplicant/V1_2/ISupplicantP2pIface;Landroid/hardware/wifi/supplicant/V1_2/ISupplicantP2pIface;->setMacRandomization(Z)Landroid/hardware/wifi/supplicant/V1_0/SupplicantStatus;- (since API 30)
Landroid/os/ServiceManager;->waitForDeclaredService(Ljava/lang/String;)Landroid/os/IBinder;,blocked - (since API 30)
Landroid/os/ServiceManager;->waitForService(Ljava/lang/String;)Landroid/os/IBinder;,blocked - (since API 30)
Lcom/android/server/wifi/SupplicantStaIfaceHalAidlMainlineImpl;->isServiceAvailable(Landroid/content/Context;)Z - (since API 30)
Landroid/system/wifi/mainline_supplicant/IMainlineSupplicant$Stub;->asInterface(Landroid/os/IBinder;)Landroid/system/wifi/mainline_supplicant/IMainlineSupplicant; - (since API 30)
Landroid/system/wifi/mainline_supplicant/IMainlineSupplicant;->getVendorSupplicant()Lcom/android/wifi/x/android/hardware/wifi/supplicant/ISupplicant; - (prior to API 30)
Landroid/provider/Settings$Global;->SOFT_AP_TIMEOUT_ENABLED:Ljava/lang/String;,lo-prio,max-target-o - (on API 34)
Landroid/service/quicksettings/TileService;->mToken:Landroid/os/IBinder;,lo-prio,max-target-o - (prior to API 30)
Lcom/android/internal/R$array;->config_tether_bluetooth_regexs:I,max-target-q - (prior to API 30)
Lcom/android/internal/R$array;->config_tether_usb_regexs:I,max-target-q - (prior to API 30)
Lcom/android/internal/R$array;->config_tether_wifi_regexs:I,max-target-q - (on API 29)
Lcom/android/internal/R$bool;->config_wifi_p2p_mac_randomization_supported:I,blacklist - (prior to API 30)
Lcom/android/internal/R$integer;->config_wifi_framework_soft_ap_timeout_delay:I,greylist-max-o Lcom/android/internal/R$string;->config_ethernet_iface_regex:I,lo-prio,max-target-o- (since API 31)
Lcom/android/server/IpSecService;->FULL_MASK:I - (since API 30)
Lcom/android/server/wifi/p2p/SupplicantP2pIfaceHalAidlBase;->HAL_INSTANCE_NAME:Ljava/lang/String; - (since API 30)
Lcom/android/server/wifi/p2p/SupplicantP2pIfaceHalAidlMainlineImpl;->MAINLINE_SUPPLICANT_SERVICE_NAME:Ljava/lang/String; Lcom/android/server/wifi/p2p/WifiP2pServiceImpl;->ANONYMIZED_DEVICE_ADDRESS:Ljava/lang/String;- (since API 30)
Lcom/android/server/SystemServer;->TETHERING_CONNECTOR_CLASS:Ljava/lang/String; - (since API 33)
Ldalvik/system/BaseDexClassLoader;->pathList:Ldalvik/system/DexPathList;,unsupported - (since API 33)
Ldalvik/system/DexPathList;->nativeLibraryDirectories:Ljava/util/List;,unsupported - (prior to API 33)
Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V,unsupported - (prior to API 33)
Ljava/lang/invoke/MethodHandles$Lookup;->ALL_MODES:I,lo-prio,max-target-o
See mobile/src/hiddenApiStubs for hidden whitelisted/system APIs as well as partial SDK-class stubs.
Nonexported system resources:
- (since API 30)
@com.android.networkstack.tethering:array/config_tether_bluetooth_regexs - (since API 30)
@com.android.networkstack.tethering:array/config_tether_ncm_regexs - (since API 30)
@com.android.networkstack.tethering:array/config_tether_usb_regexs - (since API 30)
@com.android.networkstack.tethering:array/config_tether_wifi_p2p_regexs - (since API 30)
@com.android.networkstack.tethering:array/config_tether_wifi_regexs - (since API 30)
@com.android.networkstack.tethering:array/config_tether_wigig_regexs - (since API 30)
@com.android.wifi.resources:bool/config_wifi_p2p_mac_randomization_supported - (since API 31)
@com.android.wifi.resources:integer/config_wifiFrameworkSoftApShutDownIdleInstanceInBridgedModeTimeoutMillisecond - (since API 30)
@com.android.wifi.resources:integer/config_wifiFrameworkSoftApShutDownTimeoutMilliseconds
Other:
- (prior to API 30) Activity
com.android.settings/.Settings$TetherSettingsActivityis assumed to be exported. - P2P HIDL fallback probes generated supplicant HIDL Java classes from Android 10
wifi-service.jarand Android 11+ AOSP Wi-Fiservice-wifi.jarcom.android.wifi.x.*jarjar packages. - P2P AIDL mode probes the Wi-Fi mainline service
wifi_mainline_supplicantfrom liveservice-wifi.jarto recover the stable vendor supplicant AIDL binder before falling back to direct vendor HAL registration. IPv6 NATmode depends on the iptablesTPROXYandNFQUEUEtargets and transparent sockets. ICMPv6 Echo interception uses app-owned queue30000and assumes queued downstream packets expose six-byte source hardware-address metadata throughNFQA_HWADDR.- (since API 30) Relevant tethering APEX classes used here, including
android.net.ITetheringConnector, may be jarjar-relocated under the optional prefixesandroid.net.connectivityorcom.android.connectivity. - (since API 31) Relevant netd APEX classes used here, including
android.net.INetd*, may be jarjar-relocated under the optional prefixesandroid.net.connectivityorcom.android.connectivity. - (since API 30) When runtime
TetheringEventCallback.onLocalOnlyInterfacesChangedis present, AOSP dispatches startup tether-state callbacks from oneexecutor.execute { ... }block inonCallbackStarted, and later tether-state updates from oneexecutor.execute { ... }block inonTetherStatesChanged. - The Rust DNS proxy submits upstream queries through
android_res_nsend/android_res_nresult. To keep daemon tasks nonblocking while still usingandroid_res_nresultas the public result reader/closer, it waits fordnsproxydto close the one-shotresnsendclient socket before reading the result. This assumesresnsendwrites the complete resolver result before returning and the socket receive buffer can hold that result until the framework socket listener closes the client socket. - For
ip rulepriorities, AOSP local-network/tethering priorities are assumed to be 17000/18000 on API 29..30 and 20000/21000 on API 31+. VPNHotspot uses the 17500..17900 or 20500..20900 gap between them. - For route-table numbers, Android interface tables are assumed to start at ifindex + 1000;
IPv6 NATTPROXY uses table 900 to stay below that range and away from AOSP fixed tables 97..99 and kernel built-ins. - Clean flushes table 900 because that table is reserved by VPNHotspot.
IPv6 NATalso adds its deterministic ULA /64 route to Android's sharedlocal_networkroute table 97; Clean never flushes that table and only deletes VPNHotspot prefixes reconstructed from current interface names. - For packet marks, Android fwmark is assumed to use low bits for netId and routing metadata.
IPv6 NATfwmark fallback for TPROXY uses masked high reserved bits0x10000000/0x10000000. That fallback is expected on only kernels without effectiveFRA_IP_PROTOpolicy-rule support, which upstream Linux added in 4.17. Probe cleanup deletes at most one rule, omittingFRA_IP_PROTOwhen support or the mutation outcome is uncertain; repeated stale-rule deletion is reserved for Clean.- Daemon reply sockets use the AOSP local-network protected mark
0x00030063, which assumesLOCAL_NET_ID = 99plus theexplicitlySelectedandprotectedFromVpnfwmark bits.
System/root command assumptions:
The following Android system binaries are assumed to be bundled and executable:
/system/bin/dumpsys(ipsec);/system/bin/iptables-restore,/system/bin/ip6tables-restore(-w --noflush, restore input commands including-I,-D,-N,-nvx -L <chain>);/system/bin/ndc(ipfwd,nat);/system/bin/settings(put global);/system/bin/linkeror/system/bin/linker64(path.zip!/program).
