1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Android: Only validate keystore relevant to current export mode

- Debug builds skip release keystore validation.
- Release builds skip debug keystore validation.
This commit is contained in:
Anish Mishra
2025-08-13 13:35:50 +05:30
parent 8aa37cab89
commit 097ccbc5cd

View File

@@ -2852,6 +2852,7 @@ bool EditorExportPlatformAndroid::has_valid_export_configuration(const Ref<Edito
// Validate the rest of the export configuration. // Validate the rest of the export configuration.
if (p_debug) {
String dk = _get_keystore_path(p_preset, true); String dk = _get_keystore_path(p_preset, true);
String dk_user = p_preset->get_or_env("keystore/debug_user", ENV_ANDROID_KEYSTORE_DEBUG_USER); String dk_user = p_preset->get_or_env("keystore/debug_user", ENV_ANDROID_KEYSTORE_DEBUG_USER);
String dk_password = p_preset->get_or_env("keystore/debug_password", ENV_ANDROID_KEYSTORE_DEBUG_PASS); String dk_password = p_preset->get_or_env("keystore/debug_password", ENV_ANDROID_KEYSTORE_DEBUG_PASS);
@@ -2862,14 +2863,14 @@ bool EditorExportPlatformAndroid::has_valid_export_configuration(const Ref<Edito
} }
// Use OR to make the export UI able to show this error. // Use OR to make the export UI able to show this error.
if ((p_debug || !dk.is_empty()) && !FileAccess::exists(dk)) { if (!dk.is_empty() && !FileAccess::exists(dk)) {
dk = EDITOR_GET("export/android/debug_keystore"); dk = EDITOR_GET("export/android/debug_keystore");
if (!FileAccess::exists(dk)) { if (!FileAccess::exists(dk)) {
valid = false; valid = false;
err += TTR("Debug keystore not configured in the Editor Settings nor in the preset.") + "\n"; err += TTR("Debug keystore not configured in the Editor Settings nor in the preset.") + "\n";
} }
} }
} else {
String rk = _get_keystore_path(p_preset, false); String rk = _get_keystore_path(p_preset, false);
String rk_user = p_preset->get_or_env("keystore/release_user", ENV_ANDROID_KEYSTORE_RELEASE_USER); String rk_user = p_preset->get_or_env("keystore/release_user", ENV_ANDROID_KEYSTORE_RELEASE_USER);
String rk_password = p_preset->get_or_env("keystore/release_password", ENV_ANDROID_KEYSTORE_RELEASE_PASS); String rk_password = p_preset->get_or_env("keystore/release_password", ENV_ANDROID_KEYSTORE_RELEASE_PASS);
@@ -2879,10 +2880,11 @@ bool EditorExportPlatformAndroid::has_valid_export_configuration(const Ref<Edito
err += TTR("Either Release Keystore, Release User AND Release Password settings must be configured OR none of them.") + "\n"; err += TTR("Either Release Keystore, Release User AND Release Password settings must be configured OR none of them.") + "\n";
} }
if (!p_debug && !rk.is_empty() && !FileAccess::exists(rk)) { if (!rk.is_empty() && !FileAccess::exists(rk)) {
valid = false; valid = false;
err += TTR("Release keystore incorrectly configured in the export preset.") + "\n"; err += TTR("Release keystore incorrectly configured in the export preset.") + "\n";
} }
}
#ifndef ANDROID_ENABLED #ifndef ANDROID_ENABLED
String java_sdk_path = EDITOR_GET("export/android/java_sdk_path"); String java_sdk_path = EDITOR_GET("export/android/java_sdk_path");