@ -57,8 +57,8 @@ android {
}
}
defaultConfig {
defaultConfig {
// TODO If this is ever modified, change application_id in strings.xml
applicationId = "dev.eden.eden_emulator"
applicationId = "dev.eden.eden_emulator"
minSdk = 28
minSdk = 28
targetSdk = 36
targetSdk = 36
versionName = getGitVersion()
versionName = getGitVersion()
@ -72,8 +72,30 @@ android {
buildConfigField("String", "GIT_HASH", "\"${getGitHash()}\"")
buildConfigField("String", "GIT_HASH", "\"${getGitHash()}\"")
buildConfigField("String", "BRANCH", "\"${getBranch()}\"")
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")
val keystoreFile = System.getenv("ANDROID_KEYSTORE_FILE")
signingConfigs {
signingConfigs {
if (keystoreFile != null) {
if (keystoreFile != null) {
@ -94,7 +116,6 @@ android {
// Define build types, which are orthogonal to product flavors.
// Define build types, which are orthogonal to product flavors.
buildTypes {
buildTypes {
// Signed by release key, allowing for upload to Play Store.
// Signed by release key, allowing for upload to Play Store.
release {
release {
signingConfig = if (keystoreFile != null) {
signingConfig = if (keystoreFile != null) {
@ -103,7 +124,6 @@ android {
signingConfigs.getByName("default")
signingConfigs.getByName("default")
}
}
resValue("string", "app_name_suffixed", "Eden")
isMinifyEnabled = true
isMinifyEnabled = true
isDebuggable = false
isDebuggable = false
proguardFiles(
proguardFiles(
@ -116,7 +136,6 @@ android {
// Attaches 'debug' suffix to version and package name, allowing installation alongside the release build.
// Attaches 'debug' suffix to version and package name, allowing installation alongside the release build.
register("relWithDebInfo") {
register("relWithDebInfo") {
isDefault = true
isDefault = true
resValue("string", "app_name_suffixed", "Eden Debug Release")
signingConfig = signingConfigs.getByName("default")
signingConfig = signingConfigs.getByName("default")
isDebuggable = true
isDebuggable = true
proguardFiles(
proguardFiles(
@ -132,7 +151,6 @@ android {
// Attaches 'debug' suffix to version and package name, allowing installation alongside the release build.
// Attaches 'debug' suffix to version and package name, allowing installation alongside the release build.
debug {
debug {
signingConfig = signingConfigs.getByName("default")
signingConfig = signingConfigs.getByName("default")
resValue("string", "app_name_suffixed", "Eden Debug")
isDebuggable = true
isDebuggable = true
isJniDebuggable = true
isJniDebuggable = true
versionNameSuffix = "-debug"
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 {
android {
flavorDimensions.add("version")
flavorDimensions.add("version")
productFlavors {
productFlavors {
create("mainline") {
create("mainline") {
dimension = "version"
dimension = "version"
// No need to set applicationId here
resValue("string", "app_name_suffixed", "Eden")
}
}
create("genshinSpoof") {
create("genshinSpoof") {
dimension = "version"
dimension = "version"
resValue("string", "app_name_suffixed", "Eden Optimised")
resValue("string", "app_name_suffixed", "Eden Optimiz ed")
applicationId = "com.miHoYo.Yuanshen"
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")
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.() {
tasks.register<Delete>("ktlintReset", fun Delete.() {