diff options
| author | Zephyron <zephyron@citron-emu.org> | 2025-01-13 15:17:39 +1000 |
|---|---|---|
| committer | Zephyron <zephyron@citron-emu.org> | 2025-01-13 15:17:39 +1000 |
| commit | 6d5475a9cf51feb36bb1a45d88b51182ede4a1f8 (patch) | |
| tree | cd1b0e93152d7fb5f59408495a0a4aad10f4bd66 /src/android/app | |
| parent | 2d7f9d921b3508a5c5effba5604aaea5620441ef (diff) | |
Android: Update build system and dependencies
- Update Gradle from 8.1 to 8.10.2
- Update Android Gradle Plugin from 8.1.2 to 8.8.0
- Update Kotlin from 1.9.20 to 2.1.20-Beta1
- Update various AndroidX dependencies to latest versions
- Update NDK from 26.1 to 27.2 (with RC1/RC2 options commented)
- Update Java target from 17 to 21
- Update Android target SDK from 34 to 35
- Enable additional optimizations in release builds:
- Enable shrinkResources
- Use proguard-android-optimize.txt
- Disable JNI debugging
- Replace vector drawables with PNG for ic_citron
- Comment out unused ComputeInline constant in dma_pusher.cpp
- Update Gradle wrapper and configuration files
This updates the Android build system and dependencies to their latest
versions while enabling additional optimizations for release builds.
The ic_citron icon was converted from vector to PNG format for better
compatibility.
Diffstat (limited to 'src/android/app')
| -rw-r--r-- | src/android/app/build.gradle.kts | 56 | ||||
| -rw-r--r-- | src/android/app/src/main/res/drawable/ic_citron.png | bin | 0 -> 10453 bytes | |||
| -rw-r--r-- | src/android/app/src/main/res/drawable/ic_citron.xml | 22 | ||||
| -rw-r--r-- | src/android/app/src/main/res/drawable/ic_citron_full.png | bin | 0 -> 10453 bytes | |||
| -rw-r--r-- | src/android/app/src/main/res/drawable/ic_citron_full.xml | 12 | ||||
| -rw-r--r-- | src/android/app/src/main/res/drawable/ic_citron_title.png | bin | 0 -> 10453 bytes | |||
| -rw-r--r-- | src/android/app/src/main/res/drawable/ic_citron_title.xml | 24 |
7 files changed, 29 insertions, 85 deletions
diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index 4965b9564..793a8621c 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts @@ -10,10 +10,10 @@ plugins { id("com.android.application") id("org.jetbrains.kotlin.android") id("kotlin-parcelize") - kotlin("plugin.serialization") version "1.9.20" + kotlin("plugin.serialization") version "2.1.20-Beta1" id("androidx.navigation.safeargs.kotlin") - id("org.jlleitschuh.gradle.ktlint") version "11.4.0" - id("com.github.triplet.play") version "3.8.6" + id("org.jlleitschuh.gradle.ktlint") version "12.1.2" + id("com.github.triplet.play") version "3.12.1" } /** @@ -27,20 +27,20 @@ val autoVersion = (((System.currentTimeMillis() / 1000) - 1451606400) / 10).toIn android { namespace = "org.citron.citron_emu" - compileSdkVersion = "android-34" - ndkVersion = "26.1.10909125" + compileSdkVersion = "android-35" + ndkVersion = "27.2.12479018" // "28.0.12433566 rc1"// "28.0.12674087 rc2" // "26.1.10909125" buildFeatures { viewBinding = true } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } kotlinOptions { - jvmTarget = "17" + jvmTarget = "21" } packaging { @@ -56,7 +56,7 @@ android { // TODO If this is ever modified, change application_id in strings.xml applicationId = "org.citron.citron_emu" minSdk = 30 - targetSdk = 34 + targetSdk = 35 versionName = getGitVersion() versionCode = if (System.getenv("AUTO_VERSIONED") == "true") { @@ -104,10 +104,13 @@ android { } resValue("string", "app_name_suffixed", "citron") + isDefault = true + isShrinkResources = true isMinifyEnabled = true + isJniDebuggable = false isDebuggable = false proguardFiles( - getDefaultProguardFile("proguard-android.txt"), + getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) } @@ -115,13 +118,12 @@ android { // builds a release build that doesn't need signing // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build. register("relWithDebInfo") { - isDefault = true resValue("string", "app_name_suffixed", "citron Debug Release") signingConfig = signingConfigs.getByName("default") isMinifyEnabled = true isDebuggable = true proguardFiles( - getDefaultProguardFile("proguard-android.txt"), + getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) versionNameSuffix = "-relWithDebInfo" @@ -146,7 +148,7 @@ android { create("mainline") { isDefault = true dimension = "version" - buildConfigField("Boolean", "PREMIUM", "false") + buildConfigField("Boolean", "PREMIUM", "true") // Spoof EA Version } create("ea") { @@ -184,7 +186,7 @@ android { } } -tasks.create<Delete>("ktlintReset") { +tasks.create<Delete>("ktlintReset") { // Deprecated, Still Works. delete(File(buildDir.path + File.separator + "intermediates/ktLint")) } @@ -202,7 +204,7 @@ ktlint { version.set("0.47.1") android.set(true) ignoreFailures.set(false) - disabledRules.set( + disabledRules.set( // Deprecated, Still Works. setOf( "no-wildcard-imports", "package-name", @@ -224,24 +226,24 @@ play { } dependencies { - implementation("androidx.core:core-ktx:1.12.0") - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("androidx.recyclerview:recyclerview:1.3.1") - implementation("androidx.constraintlayout:constraintlayout:2.1.4") - implementation("androidx.fragment:fragment-ktx:1.6.1") + implementation("androidx.core:core-ktx:1.15.0") + implementation("androidx.appcompat:appcompat:1.7.0") + implementation("androidx.recyclerview:recyclerview:1.3.2") + implementation("androidx.constraintlayout:constraintlayout:2.2.0") + implementation("androidx.fragment:fragment-ktx:1.8.5") implementation("androidx.documentfile:documentfile:1.0.1") - implementation("com.google.android.material:material:1.9.0") + implementation("com.google.android.material:material:1.12.0") implementation("androidx.preference:preference-ktx:1.2.1") - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2") + implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7") implementation("io.coil-kt:coil:2.2.2") implementation("androidx.core:core-splashscreen:1.0.1") - implementation("androidx.window:window:1.2.0-beta03") - implementation("androidx.constraintlayout:constraintlayout:2.1.4") + implementation("androidx.window:window:1.3.0") + implementation("androidx.constraintlayout:constraintlayout:2.2.0") implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") - implementation("androidx.navigation:navigation-fragment-ktx:2.7.4") - implementation("androidx.navigation:navigation-ui-ktx:2.7.4") + implementation("androidx.navigation:navigation-fragment-ktx:2.8.5") + implementation("androidx.navigation:navigation-ui-ktx:2.8.5") implementation("info.debatty:java-string-similarity:2.0.0") - implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3") } fun runGitCommand(command: List<String>): String { diff --git a/src/android/app/src/main/res/drawable/ic_citron.png b/src/android/app/src/main/res/drawable/ic_citron.png Binary files differnew file mode 100644 index 000000000..5b6dd81ca --- /dev/null +++ b/src/android/app/src/main/res/drawable/ic_citron.png diff --git a/src/android/app/src/main/res/drawable/ic_citron.xml b/src/android/app/src/main/res/drawable/ic_citron.xml deleted file mode 100644 index 5e2a8efd0..000000000 --- a/src/android/app/src/main/res/drawable/ic_citron.xml +++ /dev/null @@ -1,22 +0,0 @@ -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="200dp" - android:height="200dp" - android:viewportWidth="500" - android:viewportHeight="500"> - <path - android:fillColor="#FF3C28" - android:fillType="nonZero" - android:pathData="M262.66,175.11L262.66,375.05C318.54,375.05 363.85,330.29 363.85,275.08C363.85,219.87 318.54,175.11 262.66,175.11M282.43,197.01C318.67,206 344.09,238.19 344.09,275.11C344.09,312.03 318.67,344.22 282.43,353.2L282.43,197.01" - android:strokeWidth="1.46" - android:strokeColor="#00000000" - android:strokeLineCap="butt" - android:strokeLineJoin="miter" /> - <path - android:fillColor="#0AB9E6" - android:fillType="nonZero" - android:pathData="M237.31,125.11C181.43,125.11 136.12,169.87 136.12,225.08C136.12,280.29 181.43,325.05 237.31,325.05ZM217.57,147.01L217.57,303.2C189.11,296.16 166.67,274.54 158.84,246.6C151.01,218.65 159,188.71 179.75,168.21C190.16,157.86 203.24,150.53 217.57,147.01" - android:strokeWidth="1.46" - android:strokeColor="#00000000" - android:strokeLineCap="butt" - android:strokeLineJoin="miter" /> -</vector> diff --git a/src/android/app/src/main/res/drawable/ic_citron_full.png b/src/android/app/src/main/res/drawable/ic_citron_full.png Binary files differnew file mode 100644 index 000000000..5b6dd81ca --- /dev/null +++ b/src/android/app/src/main/res/drawable/ic_citron_full.png diff --git a/src/android/app/src/main/res/drawable/ic_citron_full.xml b/src/android/app/src/main/res/drawable/ic_citron_full.xml deleted file mode 100644 index 04e458400..000000000 --- a/src/android/app/src/main/res/drawable/ic_citron_full.xml +++ /dev/null @@ -1,12 +0,0 @@ -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="155.3dp" - android:height="172.55dp" - android:viewportWidth="155.3" - android:viewportHeight="172.55"> - <path - android:fillColor="#FF3C28" - android:pathData="M86.28,34.51v138a69,69 0,0 0,0 -138M99.76,49.63a55.57,55.57 0,0 1,0 107.8V49.63" /> - <path - android:fillColor="#0AB9E6" - android:pathData="M69,0a69,69 0,0 0,0 138ZM55.54,15.12v107.8A55.55,55.55 0,0 1,29.75 29.75,55.1 55.1,0 0,1 55.54,15.12" /> -</vector> diff --git a/src/android/app/src/main/res/drawable/ic_citron_title.png b/src/android/app/src/main/res/drawable/ic_citron_title.png Binary files differnew file mode 100644 index 000000000..5b6dd81ca --- /dev/null +++ b/src/android/app/src/main/res/drawable/ic_citron_title.png diff --git a/src/android/app/src/main/res/drawable/ic_citron_title.xml b/src/android/app/src/main/res/drawable/ic_citron_title.xml deleted file mode 100644 index b733e5248..000000000 --- a/src/android/app/src/main/res/drawable/ic_citron_title.xml +++ /dev/null @@ -1,24 +0,0 @@ -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="340.97dp" - android:height="389.85dp" - android:viewportWidth="340.97" - android:viewportHeight="389.85"> - <path - android:fillColor="?attr/colorOnSurface" - android:pathData="M341,268.68v73c0,14.5 -2.24,25.24 -6.83,32.82 -5.92,10.15 -16.21,15.32 -30.54,15.32S279,384.61 273,374.27c-4.56,-7.64 -6.8,-18.42 -6.8,-32.92V268.68a4.52,4.52 0,0 1,4.51 -4.51H273a4.5,4.5 0,0 1,4.5 4.51v72.5c0,33.53 14.88,37.4 26.07,37.4 12.14,0 26.08,-4.17 26.08,-36.71V268.68a4.52,4.52 0,0 1,4.52 -4.51h2.27A4.5,4.5 0,0 1,341 268.68Z" /> - <path - android:fillColor="?attr/colorOnSurface" - android:pathData="M246.49,389.85H178.6c-2.35,0 -4.72,-1.88 -4.72,-6.08a8.28,8.28 0,0 1,1.33 -4.48l60.33,-104.47H186a4.51,4.51 0,0 1,-4.51 -4.51v-1.58a4.51,4.51 0,0 1,4.48 -4.51h0.8c58.69,-0.11 59.12,0 59.67,0.07a5.19,5.19 0,0 1,4 5.8,8.69 8.69,0 0,1 -1.33,3.76l-60.6,104.77h58a4.51,4.51 0,0 1,4.51 4.51v2.21A4.51,4.51 0,0 1,246.49 389.85Z" /> - <path - android:fillColor="?attr/colorOnSurface" - android:pathData="M73.6,268.68v82.06c0,26 -11.8,38.44 -37.12,39.09h-0.12a4.51,4.51 0,0 1,-4.51 -4.51V383a4.51,4.51 0,0 1,4.48 -4.5c18.49,-0.15 26,-8.23 26,-27.9v-2.37A32.34,32.34 0,0 1,59 351.46c-6.39,5.5 -14.5,8.29 -24.07,8.29C12.09,359.75 0,347.34 0,323.86V268.68a4.52,4.52 0,0 1,4.51 -4.51H6.73a4.52,4.52 0,0 1,4.5 4.51v55c0,7.6 1.82,14.22 5,18.18 3.57,4.56 9.17,6.49 18.75,6.49 10.13,0 17.32,-3.76 22,-11.5 3.61,-5.92 5.43,-13.66 5.43,-23V268.68a4.52,4.52 0,0 1,4.51 -4.51h2.22A4.52,4.52 0,0 1,73.6 268.68Z" /> - <path - android:fillColor="?attr/colorOnSurface" - android:pathData="M163.27,268.68v73c0,14.5 -2.24,25.24 -6.84,32.82 -5.92,10.15 -16.2,15.32 -30.53,15.32s-24.62,-5.23 -30.58,-15.57c-4.56,-7.64 -6.79,-18.42 -6.79,-32.92V268.68A4.51,4.51 0,0 1,93 264.17h2.28a4.51,4.51 0,0 1,4.51 4.51v72.5c0,33.53 14.88,37.4 26.07,37.4 12.14,0 26.08,-4.17 26.08,-36.71V268.68a4.51,4.51 0,0 1,4.51 -4.51h2.27A4.51,4.51 0,0 1,163.27 268.68Z" /> - <path - android:fillColor="#ff3c28" - android:pathData="M181.2,42.83V214.17a85.67,85.67 0,0 0,0 -171.34M197.93,61.6a69,69 0,0 1,0 133.8V61.6" /> - <path - android:fillColor="#0ab9e6" - android:pathData="M159.78,0a85.67,85.67 0,1 0,0 171.33ZM143.05,18.77v133.8A69,69 0,0 1,111 36.92a68.47,68.47 0,0 1,32 -18.15" /> -</vector> |
