Last active
November 5, 2018 10:35
-
-
Save zqqf16/8144968 to your computer and use it in GitHub Desktop.
Get the URL scheme from ipa file
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
#!/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