Last active
August 29, 2015 14:27
-
-
Save lacostej/f35f5fb8f3367551f22c to your computer and use it in GitHub Desktop.
Patch PackageApplication from a serie of patches
This file contains hidden or 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
From 813dee621ea00f6c42af1c4a3c459a140fd78a3b Mon Sep 17 00:00:00 2001 | |
From: Jerome Lacoste <[email protected]> | |
Date: Thu, 13 Aug 2015 14:35:57 +0200 | |
Subject: [PATCH] PackageApplication still passes resource-rules while it is | |
deprecated. | |
See https://developer.apple.com/library/mac/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG206 | |
--- | |
PackageApplication4Gym | 8 +++++++- | |
1 file changed, 7 insertions(+), 1 deletion(-) | |
diff --git a/PackageApplication4Gym b/PackageApplication4Gym | |
index a6cc2b8..3085608 100755 | |
--- a/PackageApplication4Gym | |
+++ b/PackageApplication4Gym | |
@@ -152,9 +152,15 @@ if ( defined $opt{sign} ) { | |
} | |
} | |
- my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements,resource-rules", | |
+ my @codesign_args; | |
+ if (-e '$destApp/ResourceRules.plist') { # If ResourceRules.plist exists, include it in codesign arguments, for backwards compatability | |
+ @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements,resource-rules", | |
"--sign", $opt{sign}, | |
"--resource-rules=$destApp/ResourceRules.plist"); | |
+ } else { # If ResourceRules.plist isn't found, don't include it in the codesign arguments | |
+ @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements", | |
+ "--sign", $opt{sign}); | |
+ } | |
if ( -e $entitlements_plist ) { | |
push(@codesign_args, '--entitlements'); | |
-- | |
1.8.4.1 |
This file contains hidden or 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
# pach_repo contains patches generated by a directory created with | |
# cd patch_repo | |
# cp `xcrun --sdk iphoneos -f PackageApplication` PackageApplication4Gym | |
# git init | |
# git add PackageApplication4Gym | |
# git commit -am "Original version" | |
# [edit...] | |
# git format-patch -N | |
# md5 PackageApplication4Gym > md5.txt | |
patch_repo=`cd "$1"; pwd` | |
pa_path=`xcrun --sdk iphoneos -f PackageApplication` | |
pag_path="${pa_path}4Gym" | |
dir=`dirname "${pa_path}"` | |
echo "PackageApplication PATH: ${pa_path}" | |
if [ -f "${pag_path}" ]; then | |
# check against expectd md5 | |
md5_file="${patch_repo}/md5.txt" | |
tempfoo=`basename $0` | |
TMPFILE=`mktemp /tmp/${tempfoo}.XXXXXX` | |
(cd "$dir"; md5 PackageApplication4Gym ) > $TMPFILE | |
diff "${TMPFILE}" "${md5_file}" | |
# FIXME if fail RM it | |
fi | |
if [ -f "${pag_path}" ]; then | |
echo "File already there, no need to install" | |
exit | |
fi | |
echo "proceeding to install patches" | |
patches=`( cd "${patch_repo}"; ls -1 *.patch )` | |
cp "${pa_path}" "${pag_path}" | |
for patch in $patches | |
do | |
echo "Applying ${patch} to ${pag_path}" | |
(cd "$dir"; patch < "${patch_repo}/$patch" ) | |
done | |
# FIXME check md5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment