-
Notifications
You must be signed in to change notification settings - Fork 3
/
customize_miui_app.sh
executable file
·99 lines (85 loc) · 1.91 KB
/
customize_miui_app.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
#
# $1: dir for original miui app
# $2: dir for target miui app
#
XMLMERGYTOOL=$PORT_ROOT/tools/ResValuesModify/jar/ResValuesModify
GIT_APPLY=$PORT_ROOT/tools/git.apply
curdir=`pwd`
function appendPart() {
for file in `find $1/smali -name *.part`
do
filepath=`dirname $file`
filename=`basename $file .part`
dstfile="out/$filepath/$filename"
cat $file >> $dstfile
done
}
if [ $1 = "Settings" ];then
cp $1/*.part out/
cd out
$GIT_APPLY Settings.part
cd ..
for file in `find $2 -name *.rej`
do
echo "Fatal error: Settings patch fail"
exit 1
done
$XMLMERGYTOOL $1/res/values $2/res/values
fi
if [ $1 = "Mms" ];then
cp $1/*.part out/
cd out
$GIT_APPLY Mms.part
cd ..
for file in `find $2 -name *.rej`
do
echo "Fatal error: Mms patch fail"
exit 1
done
$XMLMERGYTOOL $1/res/values $2/res/values
fi
if [ $1 = "Phone" ];then
$XMLMERGYTOOL $1/res/values $2/res/values
fi
if [ $1 = "ThemeManager" ];then
# cp other/ThemeManager.part out/
# cd out
# $GIT_APPLY ThemeManager.part
# cd ..
# for file in `find $2 -name *.rej`
# do
# echo "Fatal error: ThemeManager patch fail"
# exit 1
# done
#
$XMLMERGYTOOL $1/res/values $2/res/values
fi
if [ $1 = "MiuiHome" ];then
cp $1/*.part out/
cd out
$GIT_APPLY MiuiHome.part
cd ..
for file in `find $2 -name *.rej`
do
echo "Fatal error: MiuiHome patch fail"
exit 1
done
fi
if [ $1 = "MiuiSystemUI" ];then
$XMLMERGYTOOL $1/res/values $2/res/values
appendPart $1
fi
if [ $1 = "Music" ];then
# mkdir -p $1
# mkdir -p $2/res/raw-xhdpi/
# cp $1/res/raw-xhdpi/* $2/res/raw-xhdpi/
#
$XMLMERGYTOOL $1/res/values-xhdpi $2/res/values-xhdpi
fi
if [ $1 = "Contacts" ];then
$XMLMERGYTOOL $1/res/values-xhdpi $2/res/values-xhdpi
fi
if [ $1 = "DeskClock" ];then
$XMLMERGYTOOL $1/res/values-xhdpi $2/res/values-xhdpi
fi