From aa3141ef3b1a5432d369b5a09023bb397311cdb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge=20He=C3=9F?= Date: Fri, 2 Oct 2020 15:20:04 +0200 Subject: [PATCH] Fix codesigning of objdump ... enable sandbox inheritance. Use a build step instead of builtin Xcode signing, to set the entitlements which are required for AppStore uploads. Also set the ID of the objdump to some rDNS. --- 5GUIs.xcodeproj/project.pbxproj | 55 ++++++++++++++++++++------------- 5GUIs/Info.plist | 2 +- LLVM/llvm-objdump.entitlements | 8 ++--- 3 files changed, 39 insertions(+), 26 deletions(-) diff --git a/5GUIs.xcodeproj/project.pbxproj b/5GUIs.xcodeproj/project.pbxproj index 0ded852..c1685e8 100644 --- a/5GUIs.xcodeproj/project.pbxproj +++ b/5GUIs.xcodeproj/project.pbxproj @@ -3,14 +3,13 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ E83E32BF25220277009BE980 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E83E32BE25220277009BE980 /* Assets.xcassets */; }; E83E32C225220277009BE980 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E83E32C125220277009BE980 /* Preview Assets.xcassets */; }; E83E32C525220277009BE980 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E83E32C325220277009BE980 /* Main.storyboard */; }; - E8F1C3D92524BA3F000B517B /* llvm-objdump in CopyFiles */ = {isa = PBXBuildFile; fileRef = E8F1C3D82524BA3F000B517B /* llvm-objdump */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; E8F1C3F72524EAFB000B517B /* LLVM-LICENSE.TXT in Resources */ = {isa = PBXBuildFile; fileRef = E8F1C3F62524EAFB000B517B /* LLVM-LICENSE.TXT */; }; E8F1C41C25260051000B517B /* OTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8F1C40225260051000B517B /* OTool.swift */; }; E8F1C41D25260051000B517B /* WindowEnvironmentKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8F1C40325260051000B517B /* WindowEnvironmentKey.swift */; }; @@ -38,21 +37,8 @@ E8F1C43325260051000B517B /* Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8F1C41B25260051000B517B /* Style.swift */; }; /* End PBXBuildFile section */ -/* Begin PBXCopyFilesBuildPhase section */ - E8F1C3DB2524BA5C000B517B /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 6; - files = ( - E8F1C3D92524BA3F000B517B /* llvm-objdump in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ - E83E32B725220275009BE980 /* 5GUIs.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 5GUIs.app; sourceTree = BUILT_PRODUCTS_DIR; }; + E83E32B725220275009BE980 /* 5 GUIs.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "5 GUIs.app"; sourceTree = BUILT_PRODUCTS_DIR; }; E83E32BE25220277009BE980 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; E83E32C125220277009BE980 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; E83E32C425220277009BE980 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; @@ -112,7 +98,7 @@ E83E32B825220275009BE980 /* Products */ = { isa = PBXGroup; children = ( - E83E32B725220275009BE980 /* 5GUIs.app */, + E83E32B725220275009BE980 /* 5 GUIs.app */, ); name = Products; sourceTree = ""; @@ -251,7 +237,7 @@ E83E32B325220275009BE980 /* Sources */, E83E32B425220275009BE980 /* Frameworks */, E83E32B525220275009BE980 /* Resources */, - E8F1C3DB2524BA5C000B517B /* CopyFiles */, + E84AF10925274DEB0011541E /* Bundle Objdump */, ); buildRules = ( ); @@ -259,7 +245,7 @@ ); name = 5GUIs; productName = 5GUIs; - productReference = E83E32B725220275009BE980 /* 5GUIs.app */; + productReference = E83E32B725220275009BE980 /* 5 GUIs.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -309,6 +295,29 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + E84AF10925274DEB0011541E /* Bundle Objdump */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Bundle Objdump"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "OBJDUMP_TO_EMBED=\"${PROJECT_DIR}/LLVM/llvm-objdump\"\nOBJDUMP_ENTITLEMENTS=\"${PROJECT_DIR}/LLVM/llvm-objdump.entitlements\"\nOBJDUMP_SIGNING_ID=\"de.zeezide.swift.five-guis.objdump\"\n\nmkdir -p \"${TARGET_BUILD_DIR}/${EXECUTABLE_FOLDER_PATH}\"\nOBJDUMP_TARGET_BINARY=\"${TARGET_BUILD_DIR}/${EXECUTABLE_FOLDER_PATH}/llvm-objdump\"\n\necho \"Copying ${OBJDUMP_TO_EMBED}\\n into: ${OBJDUMP_TARGET_BINARY}\"\n$CP \"${OBJDUMP_TO_EMBED}\" \"${OBJDUMP_TARGET_BINARY}\"\n\necho \"Signing: Signing Identity: ${EXPANDED_CODE_SIGN_IDENTITY_NAME}\"\ncd \"${CODESIGNING_FOLDER_PATH}\"\ncodesign --force \\\n --sign \"${EXPANDED_CODE_SIGN_IDENTITY}\" \\\n -i \"${OBJDUMP_SIGNING_ID}\" \\\n -o runtime \\\n --timestamp=none \\\n --entitlements \"${OBJDUMP_ENTITLEMENTS}\" \\\n \"${OBJDUMP_TARGET_BINARY}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ E83E32B325220275009BE980 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -480,6 +489,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_ASSET_PATHS = "\"5GUIs/Preview Content\""; DEVELOPMENT_TEAM = 4GXF3JAMM4; ENABLE_HARDENED_RUNTIME = YES; @@ -491,7 +501,8 @@ ); MACOSX_DEPLOYMENT_TARGET = 10.15; PRODUCT_BUNDLE_IDENTIFIER = "de.zeezide.swift.five-guis"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_MODULE_NAME = FiveGUIs; + PRODUCT_NAME = "5 GUIs"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; }; @@ -507,6 +518,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_ASSET_PATHS = "\"5GUIs/Preview Content\""; DEVELOPMENT_TEAM = 4GXF3JAMM4; ENABLE_HARDENED_RUNTIME = YES; @@ -518,7 +530,8 @@ ); MACOSX_DEPLOYMENT_TARGET = 10.15; PRODUCT_BUNDLE_IDENTIFIER = "de.zeezide.swift.five-guis"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_MODULE_NAME = FiveGUIs; + PRODUCT_NAME = "5 GUIs"; SWIFT_VERSION = 5.0; }; name = Release; diff --git a/5GUIs/Info.plist b/5GUIs/Info.plist index 8bc8f47..088c23d 100644 --- a/5GUIs/Info.plist +++ b/5GUIs/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.0 CFBundleVersion - 1 + $(CURRENT_PROJECT_VERSION) LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/LLVM/llvm-objdump.entitlements b/LLVM/llvm-objdump.entitlements index 852fa1a..ba874b9 100644 --- a/LLVM/llvm-objdump.entitlements +++ b/LLVM/llvm-objdump.entitlements @@ -1,8 +1,8 @@ - - com.apple.security.app-sandbox - - + + com.apple.security.app-sandbox + com.apple.security.inherit +