From 5152afa70c8f07f63e9f9d9c2ff386ee6437ca1e Mon Sep 17 00:00:00 2001 From: Catchawink Date: Fri, 13 Dec 2019 16:10:23 -0500 Subject: [PATCH] Added microphone and camera usage descriptions to macOS builds. --- misc/dist/osx_template.app/Contents/Info.plist | 4 ++++ misc/dist/osx_tools.app/Contents/Info.plist | 4 ++++ platform/osx/export/export.cpp | 9 +++++++++ 3 files changed, 17 insertions(+) diff --git a/misc/dist/osx_template.app/Contents/Info.plist b/misc/dist/osx_template.app/Contents/Info.plist index eee787bdaf9..696c825594a 100755 --- a/misc/dist/osx_template.app/Contents/Info.plist +++ b/misc/dist/osx_template.app/Contents/Info.plist @@ -24,6 +24,10 @@ $signature CFBundleVersion $version + NSMicrophoneUsageDescription + $microphone_usage_description + NSCameraUsageDescription + $camera_usage_description NSHumanReadableCopyright $copyright LSMinimumSystemVersion diff --git a/misc/dist/osx_tools.app/Contents/Info.plist b/misc/dist/osx_tools.app/Contents/Info.plist index bb22f1807cf..4b1e8ebbf39 100755 --- a/misc/dist/osx_tools.app/Contents/Info.plist +++ b/misc/dist/osx_tools.app/Contents/Info.plist @@ -24,6 +24,10 @@ godot CFBundleVersion 3.2 + NSMicrophoneUsageDescription + Microphone access is required to capture audio. + NSCameraUsageDescription + Camera access is required to capture video. NSRequiresAquaSystemAppearance NSHumanReadableCopyright diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 9226aea3695..590858b5583 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -130,6 +130,9 @@ void EditorExportPlatformOSX::get_export_options(List *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/version"), "1.0")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/copyright"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "display/high_res"), false)); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/camera_usage_description", PROPERTY_HINT_PLACEHOLDER_TEXT, "Provide a message if you need to use the camera"), "")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/microphone_usage_description", PROPERTY_HINT_PLACEHOLDER_TEXT, "Provide a message if you need to use the microphone"), "")); + #ifdef OSX_ENABLED r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "codesign/enable"), false)); @@ -342,6 +345,12 @@ void EditorExportPlatformOSX::_fix_plist(const Ref &p_preset strnew += lines[i].replace("$copyright", p_preset->get("application/copyright")) + "\n"; } else if (lines[i].find("$highres") != -1) { strnew += lines[i].replace("$highres", p_preset->get("display/high_res") ? "" : "") + "\n"; + } else if (lines[i].find("$camera_usage_description") != -1) { + 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) { + String description = p_preset->get("privacy/microphone_usage_description"); + strnew += lines[i].replace("$microphone_usage_description", description) + "\n"; } else { strnew += lines[i] + "\n"; }