diff options
| author | Michael Alexsander <michaelalexsander@protonmail.com> | 2023-06-11 14:01:39 -0300 |
|---|---|---|
| committer | Michael Alexsander <michaelalexsander@protonmail.com> | 2023-06-19 01:00:13 -0300 |
| commit | 41a75cfa4f289fa43398a1bc0dab009783dc7d1a (patch) | |
| tree | 602e57c555d896f343833a86adc0820db9021f9d /platform | |
| parent | 116f783db73f4bf7e9e96ae54dd3d0a20337cc8a (diff) | |
| download | redot-engine-41a75cfa4f289fa43398a1bc0dab009783dc7d1a.tar.gz | |
Allow exporting release Android builds without a debug keystore
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/android/export/export_plugin.cpp | 11 | ||||
| -rw-r--r-- | platform/android/export/export_plugin.h | 2 | ||||
| -rw-r--r-- | platform/ios/export/export_plugin.cpp | 2 | ||||
| -rw-r--r-- | platform/ios/export/export_plugin.h | 2 | ||||
| -rw-r--r-- | platform/macos/export/export_plugin.cpp | 2 | ||||
| -rw-r--r-- | platform/macos/export/export_plugin.h | 2 | ||||
| -rw-r--r-- | platform/uwp/export/export_plugin.cpp | 2 | ||||
| -rw-r--r-- | platform/uwp/export/export_plugin.h | 2 | ||||
| -rw-r--r-- | platform/web/export/export_plugin.cpp | 2 | ||||
| -rw-r--r-- | platform/web/export/export_plugin.h | 2 | ||||
| -rw-r--r-- | platform/windows/export/export_plugin.cpp | 4 | ||||
| -rw-r--r-- | platform/windows/export/export_plugin.h | 2 |
12 files changed, 18 insertions, 17 deletions
diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index 6030239695..cb82091073 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -2227,7 +2227,7 @@ String EditorExportPlatformAndroid::get_apksigner_path(int p_target_sdk, bool p_ return apksigner_path; } -bool EditorExportPlatformAndroid::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const { +bool EditorExportPlatformAndroid::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug) const { String err; bool valid = false; const bool gradle_build_enabled = p_preset->get("gradle_build/use_gradle_build"); @@ -2286,7 +2286,8 @@ bool EditorExportPlatformAndroid::has_valid_export_configuration(const Ref<Edito err += TTR("Either Debug Keystore, Debug User AND Debug Password settings must be configured OR none of them.") + "\n"; } - if (!FileAccess::exists(dk)) { + // 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)) { valid = false; @@ -2303,7 +2304,7 @@ 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"; } - if (!rk.is_empty() && !FileAccess::exists(rk)) { + if (!p_debug && !rk.is_empty() && !FileAccess::exists(rk)) { valid = false; err += TTR("Release keystore incorrectly configured in the export preset.") + "\n"; } @@ -2323,7 +2324,7 @@ bool EditorExportPlatformAndroid::has_valid_export_configuration(const Ref<Edito valid = false; } - // Validate that adb is available + // Validate that adb is available. String adb_path = get_adb_path(); if (!FileAccess::exists(adb_path)) { err += TTR("Unable to find Android SDK platform-tools' adb command."); @@ -2345,7 +2346,7 @@ bool EditorExportPlatformAndroid::has_valid_export_configuration(const Ref<Edito if (!target_sdk_version.is_valid_int()) { target_sdk_version = itos(DEFAULT_TARGET_SDK_VERSION); } - // Validate that apksigner is available + // Validate that apksigner is available. String apksigner_path = get_apksigner_path(target_sdk_version.to_int()); if (!FileAccess::exists(apksigner_path)) { err += TTR("Unable to find Android SDK build-tools' apksigner command."); diff --git a/platform/android/export/export_plugin.h b/platform/android/export/export_plugin.h index 390b8c6465..0ac0fbb10b 100644 --- a/platform/android/export/export_plugin.h +++ b/platform/android/export/export_plugin.h @@ -219,7 +219,7 @@ public: static String get_apksigner_path(int p_target_sdk = -1, bool p_check_executes = false); - virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const override; + virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug = false) const override; virtual bool has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const override; virtual List<String> get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const override; diff --git a/platform/ios/export/export_plugin.cpp b/platform/ios/export/export_plugin.cpp index ae0d120513..9962a48250 100644 --- a/platform/ios/export/export_plugin.cpp +++ b/platform/ios/export/export_plugin.cpp @@ -1899,7 +1899,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p return OK; } -bool EditorExportPlatformIOS::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const { +bool EditorExportPlatformIOS::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug) const { String err; bool valid = false; diff --git a/platform/ios/export/export_plugin.h b/platform/ios/export/export_plugin.h index 2e461c8ed6..6616bbd714 100644 --- a/platform/ios/export/export_plugin.h +++ b/platform/ios/export/export_plugin.h @@ -208,7 +208,7 @@ public: } virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0) override; - virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const override; + virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug = false) const override; virtual bool has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const override; virtual void get_platform_features(List<String> *r_features) const override { diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp index 802c8d42c3..0b5f2b1266 100644 --- a/platform/macos/export/export_plugin.cpp +++ b/platform/macos/export/export_plugin.cpp @@ -2081,7 +2081,7 @@ Error EditorExportPlatformMacOS::export_project(const Ref<EditorExportPreset> &p return err; } -bool EditorExportPlatformMacOS::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const { +bool EditorExportPlatformMacOS::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug) const { String err; bool valid = false; diff --git a/platform/macos/export/export_plugin.h b/platform/macos/export/export_plugin.h index 0477a8c0cc..0764b63e8c 100644 --- a/platform/macos/export/export_plugin.h +++ b/platform/macos/export/export_plugin.h @@ -148,7 +148,7 @@ public: virtual List<String> get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const override; virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0) override; - virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const override; + virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug = false) const override; virtual bool has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const override; virtual void get_platform_features(List<String> *r_features) const override { diff --git a/platform/uwp/export/export_plugin.cpp b/platform/uwp/export/export_plugin.cpp index 69de383efc..a0a91a1cf1 100644 --- a/platform/uwp/export/export_plugin.cpp +++ b/platform/uwp/export/export_plugin.cpp @@ -128,7 +128,7 @@ void EditorExportPlatformUWP::get_export_options(List<ExportOption> *r_options) } } -bool EditorExportPlatformUWP::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const { +bool EditorExportPlatformUWP::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug) const { #ifndef DEV_ENABLED // We don't provide export templates for the UWP platform currently as it // has not been ported for Godot 4.0. This is skipped in DEV_ENABLED so that diff --git a/platform/uwp/export/export_plugin.h b/platform/uwp/export/export_plugin.h index 999d54cb80..cc86bdb280 100644 --- a/platform/uwp/export/export_plugin.h +++ b/platform/uwp/export/export_plugin.h @@ -434,7 +434,7 @@ public: virtual void get_export_options(List<ExportOption> *r_options) const override; - virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const override; + virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug = false) const override; virtual bool has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const override; virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0) override; diff --git a/platform/web/export/export_plugin.cpp b/platform/web/export/export_plugin.cpp index a398593f90..e3cdd6a60d 100644 --- a/platform/web/export/export_plugin.cpp +++ b/platform/web/export/export_plugin.cpp @@ -358,7 +358,7 @@ Ref<Texture2D> EditorExportPlatformWeb::get_logo() const { return logo; } -bool EditorExportPlatformWeb::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const { +bool EditorExportPlatformWeb::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug) const { String err; bool valid = false; bool extensions = (bool)p_preset->get("variant/extensions_support"); diff --git a/platform/web/export/export_plugin.h b/platform/web/export/export_plugin.h index a1d3fed2f3..2de4a4c153 100644 --- a/platform/web/export/export_plugin.h +++ b/platform/web/export/export_plugin.h @@ -106,7 +106,7 @@ public: virtual String get_os_name() const override; virtual Ref<Texture2D> get_logo() const override; - virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const override; + virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug = false) const override; virtual bool has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const override; virtual List<String> get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const override; virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0) override; diff --git a/platform/windows/export/export_plugin.cpp b/platform/windows/export/export_plugin.cpp index 7371e4daf7..367b471196 100644 --- a/platform/windows/export/export_plugin.cpp +++ b/platform/windows/export/export_plugin.cpp @@ -674,9 +674,9 @@ Error EditorExportPlatformWindows::_code_sign(const Ref<EditorExportPreset> &p_p return OK; } -bool EditorExportPlatformWindows::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const { +bool EditorExportPlatformWindows::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug) const { String err = ""; - bool valid = EditorExportPlatformPC::has_valid_export_configuration(p_preset, err, r_missing_templates); + bool valid = EditorExportPlatformPC::has_valid_export_configuration(p_preset, err, r_missing_templates, p_debug); String rcedit_path = EDITOR_GET("export/windows/rcedit"); if (p_preset->get("application/modify_resources") && rcedit_path.is_empty()) { diff --git a/platform/windows/export/export_plugin.h b/platform/windows/export/export_plugin.h index 184b2f96f8..c644b1f9e1 100644 --- a/platform/windows/export/export_plugin.h +++ b/platform/windows/export/export_plugin.h @@ -79,7 +79,7 @@ public: virtual Error sign_shared_object(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path) override; virtual List<String> get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const override; virtual void get_export_options(List<ExportOption> *r_options) const override; - virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const override; + virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug = false) const override; virtual bool has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const override; virtual bool get_export_option_visibility(const EditorExportPreset *p_preset, const String &p_option) const override; virtual String get_export_option_warning(const EditorExportPreset *p_preset, const StringName &p_name) const override; |
