1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-20 14:45:44 +00:00

Merge pull request #109568 from syntaxerror247/export-keystore-check

Android: Only validate keystore relevant to current export mode
This commit is contained in:
Thaddeus Crews
2025-09-16 11:44:43 -05:00

View File

@@ -2853,6 +2853,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);
@@ -2863,14 +2864,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);
@@ -2880,10 +2881,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");