-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcustomize.sh
81 lines (64 loc) · 1.58 KB
/
customize.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
# space
ui_print " "
# var
UID=`id -u`
[ ! "$UID" ] && UID=0
# log
if [ "$BOOTMODE" != true ]; then
FILE=/data/media/"$UID"/$MODID\_recovery.log
ui_print "- Log will be saved at $FILE"
exec 2>$FILE
ui_print " "
fi
# optionals
OPTIONALS=/data/media/"$UID"/optionals.prop
if [ ! -f $OPTIONALS ]; then
touch $OPTIONALS
fi
# debug
if [ "`grep_prop debug.log $OPTIONALS`" == 1 ]; then
ui_print "- The install log will contain detailed information"
set -x
ui_print " "
fi
# recovery
if [ "$BOOTMODE" != true ]; then
MODPATH_UPDATE=`echo $MODPATH | sed 's|modules/|modules_update/|g'`
rm -f $MODPATH/update
rm -rf $MODPATH_UPDATE
fi
# run
. $MODPATH/function.sh
# info
MODVER=`grep_prop version $MODPATH/module.prop`
MODVERCODE=`grep_prop versionCode $MODPATH/module.prop`
ui_print " ID=$MODID"
ui_print " Version=$MODVER"
ui_print " VersionCode=$MODVERCODE"
if [ "$KSU" == true ]; then
ui_print " KSUVersion=$KSU_VER"
ui_print " KSUVersionCode=$KSU_VER_CODE"
ui_print " KSUKernelVersionCode=$KSU_KERNEL_VER_CODE"
else
ui_print " MagiskVersion=$MAGISK_VER"
ui_print " MagiskVersionCode=$MAGISK_VER_CODE"
fi
ui_print " "
# sepolicy
FILE=$MODPATH/sepolicy.rule
DES=$MODPATH/sepolicy.pfsd
if [ "`grep_prop sepolicy.sh $OPTIONALS`" == 1 ]\
&& [ -f $FILE ]; then
mv -f $FILE $DES
fi
# cleaning
ui_print "- Cleaning..."
remove_sepolicy_rule
ui_print " "
# features
if [ "`grep_prop oneui.features $OPTIONALS`" == 0 ]; then
ui_print "- Does not use One UI features"
rm -f $MODPATH/system/etc/permissions/com.*\
$MODPATH/system/vendor/etc/floating_feature.xml
ui_print " "
fi