forked from santajin/patchrom-vision
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomize_framework.sh
executable file
·43 lines (38 loc) · 1.25 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
#!/bin/bash
#
# $1: dir for miui
# $2: dir for original
#
APKTOOL=$PORT_ROOT/tools/apktool
ZIP_FILE=sensation_4.5.4.zip
if [ $2 = "out/framework" ];then
echo "delete framework redundance files"
rm -rf "out/framework/smali/com/android/internal/telephony"
echo "make framework2.jar"
mkdir -p "out/ZIP/system/framework"
cp -r "framework2.jar.out" "out/framework2.jar.out"
mv "out/framework/smali/miui" "out/framework2.jar.out/smali"
mkdir -p "out/framework2.jar.out/smali/android"
mv "out/framework/smali/android/widget" "out/framework2.jar.out/smali/android"
for file in `find "$1/smali/com/android/internal/telephony" -name "*.smali"`
do
newfile=${file/$1/"out/framework2.jar.out"}
if [ ! -f "$newfile" ]
then
mkdir -p `dirname $newfile`
echo "add widget smali from miui: $file"
cp $file $newfile
fi
done
$APKTOOL b "out/framework2.jar.out" "out/framework2.jar"
cp "out/framework2.jar" "out/ZIP/system/framework/framework2.jar"
elif [ $2 = "out/android.policy" ];then
curdir=`pwd`
cd overlay/android.policy.jar.out
for file in `find . -name *.smali`
do
dstfile="$curdir/out/android.policy/$file"
cat $file >> $dstfile
done
cd -
fi