LazyBlog

需求

有跳轉其他應用需求時可能會需要查找該應用的Schemes來達到目標

取得ipa

APP砸殼正確姿勢

執行腳本

取得ipa後,利用下面的腳本來dump出所有的Schemes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
    #!/bin/sh   

RESET=`tput sgr0`
RED=`tput setaf 1`
GREEN=`tput setaf 2`

if [ "$1" ]; then

if ! [ -e "$1" ]
then
echo "⛔️️️️️️️️⛔️⛔️ ${RED}$1 does not exist!"
exit
fi

echo "${RESET}Unzipping..."
if ! [ -e "$1.zip" ]
then
mv "$1" "$1.zip"
fi

mkdir "extractSchemeURLTemp"
unzip "$1.zip" -d "extractSchemeURLTemp" &>/dev/null

echo "✅ URL Schemes:"
echo "${GREEN}"

files=(extractSchemeURLTemp/Payload/*.app)
APP_PATH=${files[0]}

echo "cat /plist/dict/key[text()='CFBundleURLTypes']/following-sibling::array/dict/array/string/text()" | xmllint --shell ${APP_PATH}/Info.plist | sed '/^\/ >/d' | sed 's/<[^>]*.//g'

mv "$1.zip" "$1"
rm -rf "extractSchemeURLTemp"
else
echo "${GREEN}⚙️ Installed extractSchemeURL!"
fi

if [ -e scripts/extract-scheme-url.sh ]
then
cp scripts/extract-scheme-url.sh ~/.extract-scheme-url.sh
else
if [ -e extract-scheme-url.sh ]
then
cp extract-scheme-url.sh ~/.extract-scheme-url.sh
fi
fi

if [ -e ~/.bashrc ]
then
string=$(<~/.bashrc)

if ! [[ $string == *"alias extractSchemeURL=\"bash ~/.extract-scheme-url.sh\""* ]]; then
echo "Setting extractSchemeURL..."
echo "alias extractSchemeURL=\"bash ~/.extract-scheme-url.sh\"" >> ~/.bashrc
cat ~/.bashrc
fi
else
echo "Setting extractSchemeURL..."
echo "alias extractSchemeURL=\"bash ~/.extract-scheme-url.sh\"" > ~/.bashrc
cat ~/.bashrc
fi

source ~/.bashrc

出處

該腳本來源


 評論