Commit 6dace959 authored by Mygod's avatar Mygod

Split ABIs for smaller apk size

parent d5c1455a
import com.android.build.OutputFile
import java.util.regex.Matcher import java.util.regex.Matcher
import java.util.regex.Pattern import java.util.regex.Pattern
...@@ -19,7 +20,7 @@ android { ...@@ -19,7 +20,7 @@ android {
applicationId "com.github.shadowsocks" applicationId "com.github.shadowsocks"
minSdkVersion rootProject.minSdkVersion minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.sdkVersion targetSdkVersion rootProject.sdkVersion
versionCode 200 versionCode 1
versionName "4.4.0" versionName "4.4.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary true vectorDrawables.useSupportLibrary true
...@@ -37,6 +38,15 @@ android { ...@@ -37,6 +38,15 @@ android {
} }
lintOptions { lintOptions {
abortOnError false abortOnError false
checkReleaseBuilds false
}
splits {
abi {
enable true
reset()
include 'armeabi-v7a', 'arm64-v8a', 'x86'
universalApk false
}
} }
sourceSets.main.jniLibs.srcDirs += sourceSets.main.jniLibs.srcDirs +=
new File(project(':core').buildDir, "intermediates/bundles/${getCurrentFlavor()}/jni") new File(project(':core').buildDir, "intermediates/bundles/${getCurrentFlavor()}/jni")
...@@ -78,3 +88,11 @@ repositories { ...@@ -78,3 +88,11 @@ repositories {
} }
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'
ext.abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2, x86: 3]
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
if (baseAbiVersionCode != null) output.versionCodeOverride = baseAbiVersionCode * 1000 + variant.versionCode
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment