Skip to content

Commit 833d381

Browse files
committed
Add getUpdateInfoByName script
1 parent fb65dbf commit 833d381

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cookie

getUpdateInfoByName.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#! /bin/bash
2+
3+
if [ "$#" = 0 ]; then
4+
echo -e "Usage: ./[script] key\n"
5+
echo -e "\tSave your Bugly cookie to 'cookie' file to use to request"
6+
echo -e "\tAnd place you appid at the second line\n"
7+
exit
8+
fi
9+
10+
key=$2
11+
12+
if [ "$#" = 1 ]; then
13+
appid=`tail -n 1 cookie`
14+
key=$1
15+
fi
16+
17+
cookie=`head -n 1 cookie`
18+
19+
jq_cmd="jq -C --indent 2 '.upgrade.allUpdate.items[][] | select(.title | test(\"${key}\")) | {title, issuedCount: .dataPo.issuedCount, activeCount: .dataPo.activeCount}'"
20+
21+
curl_cmd="curl 'https://beta.bugly.qq.com/apps/${appid}/allupdate?pid=1' -s -H 'If-None-Match: W/\"12237-iKW9dNivmtEaZiYHh1fjsQ\"' -H 'Accept-Encoding: gzip, deflate, sdch, br' -H 'Accept-Language: en-GB,en;q=0.8,zh-CN;q=0.6,zh;q=0.4' -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Cookie: ${cookie}' -H 'Connection: keep-alive' -H 'Cache-Control: max-age=0' --compressed"
22+
23+
eval "$curl_cmd | perl -ne '/window\.__data=(.*?)<\/script>/ and print \$1, \"\n\"' | $jq_cmd" 2>/dev/null

0 commit comments

Comments
 (0)