Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Enable shrinking #92

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ android {
}
buildTypes {
release {
minifyEnabled false
minifyEnabled true // For release builds only
// Should to try to build before enable ShrinkResources (requires Android Gradle plugin)
// shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,26 +248,7 @@ class YggdrasilTunService : VpnService() {
stopSelf()
}

private fun hasIpv6DefaultRoute(): Boolean {
val cm =
getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
val networks = cm.allNetworks

for (network in networks) {
val linkProperties = cm.getLinkProperties(network)
if(linkProperties!=null) {
val routes = linkProperties.routes
for (route in routes) {
if (route.isDefaultRoute && route.gateway is Inet6Address) {
return true
}
}
}
}
}
return false
}
// private fun hasIpv6DefaultRoute(): Boolean was here

private fun foregroundNotification(FOREGROUND_ID: Int, text: String) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
Expand Down