diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-02-03 19:48:21 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-02-03 19:48:21 +0200 |
commit | 1c1036567ae491a6d9510a41bcd6fd1792acbab0 (patch) | |
tree | a018852d7a4adfc982132876b86ebad0a1df571a /platform/ios | |
parent | 10e111477db68fe65776a1d68fb1ffccaf6520fc (diff) | |
download | redot-engine-1c1036567ae491a6d9510a41bcd6fd1792acbab0.tar.gz |
[macOS] Generate min. Info.plist for frameworks if it's missing. Validate framework bundle ID characters.
Diffstat (limited to 'platform/ios')
-rw-r--r-- | platform/ios/export/export_plugin.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
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 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n" "<plist version=\"1.0\">\n" @@ -1014,7 +1020,7 @@ Error EditorExportPlatformIOS::_convert_to_framework(const String &p_source, con " <key>CFBundleShortVersionString</key>\n" " <string>1.0</string>\n" " <key>CFBundleIdentifier</key>\n" - " <string>$id.framework.$name</string>\n" + " <string>$id.framework.$cl_name</string>\n" " <key>CFBundleName</key>\n" " <string>$name</string>\n" " <key>CFBundleExecutable</key>\n" @@ -1032,7 +1038,7 @@ Error EditorExportPlatformIOS::_convert_to_framework(const String &p_source, con " </dict>\n" "</plist>"; - 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<FileAccess> f = FileAccess::open(p_destination.path_join("Info.plist"), FileAccess::WRITE); if (f.is_valid()) { |