forked from MiCode/patchrom_i9500
-
Notifications
You must be signed in to change notification settings - Fork 0
/
customize_miui_app.sh
executable file
·53 lines (44 loc) · 991 Bytes
/
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
#/bin/bash
XMLMERGYTOOL=$PORT_ROOT/tools/ResValuesModify/jar/ResValuesModify
GIT_APPLY=$PORT_ROOT/tools/git.apply
curdir=`pwd`
function applyPatch () {
for patch in `find $1 -name *.patch`
do
cd out
$GIT_APPLY ../$patch
cd ..
for rej in `find $2 -name *.rej`
do
echo "Patch $patch fail"
exit 1
done
done
}
function appendSmaliPart() {
for file in `find $1/smali -name *.part`
do
filepath=`dirname $file`
filename=`basename $file .part`
dstfile="out/$filepath/$filename"
cat $file >> $dstfile
done
}
function mergyXmlPart() {
for file in `find $1/res -name *.xml.part`
do
src=`dirname $file`
dst=${src/$1/$2}
$XMLMERGYTOOL $src $dst
done
}
if [ $1 = "Phone" ];then
applyPatch $1 $2
appendSmaliPart $1
fi
if [ $1 = "MiuiHome" ];then
$XMLMERGYTOOL $1/res/values $2/res/values
fi
if [ $1 = "MiuiSystemUI" ];then
$XMLMERGYTOOL $1/res/values $2/res/values
fi