-
Notifications
You must be signed in to change notification settings - Fork 3
/
customize_framework.sh
executable file
·54 lines (46 loc) · 1.78 KB
/
customize_framework.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
#!/bin/bash
# $1: dir for miui
# $2: dir for original
APKTOOL="$PORT_ROOT/tools/apktool --quiet"
BUILD_OUT=out
SEP_FRAME="framework2.jar.out"
if [ $2 = "$BUILD_OUT/framework" ]
then
# remove all files at out/framework those exist in framework2.jar.out
for file2 in `find framework2.jar.out -name *.smali`; do
file=${file2/framework2.jar.out/$BUILD_OUT\/framework}
echo "rm file: $file"
rm -rf "$file"
done
rm -rf "$BUILD_OUT/framework/smali/com/google/android/mms"
# move some smali to create a separate $SEP_FRAME.jar
# including: smali/miui smali/android/widget
mkdir -p "$BUILD_OUT/$SEP_FRAME/smali"
#rm -rf $BUILD_OUT/$SEP_FRAME/smali/miui
mkdir -p "$BUILD_OUT/$SEP_FRAME/smali/android"
mv "$BUILD_OUT/framework/smali/android/widget" "$BUILD_OUT/$SEP_FRAME/smali/android/"
#mv "$BUILD_OUT/framework/smali/miui" "$BUILD_OUT/$SEP_FRAME/smali"
fi
if [ $2 = "$BUILD_OUT/framework2" ]
then
# apply framework2.part on framework2.jar.out
cp -f other/framework2.part out/
cd out
$PORT_ROOT/tools/git.apply framework2.part
cd ..
for file3 in `find $2 -name *.rej`
do
echo "Fatal error: framework2 patch fail"
exit 1
done
# remove all files at out/framework1 those exist in framework.jar.out
for file2 in `find framework.jar.out -name *.smali`; do
file=${file2/framework.jar.out/$BUILD_OUT\/framework2}
echo "rm file: $file"
rm -rf "$file"
done
cp -rf "$BUILD_OUT/framework_miui/smali/com/google/android/mms" "$BUILD_OUT/framework2/smali/com/google/android"
mv "$BUILD_OUT/$SEP_FRAME/smali/android/widget/" "$BUILD_OUT/framework2/smali/android/widget"
#mv "$BUILD_OUT/$SEP_FRAME/smali/miui/" "$BUILD_OUT/framework2/smali/miui"
rm -rf $BUILD_OUT/$SEP_FRAME
fi