forked from reiryuki/Volume-Booster-Magisk-Module
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice.sh
More file actions
75 lines (59 loc) · 1.36 KB
/
Copy pathservice.sh
File metadata and controls
75 lines (59 loc) · 1.36 KB
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
MODPATH=${0%/*}
# log
exec 2>$MODPATH/debug.log
set -x
# var
API=`getprop ro.build.version.sdk`
# restart
if [ "$API" -ge 24 ]; then
SERVER=audioserver
else
SERVER=mediaserver
fi
killall $SERVER\
android.hardware.audio@4.0-service-mediatek
# wait
sleep 20
# aml fix
AML=/data/adb/modules/aml
if [ -L $AML/system/vendor ]\
&& [ -d $AML/vendor ]; then
DIR=$AML/vendor/odm/etc
else
DIR=$AML/system/vendor/odm/etc
fi
if [ "$API" -ge 26 ] && [ -d $DIR ]\
&& [ ! -f $AML/disable ]; then
chcon -R u:object_r:vendor_configs_file:s0 $DIR
fi
AUD=`grep AUD= $MODPATH/copy.sh | sed -e 's|AUD=||g' -e 's|"||g'`
if [ -L $AML/system/vendor ]\
&& [ -d $AML/vendor ]; then
DIR=$AML/vendor
else
DIR=$AML/system/vendor
fi
FILES=`find $DIR -type f -name $AUD`
if [ -d $AML ] && [ ! -f $AML/disable ]\
&& find $DIR -type f -name $AUD; then
if ! grep '/odm' $AML/post-fs-data.sh && [ -d /odm ]\
&& [ "`realpath /odm/etc`" == /odm/etc ]; then
for FILE in $FILES; do
DES=/odm`echo $FILE | sed "s|$DIR||g"`
if [ -f $DES ]; then
umount $DES
mount -o bind $FILE $DES
fi
done
fi
if ! grep '/my_product' $AML/post-fs-data.sh\
&& [ -d /my_product ]; then
for FILE in $FILES; do
DES=/my_product`echo $FILE | sed "s|$DIR||g"`
if [ -f $DES ]; then
umount $DES
mount -o bind $FILE $DES
fi
done
fi
fi