From 41b274d52dcbc16e425e66d0e052d2d0ac9ad996 Mon Sep 17 00:00:00 2001 From: timlyeee <43355299+timlyeee@users.noreply.github.com> Date: Tue, 6 Jul 2021 09:57:46 +0800 Subject: [PATCH] Add App Sandbox for Mac OSX application (#3685) https://github.com/cocos-creator/3d-tasks/issues/7352 Use Cmake to enable app sandbox configuration --- native/templates/mac/CMakeLists.txt | 3 +++ native/templates/mac/entitlements.plist | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 native/templates/mac/entitlements.plist diff --git a/native/templates/mac/CMakeLists.txt b/native/templates/mac/CMakeLists.txt index b22b803766..9e53a9c01f 100644 --- a/native/templates/mac/CMakeLists.txt +++ b/native/templates/mac/CMakeLists.txt @@ -63,6 +63,9 @@ set_target_properties(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_SKIP_INSTALL NO XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)" ) +set_target_properties(${LIB_NAME} PROPERTIES + XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_LIST_DIR}/entitlements.plist" +) get_property(gles2_loc TARGET GLESv2 PROPERTY IMPORTED_LOCATION) get_property(egl_loc TARGET EGL PROPERTY IMPORTED_LOCATION) add_custom_command(TARGET ${LIB_NAME} POST_BUILD diff --git a/native/templates/mac/entitlements.plist b/native/templates/mac/entitlements.plist new file mode 100644 index 0000000000..ea2494bbd1 --- /dev/null +++ b/native/templates/mac/entitlements.plist @@ -0,0 +1,11 @@ + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + com.apple.security.network.server + + +