-
Notifications
You must be signed in to change notification settings - Fork 7
/
patch.sh
82 lines (69 loc) · 1.8 KB
/
patch.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
#!/usr/bin/env bash
if [ "$1" = "-u" ]
then
echo ""
echo "Welcome to KINGbabasula's"
echo "STE patching script."
echo ""
echo "Usage:"
echo ""
echo "./patch.sh"
echo ""
echo "Arguments:"
echo ""
echo "-c - Cleans your repos before patching."
echo "-u - Shows usage."
echo ""
fi
if [ "$1" = "-c" ]
then
echo "Removing repos..."
rm -rf frameworks/av
rm -rf frameworks/base
rm -rf frameworks/native
rm -rf hardware/libhardware_legacy
rm -rf packages/services/Telephony
rm -rf system/core
echo "Syncing latest changes..."
repo sync -c -d -f -j5
fi
echo "Patching frameworks/base"
cp patches/frameworks_base.patch frameworks/base/frameworks_base.patch
cd frameworks/base
git am --signoff < frameworks_base.patch
rm frameworks_base.patch
cd ../..
echo ""
echo "Patching frameworks/av"
cp patches/frameworks_av.patch frameworks/av/frameworks_av.patch
cd frameworks/av
git am --signoff < frameworks_av.patch
rm frameworks_av.patch
cd ../..
echo ""
echo "Patching frameworks/native"
cp patches/frameworks_native.patch frameworks/native/frameworks_native.patch
cd frameworks/native
git am --signoff < frameworks_native.patch
rm frameworks_native.patch
cd ../..
echo ""
echo "Applying vibrator fix"
cp patches/vibrator_fix.patch hardware/libhardware_legacy/vibrator_fix.patch
cd hardware/libhardware_legacy
git am --signoff < vibrator_fix.patch
rm vibrator_fix.patch
cd ../..
echo ""
echo "Patching system/core"
cp patches/system_core.patch system/core/system_core.patch
cd system/core
git am --signoff < system_core.patch
rm system_core.patch
cd ../..
echo "Patching packages/services/Telephony"
cp patches/packages_services_Telephony.patch packages/services/Telephony/packages_services_Telephony.patch
cd packages/services/Telephony
git am --signoff < packages_services_Telephony.patch
rm packages_services_Telephony.patch
cd ../../..