diff --git a/core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt b/core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt index b06e10563f..6634028eb1 100644 --- a/core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt +++ b/core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt @@ -103,7 +103,9 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro this.configFile = configFile val config = profile.toJson() plugin?.let { (path, opts, isV2) -> - if (service.isVpnService) opts["V"] = if (isV2) "" else "true" + if (service.isVpnService) { + if (isV2) opts["__android_vpn"] = "" else config.put("plugin_arg", "-V") + } config.put("plugin", path).put("plugin_opts", opts.toString()) } config.put("local_address", DataStore.listenAddress) diff --git a/core/src/main/rust/shadowsocks-rust b/core/src/main/rust/shadowsocks-rust index 988e69d4da..8eaa922aaa 160000 --- a/core/src/main/rust/shadowsocks-rust +++ b/core/src/main/rust/shadowsocks-rust @@ -1 +1 @@ -Subproject commit 988e69d4dab676df9a61daf692765c353f5eb6f9 +Subproject commit 8eaa922aaac511e901bd37283d468f9c940dc995 diff --git a/plugin/CHANGES.md b/plugin/CHANGES.md index 0d49771ecb..e5afc32e40 100644 --- a/plugin/CHANGES.md +++ b/plugin/CHANGES.md @@ -1,6 +1,6 @@ * 2.0.0: * Deprecated passing `-V` and `--fast-open` to plugin. - Please find `V` option passed via plugin options. + Please find `__android_vpn` option passed via plugin options. * Dependency updates: - `androidx.core:core-ktx:1.3.2`; - `androidx.drawerlayout:drawerlayout:1.1.1`; diff --git a/plugin/README.md b/plugin/README.md index 0f5d9f824e..b321b0c145 100644 --- a/plugin/README.md +++ b/plugin/README.md @@ -45,12 +45,10 @@ First you need to get your native binary compiling on Android platform. * [Sample project for C](https://github.com/shadowsocks/simple-obfs-android/tree/4f82c4a4e415d666e70a7e2e60955cb0d85c1615); * [Sample project for Go](https://github.com/shadowsocks/v2ray-plugin-android/tree/172bd4cec0276112828614482fb646b79dbf1540). -In addition to functionalities of a normal plugin, it has to support these additional flags that - may get passed through arguments: +In addition to functionalities of a normal plugin, it has to support these additional options: -* `-V`: VPN mode. In this case, the plugin should pass all file descriptors that needs protecting - from VPN connections (i.e. its traffic will not be forwarded through the VPN) through an - ancillary message to `./protect_path`. +* `__android_vpn`: VPN mode. + In this case, the plugin should pass all file descriptors that needs protecting from VPN connections (i.e. its traffic will not be forwarded through the VPN) through an ancillary message to `./protect_path`. ### Implement a binary provider