customize: Prevent installation on Android 7.x and older

Android 7.x lacks the InMemoryDexClassLoader API, which is necessary for
the module to load Java code, and is unlikely to support hardware
attestation on any production devices anyway.

Fixes #124, #127
This commit is contained in:
Danny Lin 2021-12-21 15:40:57 -08:00
parent 09332546b0
commit 8ea2649fa0
No known key found for this signature in database
GPG Key ID: 1988FAA1797EE5AC

View File

@ -1,3 +1,12 @@
#!/system/bin/sh
# Android 8.0 or newer
if [[ "$(getprop ro.build.version.sdk)" -lt 26 ]]; then
ui_print "This module only supports Android 8.0 and newer."
# Abort install and clean up
rm -fr "$TMPDIR" "$MODPATH"
exit 1
fi
chmod 755 "$MODPATH/service.sh" "$MODPATH/post-fs-data.sh"