-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get rid of -V flag #1742
base: master
Are you sure you want to change the base?
Get rid of -V flag #1742
Conversation
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. |
@@ -159,6 +159,8 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface { | |||
} | |||
} | |||
if (profile.bypass) builder.addDisallowedApplication(me) | |||
} else { | |||
builder.addDisallowedApplication(packageName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After adding these two lines, I can no longer reproduce #1740. Good catch though!
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. |
ae23132
to
fa96067
Compare
b869953
to
9b51f91
Compare
🚧 ONLY INTENDED FOR DEBUGGING PURPOSES DO NOT MERGE 🚧
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 go lib patching;Cons:
Ads might not work if Google is blocked; (unless it goes through Google Service Framework)Only works on Android 5.0+.