From 1c1036567ae491a6d9510a41bcd6fd1792acbab0 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sat, 3 Feb 2024 19:48:21 +0200 Subject: [macOS] Generate min. Info.plist for frameworks if it's missing. Validate framework bundle ID characters. --- platform/ios/export/export_plugin.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/export/export_plugin.cpp b/platform/ios/export/export_plugin.cpp index d35819c34d..f518d7607b 100644 --- a/platform/ios/export/export_plugin.cpp +++ b/platform/ios/export/export_plugin.cpp @@ -1007,6 +1007,12 @@ Error EditorExportPlatformIOS::_convert_to_framework(const String &p_source, con // Creating Info.plist { + String lib_clean_name = file_name; + for (int i = 0; i < lib_clean_name.length(); i++) { + if (!is_ascii_alphanumeric_char(lib_clean_name[i]) && lib_clean_name[i] != '.' && lib_clean_name[i] != '-') { + lib_clean_name[i] = '-'; + } + } String info_plist_format = "\n" "\n" "\n" @@ -1014,7 +1020,7 @@ Error EditorExportPlatformIOS::_convert_to_framework(const String &p_source, con " CFBundleShortVersionString\n" " 1.0\n" " CFBundleIdentifier\n" - " $id.framework.$name\n" + " $id.framework.$cl_name\n" " CFBundleName\n" " $name\n" " CFBundleExecutable\n" @@ -1032,7 +1038,7 @@ Error EditorExportPlatformIOS::_convert_to_framework(const String &p_source, con " \n" ""; - String info_plist = info_plist_format.replace("$id", p_id).replace("$name", file_name); + String info_plist = info_plist_format.replace("$id", p_id).replace("$name", file_name).replace("$cl_name", lib_clean_name); Ref f = FileAccess::open(p_destination.path_join("Info.plist"), FileAccess::WRITE); if (f.is_valid()) { -- cgit v1.2.3