Properly support proper VPNs

It turns out that not using masquerade will not work with real VPNs (as opposed to dummy ones, including adblockers and sockifiers).

Fixes #10.
This commit is contained in:
Mygod
2018-03-08 00:41:50 -08:00
parent 4d58183168
commit c7e1abb585
3 changed files with 22 additions and 6 deletions

View File

@@ -296,7 +296,7 @@ class RepeaterService : Service(), WifiP2pManager.ChannelListener, VpnMonitor.Ca
val strict = app.pref.getBoolean("service.repeater.strict", false)
return if (strict && upstream == null || // in this case, nothing to be done
routing.ipForward() // Wi-Fi direct doesn't enable ip_forward
.rule().forward(strict).dnsRedirect(dns).start()) true else {
.rule().forward(strict).masquerade(strict).dnsRedirect(dns).start()) true else {
routing.stop()
Toast.makeText(this, getText(R.string.noisy_su_failure), Toast.LENGTH_SHORT).show()
false