Skip to content

Commit

Permalink
Sign temp signature using ad hoc certificate
Browse files Browse the repository at this point in the history
Also update xattr with -r option to recursive clear all attributes

Signed-off-by: Sophia Guo <sophia.gwf@gmail.com>
  • Loading branch information
sophia-guo committed Jul 27, 2023
1 parent 509f443 commit 3a33e09
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tooling/repro_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function removeSignatures() {
fi

# Remove any extended app attr
xattr -c "${MAC_JDK_ROOT}"
xattr -cr "${MAC_JDK_ROOT}"

FILES=$(find "${MAC_JDK_ROOT}" \( -type f -and -path '*.dylib' -or -path '*/bin/*' -or -path '*/lib/jspawnhelper' -not -path '*/modules_extracted/*' -or -path '*/jpackageapplauncher*' \))
for f in $FILES
Expand Down Expand Up @@ -128,14 +128,12 @@ function tempSign() {
elif [[ "$OS" =~ Darwin* ]]; then
MAC_JDK_ROOT="${JDK_DIR}/../../Contents"
echo "Adding temp Signatures for ${MAC_JDK_ROOT}"
#TODO Generate locally certificate SELF_CERT

FILES=$(find "${MAC_JDK_ROOT}" \( -type f -and -path '*.dylib' -or -path '*/bin/*' -or -path '*/lib/jspawnhelper' -not -path '*/modules_extracted/*' -or -path '*/jpackageapplauncher*' \))
for f in $FILES
do
echo "Signing $f with a local certificate"
echo "Signing $f with ad-hoc signing"
# Sign both with same local Certificate, this adjusts __LINKEDIT vmsize identically
codesign -s "$SELF_CERT" --options runtime -f --timestamp "$f"
codesign -s "-" "$f"
done
fi
}
Expand Down

0 comments on commit 3a33e09

Please sign in to comment.