Skip to content

Instantly share code, notes, and snippets.

@zqqf16
Last active November 5, 2018 10:35
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zqqf16/8144968 to your computer and use it in GitHub Desktop.
Save zqqf16/8144968 to your computer and use it in GitHub Desktop.
Get the URL scheme from ipa file
#!/bin/bash
ipa_name=$1
plist_path=$(unzip -l "$ipa_name" | grep "Payload/[^/]*\/Info.plist" | sed 's/.*\(Payload.*Info.plist\)/\1/g')
#unzip
unzip -jo "$ipa_name" "$plist_path" >/dev/null
#convert to xml1 format
plutil -convert xml1 Info.plist
#5*5 is enough?
for u in {0..5}
do
for s in {0..5}
do
scheme=$(/usr/libexec/PlistBuddy -c "print CFBundleURLTypes:$u:CFBundleURLSchemes:$s" Info.plist 2>&1)
result=$(echo $scheme | grep "Does Not Exist")
if [[ "$result" == "" ]]
then
echo $scheme
else
break
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment