diff options
author | Memphiz <memphis@machzwo.de> | 2015-12-21 11:01:30 +0100 |
---|---|---|
committer | Memphiz <memphis@machzwo.de> | 2016-01-06 15:52:19 +0100 |
commit | 927877ec820febeb4c66f31fc535be3391803b90 (patch) | |
tree | b4143ce984122c969ceea8fd13c46924f72b5502 | |
parent | b997171ebd4c28ccb7ac25757320a336aa6c0c86 (diff) |
[darwin/support] - some cleanups for the codesign script, added codesigning of python eggs (by extracting, signing, repackaging them)
-rwxr-xr-x | tools/darwin/Support/Codesign.command | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/tools/darwin/Support/Codesign.command b/tools/darwin/Support/Codesign.command index 1535d767d4..5fb30e2fa1 100755 --- a/tools/darwin/Support/Codesign.command +++ b/tools/darwin/Support/Codesign.command @@ -1,7 +1,7 @@ #!/bin/bash #this is the list of binaries we have to sign for being able to run un-jailbroken -LIST_BINARY_EXTENSIONS="dylib so 0 vis pvr" +LIST_BINARY_EXTENSIONS="dylib so" export CODESIGN_ALLOCATE=`xcodebuild -find codesign_allocate` @@ -14,7 +14,7 @@ if [ ! -f ${GEN_ENTITLEMENTS} ]; then fi -if [ "${PLATFORM_NAME}" == "iphoneos" ]; then +if [ "${PLATFORM_NAME}" == "iphoneos" ] || [ "${PLATFORM_NAME}" == "appletvos" ]; then if [ -f "/Users/Shared/buildslave/keychain_unlock.sh" ]; then /Users/Shared/buildslave/keychain_unlock.sh fi @@ -24,16 +24,40 @@ if [ "${PLATFORM_NAME}" == "iphoneos" ]; then ${LDID} -S ${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${APP_NAME} fi - ${GEN_ENTITLEMENTS} "org.xbmc.kodi-ios" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent"; - codesign -v -f -s "iPhone Developer" --entitlements "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/" + # pull the CFBundleIdentifier out of the built xxx.app + BUNDLEID=`mdls -raw -name kMDItemCFBundleIdentifier ${CODESIGNING_FOLDER_PATH}` + echo "CFBundleIdentifier is ${BUNDLEID}" + + # Prefer the expanded name, if available. + CODE_SIGN_IDENTITY_FOR_ITEMS="${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + if [ "${CODE_SIGN_IDENTITY_FOR_ITEMS}" = "" ] ; then + # Fall back to old behavior. + CODE_SIGN_IDENTITY_FOR_ITEMS="${CODE_SIGN_IDENTITY}" + fi + echo "${CODE_SIGN_IDENTITY_FOR_ITEMS}" + + ${GEN_ENTITLEMENTS} "${BUNDLEID}" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent"; + codesign -v -f -s "${CODE_SIGN_IDENTITY_FOR_ITEMS}" --entitlements "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/" #if user has set a code_sign_identity different from iPhone Developer we do a real codesign (for deployment on non-jailbroken devices) if ! [ -z "${CODE_SIGN_IDENTITY}" ] && [ "${CODE_SIGN_IDENTITY}" == "iPhone Developer" ] && [ "${CODE_SIGN_IDENTITY}" != "Don't Code Sign" ]; then echo Doing a full bundle sign using genuine identity "${CODE_SIGN_IDENTITY}" for binext in $LIST_BINARY_EXTENSIONS do - codesign -fvvv -s "${CODE_SIGN_IDENTITY}" -i org.xbmc.kodi-ios `find ${CODESIGNING_FOLDER_PATH} -name "*.$binext" -type f` ${CODESIGNING_FOLDER_PATH} + codesign --deep -fvvv -s "${CODE_SIGN_IDENTITY_FOR_ITEMS}" -i "${BUNDLEID}" `find ${CODESIGNING_FOLDER_PATH} -name "*.$binext" -type f` ${CODESIGNING_FOLDER_PATH} done echo In case your app crashes with SIG_SIGN check the variable LIST_BINARY_EXTENSIONS in tools/darwin/Support/Codesign.command + + #repackage python eggs + EGGS=`find ${CODESIGNING_FOLDER_PATH} -name "*.egg" -type f` + for i in $EGGS; do + echo $i + mkdir del + unzip $i -d del + codesign --deep -fvvv -s "${CODE_SIGN_IDENTITY_FOR_ITEMS}" -i "${BUNDLEID}" `find ./del/ -name "*.$binext" -type f` ./del/ + rm $i + cd del && zip -r $i ./* && cd .. + rm -r ./del/ + done fi fi |