mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 07:53:26 +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:
parent
8aa37cab89
commit
097ccbc5cd
1 changed files with 26 additions and 24 deletions
|
@ -2852,36 +2852,38 @@ bool EditorExportPlatformAndroid::has_valid_export_configuration(const Ref<Edito
|
|||
|
||||
// Validate the rest of the export configuration.
|
||||
|
||||
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_password = p_preset->get_or_env("keystore/debug_password", ENV_ANDROID_KEYSTORE_DEBUG_PASS);
|
||||
if (p_debug) {
|
||||
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_password = p_preset->get_or_env("keystore/debug_password", ENV_ANDROID_KEYSTORE_DEBUG_PASS);
|
||||
|
||||
if ((dk.is_empty() || dk_user.is_empty() || dk_password.is_empty()) && (!dk.is_empty() || !dk_user.is_empty() || !dk_password.is_empty())) {
|
||||
valid = false;
|
||||
err += TTR("Either Debug Keystore, Debug User AND Debug Password settings must be configured OR none of them.") + "\n";
|
||||
}
|
||||
|
||||
// Use OR to make the export UI able to show this error.
|
||||
if ((p_debug || !dk.is_empty()) && !FileAccess::exists(dk)) {
|
||||
dk = EDITOR_GET("export/android/debug_keystore");
|
||||
if (!FileAccess::exists(dk)) {
|
||||
if ((dk.is_empty() || dk_user.is_empty() || dk_password.is_empty()) && (!dk.is_empty() || !dk_user.is_empty() || !dk_password.is_empty())) {
|
||||
valid = false;
|
||||
err += TTR("Debug keystore not configured in the Editor Settings nor in the preset.") + "\n";
|
||||
err += TTR("Either Debug Keystore, Debug User AND Debug Password settings must be configured OR none of them.") + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
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_password = p_preset->get_or_env("keystore/release_password", ENV_ANDROID_KEYSTORE_RELEASE_PASS);
|
||||
// Use OR to make the export UI able to show this error.
|
||||
if (!dk.is_empty() && !FileAccess::exists(dk)) {
|
||||
dk = EDITOR_GET("export/android/debug_keystore");
|
||||
if (!FileAccess::exists(dk)) {
|
||||
valid = false;
|
||||
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_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);
|
||||
|
||||
if ((rk.is_empty() || rk_user.is_empty() || rk_password.is_empty()) && (!rk.is_empty() || !rk_user.is_empty() || !rk_password.is_empty())) {
|
||||
valid = false;
|
||||
err += TTR("Either Release Keystore, Release User AND Release Password settings must be configured OR none of them.") + "\n";
|
||||
}
|
||||
if ((rk.is_empty() || rk_user.is_empty() || rk_password.is_empty()) && (!rk.is_empty() || !rk_user.is_empty() || !rk_password.is_empty())) {
|
||||
valid = false;
|
||||
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)) {
|
||||
valid = false;
|
||||
err += TTR("Release keystore incorrectly configured in the export preset.") + "\n";
|
||||
if (!rk.is_empty() && !FileAccess::exists(rk)) {
|
||||
valid = false;
|
||||
err += TTR("Release keystore incorrectly configured in the export preset.") + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef ANDROID_ENABLED
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue