Created
December 19, 2021 15:24
-
-
Save shannah/9ed7f06eb8f753f5b11a6a0cff3d1bb5 to your computer and use it in GitHub Desktop.
A sample shellmarks script for getting entitlements from an IPA file.
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/bash | |
file_extracted="${file}-extracted" | |
if [ ! -d "${file_extracted}" ]; then | |
if [ ! -f "$file" ]; then | |
echo "Cannot find file $file" | |
exit 1 | |
fi | |
mkdir "${file_extracted}" | |
cp "$file" "${file_extracted}/App.zip" | |
cd "${file_extracted}" | |
unzip App.zip | |
else | |
cd ${file_extracted} | |
fi | |
appname=$(ls Payload | grep '\.app$') | |
if [ ! -z "$showEntitlements" ]; then | |
codesign -d --entitlements :- "Payload/${appname}" | |
fi | |
if [ ! -z "$showProvisioningProfile" ]; then | |
security cms -D -i "Payload/${appname}/embedded.mobileprovision" | |
fi | |
exit 0 | |
<shellmarks> | |
__title__="IPA Sample" | |
__tags__="#ios" | |
__description__=''' | |
<asciidoc> | |
This script will print out the entitlements and provisioning profile for given .ipa file. | |
See https://developer.apple.com/library/archive/qa/qa1798/_index.html[Apple Tech Article] for more information. | |
</asciidoc> | |
''' | |
[file] | |
type="file" | |
label="Select ipa file" | |
required=true | |
help="Select the .ipa file that you wish to inspect." | |
[showEntitlements] | |
type="checkbox" | |
label="Show Entitlements" | |
default="true" | |
help="Check this to show the ipa entitlements." | |
[showProvisioningProfile] | |
type="checkbox" | |
label="Show Provisioning Profile" | |
default="true" | |
help="Check this to show the ipa provisioning profile details." | |
</shellmarks> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment