diff options
| author | Bix <bix@bixed.xyz> | 2025-10-05 05:41:20 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2025-10-05 05:41:20 +0200 |
| commit | 191dd892e57abad3c56f939e83514ab16dec64ed (patch) | |
| tree | c1494c49a2735f11b6bc7d7f0095a5d24df0c561 /src/android | |
| parent | 9f385bf627e40e2b7d5b06cd83cab0a4e9f98f99 (diff) | |
[android] Legacy build flavor (#51)
This adds a "legacy" build flavor, similar to the genshinSpoof flavor. The legacy flavor uses a white icon bg, alongside building with `YUZU_LEGACY=ON`, which applies the previously-made SD865 patches iff that value is truthy.
Co-authored-by: Bixthefin <114880614+Bixthefin@users.noreply.github.com>
Co-authored-by: Calchan <denis.dupeyron@gmail.com>
Co-authored-by: crueter <crueter@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/51
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: crueter <crueter@eden-emu.dev>
Co-authored-by: Bix <bix@bixed.xyz>
Co-committed-by: Bix <bix@bixed.xyz>
Diffstat (limited to 'src/android')
| -rw-r--r-- | src/android/app/build.gradle.kts | 98 | ||||
| -rw-r--r-- | src/android/app/src/main/legacy/drawable/ic_icon_bg.png | bin | 0 -> 39026 bytes | |||
| -rw-r--r-- | src/android/app/src/main/legacy/drawable/ic_icon_bg_orig.png | bin | 0 -> 448880 bytes |
3 files changed, 68 insertions, 30 deletions
diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index e8d8141711..c85da039cb 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts @@ -57,8 +57,8 @@ android { } defaultConfig { - // TODO If this is ever modified, change application_id in strings.xml applicationId = "dev.eden.eden_emulator" + minSdk = 28 targetSdk = 36 versionName = getGitVersion() @@ -72,8 +72,30 @@ android { buildConfigField("String", "GIT_HASH", "\"${getGitHash()}\"") buildConfigField("String", "BRANCH", "\"${getBranch()}\"") + + externalNativeBuild { + cmake { + arguments.addAll(listOf( + "-DENABLE_QT=0", // Don't use QT + "-DENABLE_SDL2=0", // Don't use SDL + "-DENABLE_WEB_SERVICE=1", // Enable web service + "-DENABLE_OPENSSL=ON", + "-DANDROID_ARM_NEON=true", // cryptopp requires Neon to work + "-DYUZU_USE_CPM=ON", + "-DCPMUTIL_FORCE_BUNDLED=ON", + "-DYUZU_USE_BUNDLED_FFMPEG=ON", + "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", + "-DBUILD_TESTING=OFF", + "-DYUZU_TESTS=OFF", + "-DDYNARMIC_TESTS=OFF" + )) + + abiFilters("arm64-v8a") + } + } } + val keystoreFile = System.getenv("ANDROID_KEYSTORE_FILE") signingConfigs { if (keystoreFile != null) { @@ -94,7 +116,6 @@ android { // Define build types, which are orthogonal to product flavors. buildTypes { - // Signed by release key, allowing for upload to Play Store. release { signingConfig = if (keystoreFile != null) { @@ -103,7 +124,6 @@ android { signingConfigs.getByName("default") } - resValue("string", "app_name_suffixed", "Eden") isMinifyEnabled = true isDebuggable = false proguardFiles( @@ -116,7 +136,6 @@ android { // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build. register("relWithDebInfo") { isDefault = true - resValue("string", "app_name_suffixed", "Eden Debug Release") signingConfig = signingConfigs.getByName("default") isDebuggable = true proguardFiles( @@ -132,7 +151,6 @@ android { // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build. debug { signingConfig = signingConfigs.getByName("default") - resValue("string", "app_name_suffixed", "Eden Debug") isDebuggable = true isJniDebuggable = true versionNameSuffix = "-debug" @@ -140,19 +158,62 @@ android { } } + // this is really annoying but idk any other ways to fix this behavior + applicationVariants.all { + val variant = this + when { + variant.flavorName == "legacy" && variant.buildType.name == "debug" -> { + variant.resValue("string", "app_name_suffixed", "Eden Legacy Debug") + } + variant.flavorName == "mainline" && variant.buildType.name == "debug" -> { + variant.resValue("string", "app_name_suffixed", "Eden Debug") + } + variant.flavorName == "genshinSpoof" && variant.buildType.name == "debug" -> { + variant.resValue("string", "app_name_suffixed", "Eden Optimized Debug") + } + variant.flavorName == "legacy" && variant.buildType.name == "relWithDebInfo" -> { + variant.resValue("string", "app_name_suffixed", "Eden Legacy Debug Release") + } + variant.flavorName == "mainline" && variant.buildType.name == "relWithDebInfo" -> { + variant.resValue("string", "app_name_suffixed", "Eden Debug Release") + } + variant.flavorName == "genshinSpoof" && variant.buildType.name == "relWithDebInfo" -> { + variant.resValue("string", "app_name_suffixed", "Eden Optimized Debug Release") + } + } + } + android { flavorDimensions.add("version") productFlavors { create("mainline") { dimension = "version" - // No need to set applicationId here + resValue("string", "app_name_suffixed", "Eden") } create("genshinSpoof") { dimension = "version" - resValue("string", "app_name_suffixed", "Eden Optimised") + resValue("string", "app_name_suffixed", "Eden Optimized") applicationId = "com.miHoYo.Yuanshen" } + + create("legacy") { + dimension = "version" + resValue("string", "app_name_suffixed", "Eden Legacy") + applicationId = "dev.legacy.eden_emulator" + + externalNativeBuild { + cmake { + arguments.add("-DYUZU_LEGACY=ON") + } + } + + sourceSets { + getByName("legacy") { + res.srcDirs("src/main/legacy") + } + } + } } } @@ -162,29 +223,6 @@ android { path = file("../../../CMakeLists.txt") } } - - defaultConfig { - externalNativeBuild { - cmake { - arguments( - "-DENABLE_QT=0", // Don't use QT - "-DENABLE_SDL2=0", // Don't use SDL - "-DENABLE_WEB_SERVICE=1", // Enable web service - "-DENABLE_OPENSSL=ON", - "-DANDROID_ARM_NEON=true", // cryptopp requires Neon to work - "-DYUZU_USE_CPM=ON", - "-DCPMUTIL_FORCE_BUNDLED=ON", - "-DYUZU_USE_BUNDLED_FFMPEG=ON", - "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", - "-DBUILD_TESTING=OFF", - "-DYUZU_TESTS=OFF", - "-DDYNARMIC_TESTS=OFF" - ) - - abiFilters("arm64-v8a") - } - } - } } tasks.register<Delete>("ktlintReset", fun Delete.() { diff --git a/src/android/app/src/main/legacy/drawable/ic_icon_bg.png b/src/android/app/src/main/legacy/drawable/ic_icon_bg.png Binary files differnew file mode 100644 index 0000000000..3327014f8f --- /dev/null +++ b/src/android/app/src/main/legacy/drawable/ic_icon_bg.png diff --git a/src/android/app/src/main/legacy/drawable/ic_icon_bg_orig.png b/src/android/app/src/main/legacy/drawable/ic_icon_bg_orig.png Binary files differnew file mode 100644 index 0000000000..a9fc55a4f5 --- /dev/null +++ b/src/android/app/src/main/legacy/drawable/ic_icon_bg_orig.png |
