mirror of
https://github.com/barkeser2002/BarisKeser-ByeDPI.git
synced 2026-09-25 00:59:55 +03:00
Google Play requires apps to target API 36 to keep publishing updates. - compileSdk/targetSdk 35 -> 36 - AGP 8.6.1 -> 8.9.1, Gradle 8.7 -> 8.11.1, Kotlin 1.9.22 -> 1.9.25 (minimum toolchain that supports compileSdk 36) - Pin ndkVersion 27.2.12479018 (r27c) so both native build systems align shared libraries to 16 KB pages by default; add explicit -Wl,-z,max-page-size=16384 to CMake and ndk-build as insurance - CI: install platforms;android-36, build-tools;36.0.0, ndk r27, cmake 3.22.1 - Edge-to-edge: windowOptOutEdgeToEdgeEnforcement is ignored on API 36, so add fitsSystemWindows to the main/settings roots to keep content clear of the status and navigation bars
128 lines
4.2 KiB
Kotlin
128 lines
4.2 KiB
Kotlin
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
}
|
|
|
|
android {
|
|
namespace = "com.bariskeser.byedpi"
|
|
compileSdk = 36
|
|
|
|
// Pin an NDK that aligns native libraries to 16 KB pages by default (r27+).
|
|
// Google Play requires 16 KB page-size support for apps with native code
|
|
// targeting Android 15+ (API 35+). Both build systems (CMake and ndk-build)
|
|
// resolve their toolchain from this version.
|
|
ndkVersion = "27.2.12479018"
|
|
|
|
defaultConfig {
|
|
applicationId = "com.bariskeser.byedpi"
|
|
minSdk = 21
|
|
targetSdk = 36
|
|
versionCode = (findProperty("appVersionCode") as String?)?.toIntOrNull() ?: 11
|
|
versionName = (findProperty("appVersionName") as String?) ?: "2.0.0"
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
ndk {
|
|
abiFilters.add("armeabi-v7a")
|
|
abiFilters.add("arm64-v8a")
|
|
abiFilters.add("x86")
|
|
abiFilters.add("x86_64")
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
buildConfig = true
|
|
}
|
|
|
|
signingConfigs {
|
|
create("release") {
|
|
// Values come from environment variables (CI sets them from GitHub Secrets,
|
|
// or export them locally). Never hard-code keystore paths/passwords in VCS.
|
|
System.getenv("KEYSTORE_FILE")?.let { path ->
|
|
storeFile = file(path)
|
|
storePassword = System.getenv("KEYSTORE_PASSWORD")
|
|
keyAlias = System.getenv("KEY_ALIAS")
|
|
keyPassword = System.getenv("KEY_PASSWORD")
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
buildConfigField("String", "VERSION_NAME", "\"${defaultConfig.versionName}\"")
|
|
|
|
isMinifyEnabled = false
|
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
|
|
|
// Signed only when a keystore is provided (CI with secrets); otherwise
|
|
// assembleRelease still succeeds and produces an unsigned APK.
|
|
signingConfig = System.getenv("KEYSTORE_FILE")?.let {
|
|
signingConfigs.getByName("release")
|
|
}
|
|
}
|
|
debug {
|
|
buildConfigField("String", "VERSION_NAME", "\"${defaultConfig.versionName}-debug\"")
|
|
}
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
}
|
|
kotlinOptions {
|
|
jvmTarget = "1.8"
|
|
}
|
|
externalNativeBuild {
|
|
cmake {
|
|
path = file("src/main/cpp/CMakeLists.txt")
|
|
version = "3.22.1"
|
|
}
|
|
}
|
|
buildFeatures {
|
|
viewBinding = true
|
|
}
|
|
|
|
// https://android.izzysoft.de/articles/named/iod-scan-apkchecks?lang=en#blobs
|
|
dependenciesInfo {
|
|
// Disables dependency metadata when building APKs.
|
|
includeInApk = false
|
|
// Disables dependency metadata when building Android App Bundles.
|
|
includeInBundle = false
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation("androidx.fragment:fragment-ktx:1.8.2")
|
|
implementation("androidx.core:core-ktx:1.13.1")
|
|
implementation("androidx.appcompat:appcompat:1.7.0")
|
|
implementation("androidx.preference:preference-ktx:1.2.1")
|
|
implementation("com.takisoft.preferencex:preferencex:1.1.0")
|
|
implementation("com.google.android.material:material:1.12.0")
|
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.4")
|
|
implementation("androidx.lifecycle:lifecycle-service:2.8.4")
|
|
testImplementation("junit:junit:4.13.2")
|
|
androidTestImplementation("androidx.test.ext:junit:1.2.1")
|
|
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
|
|
}
|
|
|
|
tasks.register<Exec>("runNdkBuild") {
|
|
group = "build"
|
|
|
|
val ndkDir = android.ndkDirectory
|
|
executable = if (System.getProperty("os.name").startsWith("Windows", ignoreCase = true)) {
|
|
"$ndkDir\\ndk-build.cmd"
|
|
} else {
|
|
"$ndkDir/ndk-build"
|
|
}
|
|
setArgs(listOf(
|
|
"NDK_PROJECT_PATH=build/intermediates/ndkBuild",
|
|
"NDK_LIBS_OUT=src/main/jniLibs",
|
|
"APP_BUILD_SCRIPT=src/main/jni/Android.mk",
|
|
"NDK_APPLICATION_MK=src/main/jni/Application.mk"
|
|
))
|
|
|
|
println("Command: $commandLine")
|
|
}
|
|
|
|
tasks.preBuild {
|
|
dependsOn("runNdkBuild")
|
|
} |