* add composeui dependencies and component * remove multidex * BaseComponentActivity and HelperBaseComponentActivity * migrate AppPicker/PerAppProxy Activity and use Snackbar * migrate AboutActivity to composeui * migrate BackupActivity to composeui * migrate CheckUpdateActivity to composeui * migrate Logcat to composeui * migrate Scanner to composeui and camerax * migrate sc start/stop/switch to compose * migrate TaskerActivity to composeui * migrate UrlSchemeActivity to composeui * migrate UserAsset to composeui * migrate ServerActivity to composeui * migrate ServerCustomConfigActivity to composeui * migrate ServerGroupActivity to composeui * migrate ServerProxyChainActivity to composeui * migrate SettingsActivity to composeui * migrate SubEdit/SubSetting Activity to composeui * migrate routingEdit/routingSetting Activity to composeui * migrate MainActivity to composeui * clode clean and chore change * Fix * add scrollbar * fix imePadding * fix FormDropdownField scrollbar and ime conflict * update servercostomconfigactivity with linenum and scrollbar * fix AppPickerActivity filter wrong toogle * fix App theme xml * fix scrollbar not work in SettingsActivity * final inset * fix servercustomconfigactivity when open not begin line * try optimize mainactivity performance * use launch intent and fix not refresh when second edit use equals * fix a ghost error * update string * update miss string * optimize mainactivity and mainviewmodel --------- Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com>
194 lines
5.9 KiB
Kotlin
194 lines
5.9 KiB
Kotlin
plugins {
|
|
alias(libs.plugins.android.application)
|
|
alias(libs.plugins.kotlin.android)
|
|
alias(libs.plugins.kotlin.compose)
|
|
id("com.jaredsburrows.license")
|
|
}
|
|
|
|
android {
|
|
namespace = "com.v2ray.ang"
|
|
compileSdk = 37
|
|
|
|
defaultConfig {
|
|
applicationId = "com.v2ray.ang"
|
|
minSdk = 24
|
|
targetSdk = 37
|
|
versionCode = 736
|
|
versionName = "2.2.6"
|
|
|
|
val abiFilterList = (properties["ABI_FILTERS"] as? String)?.split(';')
|
|
splits {
|
|
abi {
|
|
isEnable = true
|
|
reset()
|
|
if (!abiFilterList.isNullOrEmpty()) {
|
|
include(*abiFilterList.toTypedArray())
|
|
} else {
|
|
include(
|
|
"arm64-v8a",
|
|
"armeabi-v7a",
|
|
"x86_64",
|
|
"x86"
|
|
)
|
|
}
|
|
isUniversalApk = abiFilterList.isNullOrEmpty()
|
|
}
|
|
}
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = false
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
}
|
|
}
|
|
|
|
flavorDimensions.add("distribution")
|
|
productFlavors {
|
|
create("fdroid") {
|
|
dimension = "distribution"
|
|
applicationIdSuffix = ".fdroid"
|
|
buildConfigField("String", "DISTRIBUTION", "\"F-Droid\"")
|
|
}
|
|
create("playstore") {
|
|
dimension = "distribution"
|
|
buildConfigField("String", "DISTRIBUTION", "\"Play Store\"")
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
getByName("main") {
|
|
jniLibs.srcDirs("libs")
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
isCoreLibraryDesugaringEnabled = true
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlin {
|
|
compilerOptions {
|
|
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
|
|
}
|
|
}
|
|
|
|
applicationVariants.all {
|
|
val variant = this
|
|
val isFdroid = variant.productFlavors.any { it.name == "fdroid" }
|
|
if (isFdroid) {
|
|
val versionCodes =
|
|
mapOf(
|
|
"armeabi-v7a" to 2, "arm64-v8a" to 1, "x86" to 4, "x86_64" to 3, "universal" to 0
|
|
)
|
|
|
|
variant.outputs
|
|
.map { it as com.android.build.gradle.internal.api.ApkVariantOutputImpl }
|
|
.forEach { output ->
|
|
val abi = output.getFilter("ABI") ?: "universal"
|
|
output.outputFileName = "v2rayNG_${variant.versionName}-fdroid_${abi}.apk"
|
|
if (versionCodes.containsKey(abi)) {
|
|
output.versionCodeOverride =
|
|
(100 * variant.versionCode + versionCodes[abi]!!).plus(5000000)
|
|
} else {
|
|
return@forEach
|
|
}
|
|
}
|
|
} else {
|
|
val versionCodes =
|
|
mapOf("armeabi-v7a" to 4, "arm64-v8a" to 4, "x86" to 4, "x86_64" to 4, "universal" to 4)
|
|
|
|
variant.outputs
|
|
.map { it as com.android.build.gradle.internal.api.ApkVariantOutputImpl }
|
|
.forEach { output ->
|
|
val abi = if (output.getFilter("ABI") != null)
|
|
output.getFilter("ABI")
|
|
else
|
|
"universal"
|
|
|
|
output.outputFileName = "v2rayNG_${variant.versionName}_${abi}.apk"
|
|
if (versionCodes.containsKey(abi)) {
|
|
output.versionCodeOverride =
|
|
(1000000 * versionCodes[abi]!!).plus(variant.versionCode)
|
|
} else {
|
|
return@forEach
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
buildConfig = true
|
|
compose = true
|
|
}
|
|
|
|
packaging {
|
|
jniLibs {
|
|
useLegacyPackaging = true
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
dependencies {
|
|
// Core Libraries
|
|
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.aar", "*.jar"))))
|
|
|
|
// AndroidX Core Libraries
|
|
implementation(libs.androidx.core.ktx)
|
|
|
|
// Compose Libraries
|
|
implementation(platform(libs.androidx.compose.bom))
|
|
androidTestImplementation(platform(libs.androidx.compose.bom))
|
|
|
|
implementation(libs.androidx.activity.compose)
|
|
implementation(libs.androidx.compose.ui)
|
|
implementation(libs.androidx.compose.foundation)
|
|
implementation(libs.androidx.compose.material3)
|
|
implementation(libs.androidx.compose.ui.tooling.preview)
|
|
implementation(libs.lifecycle.runtime.compose)
|
|
|
|
debugImplementation(libs.androidx.compose.ui.tooling)
|
|
|
|
// Data and Storage Libraries
|
|
implementation(libs.mmkv.static)
|
|
implementation(libs.gson)
|
|
implementation(libs.okhttp)
|
|
|
|
// Reactive and Utility Libraries
|
|
implementation(libs.kotlinx.coroutines.android)
|
|
implementation(libs.kotlinx.coroutines.core)
|
|
|
|
// QR Code: CameraX + ZXing
|
|
implementation(libs.camerax.core)
|
|
implementation(libs.camerax.camera2)
|
|
implementation(libs.camerax.lifecycle)
|
|
implementation(libs.camerax.compose)
|
|
implementation(libs.core) // zxing core
|
|
|
|
// AndroidX Lifecycle and Architecture Components
|
|
implementation(libs.lifecycle.viewmodel.ktx)
|
|
implementation(libs.lifecycle.runtime.ktx)
|
|
|
|
// Background Task Libraries
|
|
implementation(libs.work.runtime.ktx)
|
|
implementation(libs.work.multiprocess)
|
|
|
|
// Reorderable list
|
|
implementation(libs.reorderable)
|
|
|
|
// Testing Libraries
|
|
testImplementation(libs.junit)
|
|
androidTestImplementation(libs.androidx.junit)
|
|
androidTestImplementation(libs.androidx.espresso.core)
|
|
testImplementation(libs.org.mockito.mockito.inline)
|
|
testImplementation(libs.mockito.kotlin)
|
|
coreLibraryDesugaring(libs.desugar.jdk.libs)
|
|
}
|