mirror of
https://github.com/kdrag0n/safetynet-fix.git
synced 2024-11-19 11:11:22 +00:00
bc27f2211b
This ensures that GMS will never start before it's removed from the DenyList, even if another module's service.sh is blocking our script. Suggested-by: osm0sis <osm0sis@outlook.com>
40 lines
961 B
Bash
Executable File
40 lines
961 B
Bash
Executable File
#!/system/bin/sh
|
|
# Conditional MagiskHide properties
|
|
|
|
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 cross-region flash
|
|
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
|
|
|
|
# Late props which must be set after boot_completed
|
|
{
|
|
until [[ "$(getprop sys.boot_completed)" == "1" ]]; do
|
|
sleep 1
|
|
done
|
|
|
|
# avoid breaking OnePlus display modes/fingerprint scanners
|
|
resetprop vendor.boot.verifiedbootstate green
|
|
}&
|