shadowsocks-android
shadowsocks-android copied to clipboard
Get rid of -V flag
:construction: ONLY INTENDED FOR DEBUGGING PURPOSES DO NOT MERGE :construction:
By disallowing this app itself, every socket created by this app will go through default network automatically. However, since it's called disallowing, Android system won't let us bind to VPN tunnel. Therefore we will have to resort to using proxies to connect with Shadowsocks.
Pros:
- No more ancillary fd passing;
- ~No more go lib patching;~
- Easier plugin development.
Cons:
- ~Ads might not work if Google is blocked; (unless it goes through Google Service Framework)~
- Connection test will have to test through proxy instead of the better testing method through VPN tunnel;
- All sockets will use default network and therefore we are no longer using underlying network;
- ~Only works on Android 5.0+.~
I planed to do this years ago, but it wouldn't work if we need to support Android 4.x at that time.
One concern is about the plugin mode. Would it also work with SIP003 plugin?
@madeye Yes since we are running plugins under our UID.
Disclaimer: I actually haven't tested it with plugins. But theoretically it should. But I've had enough debugging for a day.
Never mind, I submitted a fix for it.
After thinking more about this, I think this is not the way Android VpnService is intended to be used, so even though this might work, it's still more of a hack. I think we could keep this open for plugin developers as a debugger tool?
EDIT: Considering that go 1.11 has been used, and there's no way to "unprotect" the socket if the app adds itself to disallowed applications, it became even less reasonable to merge this.
Sure. Let's keep it open in case someone else may find it useful.
Since golang/go#9661 is fixed, "go lib patching" is no more necessary in upcoming Go 1.11.