mirror of
https://github.com/kdrag0n/safetynet-fix.git
synced 2024-11-19 11:11:22 +00:00
magisk: Add service script for MagiskHide device indicators
This functionality has been removed from Magisk:
003fea52b1
Simple properties are set in system.prop, but more advanced overrides
need to be handled by a script.
This commit is contained in:
parent
bcf9a767c4
commit
791884862a
@ -38,6 +38,8 @@ ui_print "- Extracting module files"
|
||||
|
||||
extract "$ZIPFILE" 'module.prop' "$MODPATH"
|
||||
extract "$ZIPFILE" 'classes.dex' "$MODPATH"
|
||||
extract "$ZIPFILE" 'service.sh' "$MODPATH"
|
||||
chmod 755 "$MODPATH/service.sh"
|
||||
|
||||
# Riru v24+ load files from the "riru" folder in the Magisk module folder
|
||||
# This "riru" folder is also used to determine if a Magisk module is a Riru module
|
||||
|
28
riru/template/magisk_module/service.sh
Normal file
28
riru/template/magisk_module/service.sh
Normal file
@ -0,0 +1,28 @@
|
||||
#!/system/bin/sh
|
||||
|
||||
maybe_set_prop() {
|
||||
local prop="$1"
|
||||
local contains="$2"
|
||||
local value="$3"
|
||||
|
||||
if [[ "$(getprop "$prop")" == *"$contains"* ]]; then
|
||||
resetprop "$prop" "$value"
|
||||
fi
|
||||
}
|
||||
|
||||
# Magisk recovery mode
|
||||
maybe_set_prop ro.bootmode recovery unknown
|
||||
maybe_set_prop ro.boot.mode recovery unknown
|
||||
maybe_set_prop vendor.boot.mode recovery unknown
|
||||
|
||||
# MIUI region
|
||||
maybe_set_prop ro.boot.hwc CN GLOBAL
|
||||
maybe_set_prop ro.boot.hwcountry China GLOBAL
|
||||
|
||||
resetprop --delete ro.build.selinux
|
||||
|
||||
# SELinux permissive
|
||||
if [[ "$(cat /sys/fs/selinux/enforce)" == "0" ]]; then
|
||||
chmod 640 /sys/fs/selinux/enforce
|
||||
chmod 440 /sys/fs/selinux/policy
|
||||
fi
|
Loading…
Reference in New Issue
Block a user