safetynet-fix/magisk/customize.sh
Danny Lin b3893d32f3
magisk: Allow limited installation on Android 7 and older
Key attestation was introduced in Android 7.0, but Android 7.x doesn't
have InMemoryDexClassLoader so our Zygisk module is incompatible.

In general, users on such old versions of Android don't need to bypass
hardware-backed attestation (which isn't even applicable on Android 6
and older), so allow them to install the module without the Zygisk part.

Closes #156.
2022-03-12 20:40:53 -08:00

15 lines
406 B
Bash
Executable File

#!/system/bin/sh
# Android 8.0 or newer
if [[ "$(getprop ro.build.version.sdk)" -lt 26 ]]; then
ui_print ""
ui_print "Functionality is limited on Android 7 and older."
ui_print "Hardware-backed attestation will not be disabled."
ui_print ""
# Remove Zygisk module, but keep props and scripts
rm -fr "$MODPATH/zygisk"
fi
chmod 755 "$MODPATH/service.sh" "$MODPATH/post-fs-data.sh"