Skip to content

Commit

Permalink
pass inbound tag as argument
Browse files Browse the repository at this point in the history
  • Loading branch information
eycorsican committed Feb 23, 2019
1 parent 540466d commit edbb032
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,10 @@ open class SimpleVpnService : VpnService() {
}
sniffing = sniffings.joinToString(",")

val inboundTag = Preferences.getString(applicationContext, getString(R.string.inbound_tag), "tun2socks")

Tun2socks.setLocalDNS("$localDns:53")
val ret = Tun2socks.startV2Ray(flow, service, dbService, configString.toByteArray(), "tun2socks", sniffing, filesDir.absolutePath)
val ret = Tun2socks.startV2Ray(flow, service, dbService, configString.toByteArray(), inboundTag, sniffing, filesDir.absolutePath)
if (ret.toInt() != 0) {
sendBroadcast(Intent("vpn_start_err"))
return@thread
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
<string name="allowed_list">Allowed list</string>
<string name="disallowed_list">Disallowed list</string>
<string name="sniffing">sniffing</string>
<string name="inbound_tag">inbound_tag</string>
</resources>
13 changes: 13 additions & 0 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,17 @@
android:summary="Sniffing settings for the tun2socks inbound."
android:title="Sniffing"
app:iconSpaceReserved="false"></EditTextPreference>

<EditTextPreference
android:defaultValue="tun2socks"
android:key="@string/inbound_tag"
android:summary="Inbound tag for distinguishing traffic coming from tun2socks in routing procedure."
android:title="Inbound Tag"
app:iconSpaceReserved="false"></EditTextPreference>

<Preference
app:key="core_version"
app:title="Core Version"
app:summary="4.17.0"
app:iconSpaceReserved="false"/>
</PreferenceScreen>

0 comments on commit edbb032

Please sign in to comment.