-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpost-fs-data.sh
63 lines (50 loc) · 1.04 KB
/
post-fs-data.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
mount -o rw,remount /data
MODPATH=${0%/*}
# log
exec 2>$MODPATH/debug-pfsd.log
set -x
# var
ABI=`getprop ro.product.cpu.abi`
# function
permissive() {
if [ "$SELINUX" == Enforcing ]; then
if ! setenforce 0; then
echo 0 > /sys/fs/selinux/enforce
fi
fi
}
magisk_permissive() {
if [ "$SELINUX" == Enforcing ]; then
if [ -x "`command -v magiskpolicy`" ]; then
magiskpolicy --live "permissive *"
else
$MODPATH/$ABI/libmagiskpolicy.so --live "permissive *"
fi
fi
}
sepolicy_sh() {
if [ -f $FILE ]; then
if [ -x "`command -v magiskpolicy`" ]; then
magiskpolicy --live --apply $FILE 2>/dev/null
else
$MODPATH/$ABI/libmagiskpolicy.so --live --apply $FILE 2>/dev/null
fi
fi
}
# selinux
SELINUX=`getenforce`
chmod 0755 $MODPATH/*/libmagiskpolicy.so
#1permissive
#2magisk_permissive
#kFILE=$MODPATH/sepolicy.rule
#ksepolicy_sh
FILE=$MODPATH/sepolicy.pfsd
sepolicy_sh
# conflict
rm -f /data/adb/modules/*/system/app/MotoSignatureApp/.replace
# cleaning
FILE=$MODPATH/cleaner.sh
if [ -f $FILE ]; then
. $FILE
mv -f $FILE $FILE.txt
fi