Skip to content

Commit

Permalink
Fix Android 10 Metered
Browse files Browse the repository at this point in the history
  • Loading branch information
Connection Refused authored and Connection Refused committed Feb 16, 2020
1 parent 142b246 commit d2ba4d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,11 @@ class ShadowsocksVpnService : com.bige0.shadowsocksr.BaseVpnService()
private fun startVpn(): FileDescriptor
{
val builder = Builder()
if (Build.VERSION.SDK_INT >= 29)
{
builder.setMetered(false)
}

builder.setSession(profile!!.name)
.setMtu(VPN_MTU)
.addAddress(String.format(Locale.ENGLISH, PRIVATE_VLAN, "1"), 24)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.android.tools.build:gradle:3.5.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"

// NOTE: Do not place your application dependencies here; they belong
Expand Down

0 comments on commit d2ba4d0

Please sign in to comment.