safetynet-fix/post-fs-data.sh
Danny Lin 7c27b7744b
Update Android 12 support for stable SDK 31
Android 12's SDK is now versioned as 31, so it no longer needs to be
special-cased.
2021-07-23 19:11:16 -07:00

19 lines
418 B
Bash
Executable File

#!/system/bin/sh
MODPATH="/data/adb/modules/safetynet-fix"
# Get runtime version
sdk="$(getprop ro.build.version.sdk)"
version="$(getprop ro.vendor.build.version.release)"
# Prepare to update version
rm -fr "$MODPATH/system"
# Make sure version is supported
if [[ ! -d "$MODPATH/system_sdk$sdk" ]]; then
exit
fi
# Symlink results in the wrong SELinux context
cp -r "$MODPATH/system_sdk$sdk" "$MODPATH/system"