forked from 0xjacklove/wxappUnpacker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bingo.sh
executable file
·46 lines (39 loc) · 856 Bytes
/
bingo.sh
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
#!/usr/bin/env bash
# MyWxappUnpacker 项目路径
WXAPPUNPACKER_PATH=`pwd`
FILE_FORMAT=wxapkg
wxappUnpacker_pkg() {
echo "node ${WXAPPUNPACKER_PATH}/wuWxapkg.js ${fname}"
node ${WXAPPUNPACKER_PATH}/wuWxapkg.js $2 $1
return 0;
}
wxappUnpacker() {
de_dir=$1
if [ -z "$1" ]
then
de_dir=`pwd`
fi
echo "${de_dir}"
echo "for wxapkg in `find ${de_dir} -name "*.${FILE_FORMAT}"`"
for fname in `find ${de_dir} -name "*.${FILE_FORMAT}"`
do
file_name=${fname##*/};
short_name=${file_name%*.wxapkg};
if [ -d $short_name ]
then rm -rf $short_name
fi
wxappUnpacker_pkg ${fname} $2
done
return 0;
}
de_pkg() {
if [ "-d" == "$1" ]
then
wxappUnpacker $1 $2
else
wxappUnpacker_pkg $1 $2
fi
return 0;
}
# $1: pkg file or pkg dir; $2: order
de_pkg $1 $2