This repository has been archived by the owner on Mar 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdevelop.sh
executable file
·55 lines (48 loc) · 1.71 KB
/
develop.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
45
46
47
48
49
50
51
52
53
54
PREVVER="6.3.8"
PREVCODE="79"
CURVER="6.4.0"
CURCODE="80"
#
# Check if smali patch can be reused.
#
compare(){
if [[ `(diff -rq src-v$1/smali/jp/radiko/ src-v$2/smali/jp/radiko/|grep -v '^Only in' |awk '{print $2}'| cut -d '/' -f 2- ;cat patch/$1/smali.patch|grep diff|grep smali/jp |awk '{print $3}' |cut -d '/' -f 2- ) |uniq -d` == "" ]] ;then
echo "Patch for $1 is suitable for $2"
else
echo "Something changed in files which should be patched, we cannot continue. Details:"
echo `(diff -rq src-v$1/smali/jp/radiko/ src-v$2/smali/jp/radiko/|grep -v '^Only in' |awk '{print $2}'| cut -d '/' -f 2- ;cat patch/$1/smali.patch|grep diff|grep smali/jp |awk '{print $3}' |cut -d '/' -f 2- ) |uniq -d`
fi
}
downloadRadiko(){
echo "Downloading radiko original apk"
DOWNLOADLINK=`curl -s https://apkpure.com/radiko-jp-for-android/jp.radiko.Player/download/$1-APK |grep -oP "(?<=id=\"iframe_download\" src=\").*?(?=\")"`
if [ $DOWNLOADLINK ];then
wget -O src-v$2.apk $DOWNLOADLINK || exit 1
else
exit 1
fi
}
downloadRadiko $PREVCODE $PREVVER
downloadRadiko $CURCODE $CURVER
java -jar tool/apktool_2.3.2.jar d -f src-v$PREVVER.apk
java -jar tool/apktool_2.3.2.jar d -f src-v$CURVER.apk
compare $PREVVER $CURVER
#
# Try generate so patch automatic
#
# [Not Implemented]
function work(){
for file in `ls $1`
do
if [ -d $1"/"$file ] ;then
work $1"/"$file
else
echo "work on $1/$file"
python parser.py $1"/"$file
fi
done
}
#cp -r lib lib_kai
#work libkai
#git diff --binary lib lib_kai |sed "s/lib_kai/lib/g"
#then change patch to a/lib b/lib