Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shebang #197

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions re-signer/spike_resigner.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# !/bin/bash
#!/bin/bash

# Spike Re-Signer by Miguel Kennedy
# Re-signs Spike's ipa file with free or paid Apple accounts
# Maintains the same bundle id.
Expand Down Expand Up @@ -70,7 +71,7 @@ do
exit 0
break
;;
*)
*)
esac
done

Expand Down Expand Up @@ -103,7 +104,7 @@ do
exit 0
break
;;
*)
*)
esac
done

Expand All @@ -130,7 +131,7 @@ if [ $SHOULD_DOWNLOAD = "true" ]; then
exit 0
break
;;
*)
*)
esac
done
else
Expand Down Expand Up @@ -233,7 +234,7 @@ select answer in "${choices[@]}"; do
fi
done
done

CODE_SIGN_IDENTITY="$answer"

if [ "$CODE_SIGN_IDENTITY" = "" ]; then
Expand Down Expand Up @@ -362,16 +363,16 @@ do
/usr/libexec/PlistBuddy -c 'Print DeveloperCertificates:0' $TEMP_MOBILEPROVISION_PLIST_PATH > $TEMP_CERTIFICATE_PATH
# Get the common name (CN) from the certificate (regex capture between 'CN=' and '/OU'):
MOBILEPROVISION_IDENTITY_NAME=`openssl x509 -inform DER -in $TEMP_CERTIFICATE_PATH -subject -noout | perl -n -e '/CN=(.+)\/OU/ && print "$1"'`

if [ "$CODE_SIGN_IDENTITY" = "$MOBILEPROVISION_IDENTITY_NAME" ]; then
# Yay, this mobile provisioning profile matches up with the selected signing identity, let's continue...
# Get the name of the provisioning profile:
MOBILEPROVISION_PROFILE_NAME=`/usr/libexec/PlistBuddy -c 'Print Name' $TEMP_MOBILEPROVISION_PLIST_PATH`
MOBILEPROVISION_PROFILE_NAME=`/usr/libexec/PlistBuddy -c 'Print Name' $TEMP_MOBILEPROVISION_PLIST_PATH`

#Find corresponding app/extension
if [ "$SPIKE_DEVICE_VERSION" = "iPad" ]; then
if [[ "$MOBILEPROVISION_PROFILE_NAME" == *spikeipad.watchkitapp.watchkitextension ]]; then
FOUND_WATCH_EXTENSION_MOBILEPROVISION=true
FOUND_WATCH_EXTENSION_MOBILEPROVISION=true
cp $MOBILEPROVISION_FILENAME "${SCRIPT_DIR}/${MOBILE_PROVISION_FILES_DIR}/watchkitextension.mobileprovision"
elif [[ "$MOBILEPROVISION_PROFILE_NAME" == *spikeipad.watchkitapp ]]; then
FOUND_WATCH_APP_MOBILEPROVISION=true
Expand All @@ -396,7 +397,7 @@ do
fi
else
if [[ "$MOBILEPROVISION_PROFILE_NAME" == *spike.watchkitapp.watchkitextension ]]; then
FOUND_WATCH_EXTENSION_MOBILEPROVISION=true
FOUND_WATCH_EXTENSION_MOBILEPROVISION=true
cp $MOBILEPROVISION_FILENAME "${SCRIPT_DIR}/${MOBILE_PROVISION_FILES_DIR}/watchkitextension.mobileprovision"
elif [[ "$MOBILEPROVISION_PROFILE_NAME" == *spike.watchkitapp ]]; then
FOUND_WATCH_APP_MOBILEPROVISION=true
Expand Down Expand Up @@ -784,7 +785,7 @@ function resign {

log "Added iCloud service entitlements"
fi
fi
fi

log "Resigning application using certificate: '$CERTIFICATE'"
log "and entitlements from provisioning profile: $NEW_PROVISION"
Expand Down