shadowsocks-android icon indicating copy to clipboard operation
shadowsocks-android copied to clipboard

Get rid of -V flag

Open Mygod opened this issue 6 years ago • 7 comments

: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:

  1. No more ancillary fd passing;
  2. ~No more go lib patching;~
  3. Easier plugin development.

Cons:

  1. ~Ads might not work if Google is blocked; (unless it goes through Google Service Framework)~
  2. Connection test will have to test through proxy instead of the better testing method through VPN tunnel;
  3. All sockets will use default network and therefore we are no longer using underlying network;
  4. ~Only works on Android 5.0+.~

Mygod avatar Apr 09 '18 04:04 Mygod

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 avatar Apr 09 '18 04:04 madeye

@madeye Yes since we are running plugins under our UID.

Mygod avatar Apr 09 '18 04:04 Mygod

Disclaimer: I actually haven't tested it with plugins. But theoretically it should. But I've had enough debugging for a day.

Mygod avatar Apr 09 '18 06:04 Mygod

Never mind, I submitted a fix for it.

madeye avatar Apr 09 '18 07:04 madeye

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.

Mygod avatar Apr 10 '18 04:04 Mygod

Sure. Let's keep it open in case someone else may find it useful.

madeye avatar Apr 10 '18 04:04 madeye

Since golang/go#9661 is fixed, "go lib patching" is no more necessary in upcoming Go 1.11.

ayanamist avatar May 31 '18 03:05 ayanamist