From d4912edf72cdd7cb98b55b34cd9b6d7a4e06dd7b Mon Sep 17 00:00:00 2001 From: Chris <9290150+ChrisBase@users.noreply.github.com> Date: Fri, 26 Jul 2024 18:59:00 +0200 Subject: [PATCH] Fixed Android export failing when no JDK is setup in the OS environment and custom keystores have been set in the export dialog. --- platform/android/export/export_plugin.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index a0da9019c6d5..6f82f9aded98 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -2313,7 +2313,7 @@ String EditorExportPlatformAndroid::get_apksigner_path(int p_target_sdk, bool p_ return apksigner_path; } -static bool has_valid_keystore_credentials(String &r_error_str, const String &p_keystore, const String &p_username, const String &p_password, const String &p_type) { +static bool has_valid_keystore_credentials(String &r_error_str, const String &p_keytool, const String &p_keystore, const String &p_username, const String &p_password, const String &p_type) { String output; List args; args.push_back("-list"); @@ -2323,7 +2323,7 @@ static bool has_valid_keystore_credentials(String &r_error_str, const String &p_ args.push_back(p_password); args.push_back("-alias"); args.push_back(p_username); - Error error = OS::get_singleton()->execute("keytool", args, &output, nullptr, true); + Error error = OS::get_singleton()->execute(p_keytool, args, &output, nullptr, true); String keytool_error = "keytool error:"; bool valid = output.substr(0, keytool_error.length()) != keytool_error; @@ -2340,6 +2340,7 @@ static bool has_valid_keystore_credentials(String &r_error_str, const String &p_ } bool EditorExportPlatformAndroid::has_valid_username_and_password(const Ref &p_preset, String &r_error) { + String keytool = get_keytool_path(); 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); @@ -2350,12 +2351,12 @@ bool EditorExportPlatformAndroid::has_valid_username_and_password(const Ref