mirror of
https://github.com/tiann/KernelSU.git
synced 2025-02-20 11:43:32 +08:00
Drop `com.google.accompanist` that we needn't it Remove unused metadata, abi Optimize app icon (No visual changes) Update Gradle to 8.10.2 Enable per app language support Optimize `SwitchItem` https://github.com/user-attachments/assets/777729e6-5108-4060-91a7-28b5b9d98441 Refactor the click logic of `ModuleItem` https://github.com/user-attachments/assets/e61da54a-6c1c-45d7-bf27-52b452134b7e Use compose's Text in AboutCard to support dynamicColor  Add scroll behavior for TopAppBar   Fix padding for BottomNavigationBar
136 lines
3.9 KiB
Plaintext
136 lines
3.9 KiB
Plaintext
@file:Suppress("UnstableApiUsage")
|
|
|
|
import com.android.build.gradle.internal.api.BaseVariantOutputImpl
|
|
import com.android.build.gradle.tasks.PackageAndroidArtifact
|
|
|
|
plugins {
|
|
alias(libs.plugins.agp.app)
|
|
alias(libs.plugins.kotlin)
|
|
alias(libs.plugins.compose.compiler)
|
|
alias(libs.plugins.ksp)
|
|
alias(libs.plugins.lsplugin.apksign)
|
|
id("kotlin-parcelize")
|
|
}
|
|
|
|
val managerVersionCode: Int by rootProject.extra
|
|
val managerVersionName: String by rootProject.extra
|
|
|
|
apksign {
|
|
storeFileProperty = "KEYSTORE_FILE"
|
|
storePasswordProperty = "KEYSTORE_PASSWORD"
|
|
keyAliasProperty = "KEY_ALIAS"
|
|
keyPasswordProperty = "KEY_PASSWORD"
|
|
}
|
|
|
|
android {
|
|
namespace = "me.weishu.kernelsu"
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = true
|
|
isShrinkResources = true
|
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
aidl = true
|
|
buildConfig = true
|
|
compose = true
|
|
prefab = true
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "21"
|
|
}
|
|
|
|
packaging {
|
|
jniLibs {
|
|
useLegacyPackaging = true
|
|
}
|
|
resources {
|
|
// https://stackoverflow.com/a/58956288
|
|
// It will break Layout Inspector, but it's unused for release build.
|
|
excludes += "META-INF/*.version"
|
|
// https://github.com/Kotlin/kotlinx.coroutines?tab=readme-ov-file#avoiding-including-the-debug-infrastructure-in-the-resulting-apk
|
|
excludes += "DebugProbesKt.bin"
|
|
// https://issueantenna.com/repo/kotlin/kotlinx.coroutines/issues/3158
|
|
excludes += "kotlin-tooling-metadata.json"
|
|
}
|
|
}
|
|
|
|
externalNativeBuild {
|
|
cmake {
|
|
path("src/main/cpp/CMakeLists.txt")
|
|
}
|
|
}
|
|
|
|
applicationVariants.all {
|
|
outputs.forEach {
|
|
val output = it as BaseVariantOutputImpl
|
|
output.outputFileName = "KernelSU_${managerVersionName}_${managerVersionCode}-$name.apk"
|
|
}
|
|
kotlin.sourceSets {
|
|
getByName(name) {
|
|
kotlin.srcDir("build/generated/ksp/$name/kotlin")
|
|
}
|
|
}
|
|
}
|
|
|
|
// https://stackoverflow.com/a/77745844
|
|
tasks.withType<PackageAndroidArtifact> {
|
|
doFirst { appMetadata.asFile.orNull?.writeText("") }
|
|
}
|
|
|
|
dependenciesInfo {
|
|
includeInApk = false
|
|
includeInBundle = false
|
|
}
|
|
|
|
androidResources {
|
|
generateLocaleConfig = true
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(libs.androidx.activity.compose)
|
|
implementation(libs.androidx.navigation.compose)
|
|
|
|
implementation(platform(libs.androidx.compose.bom))
|
|
implementation(libs.androidx.compose.material.icons.extended)
|
|
implementation(libs.androidx.compose.material)
|
|
implementation(libs.androidx.compose.material3)
|
|
implementation(libs.androidx.compose.ui)
|
|
implementation(libs.androidx.compose.ui.tooling.preview)
|
|
|
|
debugImplementation(libs.androidx.compose.ui.test.manifest)
|
|
debugImplementation(libs.androidx.compose.ui.tooling)
|
|
|
|
implementation(libs.androidx.lifecycle.runtime.compose)
|
|
implementation(libs.androidx.lifecycle.runtime.ktx)
|
|
implementation(libs.androidx.lifecycle.viewmodel.compose)
|
|
|
|
implementation(libs.compose.destinations.core)
|
|
ksp(libs.compose.destinations.ksp)
|
|
|
|
implementation(libs.com.github.topjohnwu.libsu.core)
|
|
implementation(libs.com.github.topjohnwu.libsu.service)
|
|
implementation(libs.com.github.topjohnwu.libsu.io)
|
|
|
|
implementation(libs.dev.rikka.rikkax.parcelablelist)
|
|
|
|
implementation(libs.io.coil.kt.coil.compose)
|
|
|
|
implementation(libs.kotlinx.coroutines.core)
|
|
|
|
implementation(libs.me.zhanghai.android.appiconloader.coil)
|
|
|
|
implementation(libs.sheet.compose.dialogs.core)
|
|
implementation(libs.sheet.compose.dialogs.list)
|
|
implementation(libs.sheet.compose.dialogs.input)
|
|
|
|
implementation(libs.markdown)
|
|
implementation(libs.androidx.webkit)
|
|
|
|
implementation(libs.lsposed.cxx)
|
|
} |