|
@@ -400,65 +400,65 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
|
|
|
str.parse_utf8((const char *)pfile.ptr(), pfile.size());
|
|
|
Vector<String> lines = str.split("\n");
|
|
|
for (int i = 0; i < lines.size(); i++) {
|
|
|
- if (lines[i].find("$binary") != -1) {
|
|
|
+ if (lines[i].contains("$binary")) {
|
|
|
strnew += lines[i].replace("$binary", p_config.binary_name) + "\n";
|
|
|
- } else if (lines[i].find("$modules_buildfile") != -1) {
|
|
|
+ } else if (lines[i].contains("$modules_buildfile")) {
|
|
|
strnew += lines[i].replace("$modules_buildfile", p_config.modules_buildfile) + "\n";
|
|
|
- } else if (lines[i].find("$modules_fileref") != -1) {
|
|
|
+ } else if (lines[i].contains("$modules_fileref")) {
|
|
|
strnew += lines[i].replace("$modules_fileref", p_config.modules_fileref) + "\n";
|
|
|
- } else if (lines[i].find("$modules_buildphase") != -1) {
|
|
|
+ } else if (lines[i].contains("$modules_buildphase")) {
|
|
|
strnew += lines[i].replace("$modules_buildphase", p_config.modules_buildphase) + "\n";
|
|
|
- } else if (lines[i].find("$modules_buildgrp") != -1) {
|
|
|
+ } else if (lines[i].contains("$modules_buildgrp")) {
|
|
|
strnew += lines[i].replace("$modules_buildgrp", p_config.modules_buildgrp) + "\n";
|
|
|
- } else if (lines[i].find("$name") != -1) {
|
|
|
+ } else if (lines[i].contains("$name")) {
|
|
|
strnew += lines[i].replace("$name", p_config.pkg_name) + "\n";
|
|
|
- } else if (lines[i].find("$bundle_identifier") != -1) {
|
|
|
+ } else if (lines[i].contains("$bundle_identifier")) {
|
|
|
strnew += lines[i].replace("$bundle_identifier", p_preset->get("application/bundle_identifier")) + "\n";
|
|
|
- } else if (lines[i].find("$short_version") != -1) {
|
|
|
+ } else if (lines[i].contains("$short_version")) {
|
|
|
strnew += lines[i].replace("$short_version", p_preset->get_version("application/short_version")) + "\n";
|
|
|
- } else if (lines[i].find("$version") != -1) {
|
|
|
+ } else if (lines[i].contains("$version")) {
|
|
|
strnew += lines[i].replace("$version", p_preset->get_version("application/version")) + "\n";
|
|
|
- } else if (lines[i].find("$min_version") != -1) {
|
|
|
+ } else if (lines[i].contains("$min_version")) {
|
|
|
strnew += lines[i].replace("$min_version", p_preset->get("application/min_ios_version")) + "\n";
|
|
|
- } else if (lines[i].find("$signature") != -1) {
|
|
|
+ } else if (lines[i].contains("$signature")) {
|
|
|
strnew += lines[i].replace("$signature", p_preset->get("application/signature")) + "\n";
|
|
|
- } else if (lines[i].find("$team_id") != -1) {
|
|
|
+ } else if (lines[i].contains("$team_id")) {
|
|
|
strnew += lines[i].replace("$team_id", p_preset->get("application/app_store_team_id")) + "\n";
|
|
|
- } else if (lines[i].find("$default_build_config") != -1) {
|
|
|
+ } else if (lines[i].contains("$default_build_config")) {
|
|
|
strnew += lines[i].replace("$default_build_config", p_debug ? "Debug" : "Release") + "\n";
|
|
|
- } else if (lines[i].find("$export_method") != -1) {
|
|
|
+ } else if (lines[i].contains("$export_method")) {
|
|
|
int export_method = p_preset->get(p_debug ? "application/export_method_debug" : "application/export_method_release");
|
|
|
strnew += lines[i].replace("$export_method", export_method_string[export_method]) + "\n";
|
|
|
- } else if (lines[i].find("$provisioning_profile_uuid_release") != -1) {
|
|
|
+ } else if (lines[i].contains("$provisioning_profile_uuid_release")) {
|
|
|
strnew += lines[i].replace("$provisioning_profile_uuid_release", p_preset->get_or_env("application/provisioning_profile_uuid_release", ENV_IOS_PROFILE_UUID_RELEASE)) + "\n";
|
|
|
- } else if (lines[i].find("$provisioning_profile_uuid_debug") != -1) {
|
|
|
+ } else if (lines[i].contains("$provisioning_profile_uuid_debug")) {
|
|
|
strnew += lines[i].replace("$provisioning_profile_uuid_debug", p_preset->get_or_env("application/provisioning_profile_uuid_debug", ENV_IOS_PROFILE_UUID_DEBUG)) + "\n";
|
|
|
- } else if (lines[i].find("$code_sign_style_debug") != -1) {
|
|
|
+ } else if (lines[i].contains("$code_sign_style_debug")) {
|
|
|
if (dbg_manual) {
|
|
|
strnew += lines[i].replace("$code_sign_style_debug", "Manual") + "\n";
|
|
|
} else {
|
|
|
strnew += lines[i].replace("$code_sign_style_debug", "Automatic") + "\n";
|
|
|
}
|
|
|
- } else if (lines[i].find("$code_sign_style_release") != -1) {
|
|
|
+ } else if (lines[i].contains("$code_sign_style_release")) {
|
|
|
if (rel_manual) {
|
|
|
strnew += lines[i].replace("$code_sign_style_release", "Manual") + "\n";
|
|
|
} else {
|
|
|
strnew += lines[i].replace("$code_sign_style_release", "Automatic") + "\n";
|
|
|
}
|
|
|
- } else if (lines[i].find("$provisioning_profile_uuid") != -1) {
|
|
|
+ } else if (lines[i].contains("$provisioning_profile_uuid")) {
|
|
|
String uuid = p_debug ? p_preset->get_or_env("application/provisioning_profile_uuid_debug", ENV_IOS_PROFILE_UUID_DEBUG) : p_preset->get_or_env("application/provisioning_profile_uuid_release", ENV_IOS_PROFILE_UUID_RELEASE);
|
|
|
strnew += lines[i].replace("$provisioning_profile_uuid", uuid) + "\n";
|
|
|
- } else if (lines[i].find("$code_sign_identity_debug") != -1) {
|
|
|
+ } else if (lines[i].contains("$code_sign_identity_debug")) {
|
|
|
strnew += lines[i].replace("$code_sign_identity_debug", dbg_sign_id) + "\n";
|
|
|
- } else if (lines[i].find("$code_sign_identity_release") != -1) {
|
|
|
+ } else if (lines[i].contains("$code_sign_identity_release")) {
|
|
|
strnew += lines[i].replace("$code_sign_identity_release", rel_sign_id) + "\n";
|
|
|
- } else if (lines[i].find("$additional_plist_content") != -1) {
|
|
|
+ } else if (lines[i].contains("$additional_plist_content")) {
|
|
|
strnew += lines[i].replace("$additional_plist_content", p_config.plist_content) + "\n";
|
|
|
- } else if (lines[i].find("$godot_archs") != -1) {
|
|
|
+ } else if (lines[i].contains("$godot_archs")) {
|
|
|
strnew += lines[i].replace("$godot_archs", p_config.architectures) + "\n";
|
|
|
- } else if (lines[i].find("$linker_flags") != -1) {
|
|
|
+ } else if (lines[i].contains("$linker_flags")) {
|
|
|
strnew += lines[i].replace("$linker_flags", p_config.linker_flags) + "\n";
|
|
|
- } else if (lines[i].find("$targeted_device_family") != -1) {
|
|
|
+ } else if (lines[i].contains("$targeted_device_family")) {
|
|
|
String xcode_value;
|
|
|
switch ((int)p_preset->get("application/targeted_device_family")) {
|
|
|
case 0: // iPhone
|
|
@@ -472,16 +472,16 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
|
|
|
break;
|
|
|
}
|
|
|
strnew += lines[i].replace("$targeted_device_family", xcode_value) + "\n";
|
|
|
- } else if (lines[i].find("$cpp_code") != -1) {
|
|
|
+ } else if (lines[i].contains("$cpp_code")) {
|
|
|
strnew += lines[i].replace("$cpp_code", p_config.cpp_code) + "\n";
|
|
|
- } else if (lines[i].find("$docs_in_place") != -1) {
|
|
|
+ } else if (lines[i].contains("$docs_in_place")) {
|
|
|
strnew += lines[i].replace("$docs_in_place", ((bool)p_preset->get("user_data/accessible_from_files_app")) ? "<true/>" : "<false/>") + "\n";
|
|
|
- } else if (lines[i].find("$docs_sharing") != -1) {
|
|
|
+ } else if (lines[i].contains("$docs_sharing")) {
|
|
|
strnew += lines[i].replace("$docs_sharing", ((bool)p_preset->get("user_data/accessible_from_itunes_sharing")) ? "<true/>" : "<false/>") + "\n";
|
|
|
- } else if (lines[i].find("$entitlements_push_notifications") != -1) {
|
|
|
+ } else if (lines[i].contains("$entitlements_push_notifications")) {
|
|
|
bool is_on = p_preset->get("capabilities/push_notifications");
|
|
|
strnew += lines[i].replace("$entitlements_push_notifications", is_on ? "<key>aps-environment</key><string>development</string>" : "") + "\n";
|
|
|
- } else if (lines[i].find("$required_device_capabilities") != -1) {
|
|
|
+ } else if (lines[i].contains("$required_device_capabilities")) {
|
|
|
String capabilities;
|
|
|
|
|
|
// I've removed armv7 as we can run on 64bit only devices
|
|
@@ -503,7 +503,7 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
|
|
|
}
|
|
|
|
|
|
strnew += lines[i].replace("$required_device_capabilities", capabilities);
|
|
|
- } else if (lines[i].find("$interface_orientations") != -1) {
|
|
|
+ } else if (lines[i].contains("$interface_orientations")) {
|
|
|
String orientations;
|
|
|
const DisplayServer::ScreenOrientation screen_orientation =
|
|
|
DisplayServer::ScreenOrientation(int(GLOBAL_GET("display/window/handheld/orientation")));
|
|
@@ -541,35 +541,35 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
|
|
|
}
|
|
|
|
|
|
strnew += lines[i].replace("$interface_orientations", orientations);
|
|
|
- } else if (lines[i].find("$camera_usage_description") != -1) {
|
|
|
+ } else if (lines[i].contains("$camera_usage_description")) {
|
|
|
String description = p_preset->get("privacy/camera_usage_description");
|
|
|
strnew += lines[i].replace("$camera_usage_description", description) + "\n";
|
|
|
- } else if (lines[i].find("$microphone_usage_description") != -1) {
|
|
|
+ } else if (lines[i].contains("$microphone_usage_description")) {
|
|
|
String description = p_preset->get("privacy/microphone_usage_description");
|
|
|
strnew += lines[i].replace("$microphone_usage_description", description) + "\n";
|
|
|
- } else if (lines[i].find("$photolibrary_usage_description") != -1) {
|
|
|
+ } else if (lines[i].contains("$photolibrary_usage_description")) {
|
|
|
String description = p_preset->get("privacy/photolibrary_usage_description");
|
|
|
strnew += lines[i].replace("$photolibrary_usage_description", description) + "\n";
|
|
|
- } else if (lines[i].find("$plist_launch_screen_name") != -1) {
|
|
|
+ } else if (lines[i].contains("$plist_launch_screen_name")) {
|
|
|
String value = "<key>UILaunchStoryboardName</key>\n<string>Launch Screen</string>";
|
|
|
strnew += lines[i].replace("$plist_launch_screen_name", value) + "\n";
|
|
|
- } else if (lines[i].find("$pbx_launch_screen_file_reference") != -1) {
|
|
|
+ } else if (lines[i].contains("$pbx_launch_screen_file_reference")) {
|
|
|
String value = "90DD2D9D24B36E8000717FE1 = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = \"Launch Screen.storyboard\"; sourceTree = \"<group>\"; };";
|
|
|
strnew += lines[i].replace("$pbx_launch_screen_file_reference", value) + "\n";
|
|
|
- } else if (lines[i].find("$pbx_launch_screen_copy_files") != -1) {
|
|
|
+ } else if (lines[i].contains("$pbx_launch_screen_copy_files")) {
|
|
|
String value = "90DD2D9D24B36E8000717FE1 /* Launch Screen.storyboard */,";
|
|
|
strnew += lines[i].replace("$pbx_launch_screen_copy_files", value) + "\n";
|
|
|
- } else if (lines[i].find("$pbx_launch_screen_build_phase") != -1) {
|
|
|
+ } else if (lines[i].contains("$pbx_launch_screen_build_phase")) {
|
|
|
String value = "90DD2D9E24B36E8000717FE1 /* Launch Screen.storyboard in Resources */,";
|
|
|
strnew += lines[i].replace("$pbx_launch_screen_build_phase", value) + "\n";
|
|
|
- } else if (lines[i].find("$pbx_launch_screen_build_reference") != -1) {
|
|
|
+ } else if (lines[i].contains("$pbx_launch_screen_build_reference")) {
|
|
|
String value = "90DD2D9E24B36E8000717FE1 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 90DD2D9D24B36E8000717FE1 /* Launch Screen.storyboard */; };";
|
|
|
strnew += lines[i].replace("$pbx_launch_screen_build_reference", value) + "\n";
|
|
|
#ifndef DISABLE_DEPRECATED
|
|
|
- } else if (lines[i].find("$pbx_launch_image_usage_setting") != -1) {
|
|
|
+ } else if (lines[i].contains("$pbx_launch_image_usage_setting")) {
|
|
|
strnew += lines[i].replace("$pbx_launch_image_usage_setting", "") + "\n";
|
|
|
#endif
|
|
|
- } else if (lines[i].find("$launch_screen_image_mode") != -1) {
|
|
|
+ } else if (lines[i].contains("$launch_screen_image_mode")) {
|
|
|
int image_scale_mode = p_preset->get("storyboard/image_scale_mode");
|
|
|
String value;
|
|
|
|
|
@@ -586,7 +586,7 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
|
|
|
}
|
|
|
|
|
|
strnew += lines[i].replace("$launch_screen_image_mode", value) + "\n";
|
|
|
- } else if (lines[i].find("$launch_screen_background_color") != -1) {
|
|
|
+ } else if (lines[i].contains("$launch_screen_background_color")) {
|
|
|
bool use_custom = p_preset->get("storyboard/use_custom_bg_color");
|
|
|
Color color = use_custom ? p_preset->get("storyboard/custom_bg_color") : GLOBAL_GET("application/boot_splash/bg_color");
|
|
|
const String value_format = "red=\"$red\" green=\"$green\" blue=\"$blue\" alpha=\"$alpha\"";
|
|
@@ -599,7 +599,7 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
|
|
|
String value = value_format.format(value_dictionary, "$_");
|
|
|
|
|
|
strnew += lines[i].replace("$launch_screen_background_color", value) + "\n";
|
|
|
- } else if (lines[i].find("$pbx_locale_file_reference") != -1) {
|
|
|
+ } else if (lines[i].contains("$pbx_locale_file_reference")) {
|
|
|
String locale_files;
|
|
|
Vector<String> translations = GLOBAL_GET("internationalization/locale/translations");
|
|
|
if (translations.size() > 0) {
|
|
@@ -618,7 +618,7 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
|
|
|
}
|
|
|
}
|
|
|
strnew += lines[i].replace("$pbx_locale_file_reference", locale_files);
|
|
|
- } else if (lines[i].find("$pbx_locale_build_reference") != -1) {
|
|
|
+ } else if (lines[i].contains("$pbx_locale_build_reference")) {
|
|
|
String locale_files;
|
|
|
Vector<String> translations = GLOBAL_GET("internationalization/locale/translations");
|
|
|
if (translations.size() > 0) {
|
|
@@ -637,10 +637,10 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
|
|
|
}
|
|
|
}
|
|
|
strnew += lines[i].replace("$pbx_locale_build_reference", locale_files);
|
|
|
- } else if (lines[i].find("$swift_runtime_migration") != -1) {
|
|
|
+ } else if (lines[i].contains("$swift_runtime_migration")) {
|
|
|
String value = !p_config.use_swift_runtime ? "" : "LastSwiftMigration = 1250;";
|
|
|
strnew += lines[i].replace("$swift_runtime_migration", value) + "\n";
|
|
|
- } else if (lines[i].find("$swift_runtime_build_settings") != -1) {
|
|
|
+ } else if (lines[i].contains("$swift_runtime_build_settings")) {
|
|
|
String value = !p_config.use_swift_runtime ? "" : R"(
|
|
|
CLANG_ENABLE_MODULES = YES;
|
|
|
SWIFT_OBJC_BRIDGING_HEADER = "$binary/dummy.h";
|
|
@@ -648,25 +648,25 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
|
|
|
)";
|
|
|
value = value.replace("$binary", p_config.binary_name);
|
|
|
strnew += lines[i].replace("$swift_runtime_build_settings", value) + "\n";
|
|
|
- } else if (lines[i].find("$swift_runtime_fileref") != -1) {
|
|
|
+ } else if (lines[i].contains("$swift_runtime_fileref")) {
|
|
|
String value = !p_config.use_swift_runtime ? "" : R"(
|
|
|
90B4C2AA2680BC560039117A /* dummy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "dummy.h"; sourceTree = "<group>"; };
|
|
|
90B4C2B52680C7E90039117A /* dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "dummy.swift"; sourceTree = "<group>"; };
|
|
|
)";
|
|
|
strnew += lines[i].replace("$swift_runtime_fileref", value) + "\n";
|
|
|
- } else if (lines[i].find("$swift_runtime_binary_files") != -1) {
|
|
|
+ } else if (lines[i].contains("$swift_runtime_binary_files")) {
|
|
|
String value = !p_config.use_swift_runtime ? "" : R"(
|
|
|
90B4C2AA2680BC560039117A /* dummy.h */,
|
|
|
90B4C2B52680C7E90039117A /* dummy.swift */,
|
|
|
)";
|
|
|
strnew += lines[i].replace("$swift_runtime_binary_files", value) + "\n";
|
|
|
- } else if (lines[i].find("$swift_runtime_buildfile") != -1) {
|
|
|
+ } else if (lines[i].contains("$swift_runtime_buildfile")) {
|
|
|
String value = !p_config.use_swift_runtime ? "" : "90B4C2B62680C7E90039117A /* dummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90B4C2B52680C7E90039117A /* dummy.swift */; };";
|
|
|
strnew += lines[i].replace("$swift_runtime_buildfile", value) + "\n";
|
|
|
- } else if (lines[i].find("$swift_runtime_build_phase") != -1) {
|
|
|
+ } else if (lines[i].contains("$swift_runtime_build_phase")) {
|
|
|
String value = !p_config.use_swift_runtime ? "" : "90B4C2B62680C7E90039117A /* dummy.swift */,";
|
|
|
strnew += lines[i].replace("$swift_runtime_build_phase", value) + "\n";
|
|
|
- } else if (lines[i].find("$priv_collection") != -1) {
|
|
|
+ } else if (lines[i].contains("$priv_collection")) {
|
|
|
bool section_opened = false;
|
|
|
for (uint64_t j = 0; j < sizeof(data_collect_type_info) / sizeof(data_collect_type_info[0]); ++j) {
|
|
|
bool data_collected = p_preset->get(vformat("privacy/collected_data/%s/collected", data_collect_type_info[j].prop_name));
|
|
@@ -710,7 +710,7 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
|
|
|
if (section_opened) {
|
|
|
strnew += "\t</array>\n";
|
|
|
}
|
|
|
- } else if (lines[i].find("$priv_tracking") != -1) {
|
|
|
+ } else if (lines[i].contains("$priv_tracking")) {
|
|
|
bool tracking = p_preset->get("privacy/tracking_enabled");
|
|
|
strnew += "\t<key>NSPrivacyTracking</key>\n";
|
|
|
if (tracking) {
|
|
@@ -727,7 +727,7 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
|
|
|
}
|
|
|
strnew += "\t</array>\n";
|
|
|
}
|
|
|
- } else if (lines[i].find("$priv_api_types") != -1) {
|
|
|
+ } else if (lines[i].contains("$priv_api_types")) {
|
|
|
strnew += "\t<array>\n";
|
|
|
for (uint64_t j = 0; j < sizeof(api_info) / sizeof(api_info[0]); ++j) {
|
|
|
int api_access = p_preset->get(vformat("privacy/%s_access_reasons", api_info[j].prop_name));
|