Created
November 10, 2014 20:25
-
-
Save shannah/fb2d89592f627d67d162 to your computer and use it in GitHub Desktop.
Script I used for codesigning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Example usage from build.xml file ---> | |
<exec executable="./codesign.sh"> | |
<!-- Path to the App --> | |
<arg value="path/to/MyApp.app"/> | |
<!-- Name of certificate to use to sign app --> | |
<arg value="3rd Party Mac Developer Application: XXX"/> | |
<!-- Path to entitlements file. Optional --> | |
<arg value="path/to/myapp.entitlements"/> | |
<!-- Path to jdk directory inside MyApp --> | |
<arg value="path/to/MyApp.app/Contents/PlugIns/jdk1.7.0_25.jdk"/> | |
</exec> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export APP_PATH="$1/Contents" | |
export CERT="$2" | |
export ENTITLEMENTS_PATH="$3" | |
export JDK_PATH="$4" | |
if [ -z $ENTITLEMENTS_PATH ]; then | |
find "$APP_PATH" -type f \( -name "*.jar" -or -name "*.dylib" -or -name "*.jnilib" \) -exec codesign --verbose=4 -f -s "$CERT" {} \; | |
find "$APP_PATH" -type f \( -name "*.jar" -or -name "*.dylib" -or -name "*.jnilib" \) -exec codesign --verbose=4 --verify {} \; | |
find "$JDK_PATH/Contents" -type f \( -name "*.jar" -or -name "*.dylib" \) -exec codesign --verbose=4 -f -s "$CERT" {} \; | |
find "$JDK_PATH/Contents" -type f \( -name "*.jar" -or -name "*.dylib" \) -exec codesign --verbose=4 --verify {} \; | |
codesign --deep --verbose=4 -f -s "$CERT" "$JDK_PATH" | |
codesign --deep --verbose=4 -f -s "$CERT" "$1" | |
else | |
find "$APP_PATH" -type f \( -name "*.jar" -or -name "*.dylib" -or -name "*.jnilib" \) -exec codesign --verbose=4 -f -s "$CERT" --entitlements "$ENTITLEMENTS_PATH" {} \; | |
find "$APP_PATH" -type f \( -name "*.jar" -or -name "*.dylib" -or -name "*.jnilib" \) -exec codesign --verbose=4 --verify {} \; | |
find "$JDK_PATH/Contents" -type f \( -name "*.jar" -or -name "*.dylib" \) -exec codesign --verbose=4 -f -s "$CERT" --entitlements "$ENTITLEMENTS_PATH" {} \; | |
find "$JDK_PATH/Contents" -type f \( -name "*.jar" -or -name "*.dylib" \) -exec codesign --verbose=4 --verify {} \; | |
codesign --deep --verbose=4 -f -s "$CERT" --entitlements "$ENTITLEMENTS_PATH" "$JDK_PATH" | |
codesign --deep --verbose=4 -f -s "$CERT" --entitlements "$ENTITLEMENTS_PATH" "$1" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment