RED
=
'\033[0;31m'
GREEN
=
'\033[0;32m'
YELLOW
=
'\033[0;33m'
RESET
=
'\033[0m'
echo
"# ++++++++++++++++++++++++++++++++++++++++++"
echo
"# + 微信公众号:攻有道 By:Cha111Ng1 +"
echo
"# ++++++++++++++++++++++++++++++++++++++++++"
echo ""
cha11_Android() {
echo
"${GREEN}[*]进入微信目录->${RESET} cd /data/data/com.tencent.mm/MicroMsg"
cd
/
data
/
data
/
com.tencent.mm
/
MicroMsg
echo
"${GREEN}[*]查看系统当前.wxapkg包->${RESET} find ./ -name *.wxapkg"
find .
/
-
name
*
.wxapkg
echo ""
echo
"${YELLOW}[+]自动执行删除所有.wxapkg->${RESET} find ./ -name "
*
.wxapkg
" -exec rm {} \;"
find .
/
-
name
"*.wxapkg"
-
exec
rm {} \;
echo ""
echo
"${GREEN}[*]请输入小程序的名称:${RESET}"
read userInputfile
echo ""
mkdir
-
p
/
sdcard
/
xcx
/
$userInputfile
echo
"${GREEN}[*]请在手机上打开需要测试的小程序${RESET}"
echo
"${RED}[*]请确认是否已打开小程序 '确认-> y' 或 'n': ${RESET}"
read userInput
if
[
"$userInput"
=
=
"y"
]; then
find .
/
-
name
"*.wxapkg"
-
exec
cp {}
/
sdcard
/
xcx
/
$userInputfile \;
echo
"[+]获取的wxapkg包如下:"
ls
/
sdcard
/
xcx
/
$userInputfile
echo ""
echo
"${GREEN}[*]进入工作目录->${RESET} cd /data/data/com.tencent.mm/MicroMsg&&find ./ -name *.wxapkg"
echo
"${GREEN}[*]电脑端运行命令->${RESET} adb pull /sdcard/xcx/$userInputfile"
else
echo
"输入不是 'y'"
fi
}
cha11_IOS(){
echo
"[*]请输入小程序的AppID:"
read wxappid
echo ""
echo
"[*]请输入小程序的名称:"
read userInputfile
mkdir
-
p ~
/
xcx
/
$userInputfile
find
/
var
/
mobile
/
Containers
/
Data
/
Application
/
-
name
"*.wxapkg"
-
print
|
while
read
-
r
file
; do
if
[[ $
file
=
=
*
"$wxappid"
*
]]; then
cp
"$file"
~
/
xcx
/
$userInputfile
/
fi
done
ls ~
/
xcx
/
$userInputfile
echo ""
echo
"[*]电脑端运行命令-> scp -r root@kios.local:~/xcx/$userInputfile ./"
}
uname_output
=
$(uname)
if
[[
"$uname_output"
=
=
"Linux"
]]; then
echo
"${GREEN}[*]当前系统为安卓系统${RESET}"
cha11_Android
elif
[[
"$uname_output"
=
=
"Darwin"
]]; then
echo
"[*]当前系统为IOS系统"
cha11_IOS
else
echo
"[+]未知系统,请修改脚本"
fi