mirror of
https://github.com/2dust/v2rayNG.git
synced 2025-06-28 12:19:52 +00:00
151 lines
5 KiB
Groovy
151 lines
5 KiB
Groovy
apply plugin: 'com.android.application'
|
|
apply plugin: 'kotlin-android'
|
|
|
|
Properties props = new Properties()
|
|
props.load(new FileInputStream(new File('local.properties')))
|
|
|
|
android {
|
|
compileSdkVersion Integer.parseInt("$compileSdkVer")
|
|
buildToolsVersion "$buildToolsVer"
|
|
|
|
compileOptions {
|
|
targetCompatibility = "8"
|
|
sourceCompatibility = "8"
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId "com.v2ray.ang"
|
|
minSdkVersion 21
|
|
targetSdkVersion Integer.parseInt("$targetSdkVer")
|
|
multiDexEnabled true
|
|
versionCode 495
|
|
versionName "1.7.33"
|
|
}
|
|
|
|
if (props["sign"]) {
|
|
signingConfigs {
|
|
release {
|
|
storeFile file("../key.jks")
|
|
keyAlias 'ang'
|
|
keyPassword '123456'
|
|
storePassword '123456'
|
|
}
|
|
debug {
|
|
storeFile file("../key.jks")
|
|
keyAlias 'ang'
|
|
keyPassword '123456'
|
|
storePassword '123456'
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
zipAlignEnabled false
|
|
shrinkResources false
|
|
if (props["sign"]) {
|
|
signingConfig signingConfigs.release
|
|
}
|
|
ndk.abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
|
|
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
debug {
|
|
minifyEnabled false
|
|
zipAlignEnabled false
|
|
shrinkResources false
|
|
if (props["sign"]) {
|
|
signingConfig signingConfigs.release
|
|
}
|
|
ndk.abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
jniLibs.srcDirs = ['libs']
|
|
java.srcDirs += 'src/main/kotlin'
|
|
}
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
splits {
|
|
abi {
|
|
enable true
|
|
reset()
|
|
include 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a' //select ABIs to build APKs for
|
|
universalApk true //generate an additional APK that contains all the ABIs
|
|
}
|
|
}
|
|
|
|
// map for the version code
|
|
project.ext.versionCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4]
|
|
|
|
android.applicationVariants.all { variant ->
|
|
// assign different version code for each output
|
|
variant.outputs.each { output ->
|
|
output.outputFileName = "v2rayNG_" + variant.versionName + "_" + output.getFilter(com.android.build.OutputFile.ABI) + ".apk"
|
|
|
|
output.versionCodeOverride =
|
|
project.ext.versionCodes.get(output.getFilter(com.android.build.OutputFile.ABI), 0) *
|
|
1000000 + android.defaultConfig.versionCode
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
viewBinding true
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar'], exclude: [])
|
|
testImplementation 'junit:junit:4.13.2'
|
|
|
|
// Androidx
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
|
implementation 'androidx.appcompat:appcompat:1.4.2'
|
|
implementation 'com.google.android.material:material:1.6.1'
|
|
implementation 'androidx.cardview:cardview:1.0.0'
|
|
implementation 'androidx.preference:preference-ktx:1.2.0'
|
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
|
implementation 'androidx.fragment:fragment-ktx:1.5.2'
|
|
implementation 'androidx.multidex:multidex:2.0.1'
|
|
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
|
|
|
|
// Androidx ktx
|
|
implementation 'androidx.activity:activity-ktx:1.5.1'
|
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
|
|
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
|
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
|
|
|
|
//kotlin
|
|
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2"
|
|
|
|
implementation 'com.tencent:mmkv-static:1.2.12'
|
|
implementation 'com.google.code.gson:gson:2.8.9'
|
|
implementation 'io.reactivex:rxjava:1.3.4'
|
|
implementation 'io.reactivex:rxandroid:1.2.1'
|
|
implementation 'com.tbruyelle.rxpermissions:rxpermissions:0.9.4@aar'
|
|
implementation 'me.dm7.barcodescanner:core:1.9.8'
|
|
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
|
|
implementation 'com.github.jorgecastilloprz:fabprogresscircle:1.01@aar'
|
|
implementation 'me.drakeet.support:toastcompat:1.1.0'
|
|
implementation 'com.blacksquircle.ui:editorkit:2.1.1'
|
|
implementation 'com.blacksquircle.ui:language-base:2.1.1'
|
|
implementation 'com.blacksquircle.ui:language-json:2.1.1'
|
|
}
|
|
|
|
//buildscript {
|
|
// repositories {
|
|
// google()
|
|
// mavenCentral()
|
|
// maven { url 'https://maven.google.com' }
|
|
// maven { url 'https://jitpack.io' }
|
|
// }
|
|
//}
|