Skip to content

Commit

Permalink
Merge pull request HMBSbige#41 from ConnectionRefused/master
Browse files Browse the repository at this point in the history
Fix Android 10 Metered
  • Loading branch information
HMBSbige authored Feb 18, 2020
2 parents 142b246 + d2ba4d0 commit 39d46b1
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 39d46b1

Please sign in to comment.